adding arm AUR/logmein-hamachi

This commit is contained in:
WarheadsSE 2012-03-22 14:05:22 -04:00
parent 418cd0f7d9
commit 4d0d7e1a3d
3 changed files with 211 additions and 0 deletions

View file

@ -0,0 +1,47 @@
# Contributor: Xavion <Xavion (dot) 0 (at) Gmail (dot) com>
# Contributor: Lauri Niskanen <ape@ape3000.com>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: metzen <metzen@gmail.com>
# Contributor: WarheadsSE <max@warheads.net>
company=logmein
product=hamachi
pkgname=${company}-${product}
pkgver=2.1.0.18
pkgrel=2
plugrel=1
pkgdesc="A zero-configuration VPN service"
arch=("i686" "x86_64" "arm" "armv7")
url="https://secure.${company}.com/UK/products/${product}/"
license=("custom")
conflicts=("${product}")
replaces=("${product}")
install="${pkgname}.install"
options=("!strip")
[ "${CARCH}" == "i686" ] && filearch=x86 && sha1sums=('306e537c2dff541ace8bfbdd69514c12343f53d1')
[ "${CARCH}" == "x86_64" ] && filearch=x64 && sha1sums=('fe5e311b702205a317bd598d8029d03b36d2ffec')
[ "${CARCH}" == "arm" ] && filearch=armel && sha1sums=('98f87e9eb713bfe5605c14e0b8a5fd79371839ce')
[ "${CARCH}" == "armv7" ] && filearch=armel && sha1sums=('98f87e9eb713bfe5605c14e0b8a5fd79371839ce')
source=("https://secure.${company}.com/labs/${pkgname}-${pkgver}-${filearch}.tgz")
package() {
cd "${srcdir}"/${pkgname}-${pkgver}-${filearch}
# Directories
install -d "${pkgdir}"/opt/${pkgname}/bin
install -d "${pkgdir}"/usr/bin "${pkgdir}"/etc/rc.d
install -d "${pkgdir}"/usr/share/licenses/${pkgname}
install -m 755 ${product}d ""${pkgdir}"/opt/${pkgname}/bin"
install -m 755 dnsup ""${pkgdir}"/opt/${pkgname}/bin"
install -m 755 dnsdown ""${pkgdir}"/opt/${pkgname}/bin"
install -m 755 uninstall.sh ""${pkgdir}"/opt/${pkgname}"
install -m 444 README ""${pkgdir}"/opt/${pkgname}"
install -m 444 LICENSE ""${pkgdir}"/opt/${pkgname}"
install -m 444 CHANGES ""${pkgdir}"/opt/${pkgname}"
ln -sf "/opt/${pkgname}/bin/${product}d" ""${pkgdir}"/usr/bin/${product}"
install -m 755 "${startdir}"/${product}-init ""${pkgdir}"/etc/rc.d/${pkgname}"
# License
ln -sf "/opt/${pkgname}/LICENSE" "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}

122
aur/logmeing-hamachi/hamachi-init Executable file
View file

@ -0,0 +1,122 @@
#! /bin/bash
### BEGIN INIT INFO
# Provides: logmein-hamachi
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop logmein-hamachi engine
### END INIT INFO
#
# Author: LogMeIn, Inc. <hamachilinux-feedback@logmein.com>
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="LogMeIn Hamachi VPN tunneling engine"
NAME=logmein-hamachi
DAEMON=/opt/logmein-hamachi/bin/hamachid
PID=`pidof -o %PPID $DAEMON`
PIDFILE=/var/run/logmein-hamachi/hamachid.pid
#SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 5
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Define LSB log_* functions. Depend on lsb-base (>= 3.0-6)
#. /lib/lsb/init-functions
. /etc/rc.conf
. /etc/rc.d/functions
# start the daemon/service
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
#start_daemon -p $PIDFILE $DAEMON
/opt/logmein-hamachi/bin/hamachid
return "$?"
}
# stop the daemon/service
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
#stop_daemon $DAEMON
#killproc -p $PIDFILE $DAEMON
[ ! -z "$PID" ] && kill $PID &> /dev/null
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# remove pidfile if daemon could not delete on exit.
rm -f $PIDFILE
return "$RETVAL"
}
case "$1" in
start)
echo -n "Starting $DESC $NAME"
do_start
case "$?" in
0|1) stat_done ; add_daemon logmein-hamachi ;;
*) stat_fail ;;
esac
;;
stop)
echo -n "Stopping $DESC $NAME"
do_stop
case "$?" in
0|1) stat_done ; rm_daemon logmein-hamachi ;;
2) stat_fail ;;
esac
;;
restart|force-reload)
echo -n "Restarting $DESC $NAME"
do_stop
case "$?" in
0|1)
sleep 1
do_start
case "$?" in
0) stat_done ;;
1) stat_fail ;; # Old process is still running
*) stat_fail ;; # Failed to start
esac
;;
*)
# Failed to stop
stat_fail
;;
esac
;;
*)
#log_warning_msg "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
echo "usage: $0 {start|stop|restart}"
exit 3
;;
esac
:

View file

@ -0,0 +1,42 @@
# LogMeIn-Hamachi: Installer: Arch
# Contributor: Xavion <Xavion (dot) 0 (at) Gmail (dot) com>
# arg 1: the new package version
post_install() {
/etc/rc.d/logmein-hamachi start
echo "To automatically start the LogMeIn Hamachi service when your system boots, add 'logmein-hamachi' to the DAEMONS array of your '/etc/rc.conf'."
echo "To allow a standard user to control LogMeIn Hamachi, add 'Ipc.User <login name>' to '/var/lib/logmein-hamachi/h2-engine-override.cfg' and restart the service."
}
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
post_install
}
pre_remove() {
/etc/rc.d/logmein-hamachi stop
#/bin/true
}
user_remove() {
#if [ -n ${SUDO_USER} ]
#then
#ifndef HOME
#HOME = ~$(USER)
# export HOME=/home/${USER}
#endif
#fi
/bin/true
}
post_remove() {
/bin/true
}
op=$1
shift
$op $*