From ea1f4bece8870857691a7123bdc899562760b3fe Mon Sep 17 00:00:00 2001 From: root Date: Tue, 20 Dec 2011 23:14:59 +0000 Subject: Tue Dec 20 23:14:59 UTC 2011 --- community/tinc/PKGBUILD | 40 ++++++++++++++++++++++++++++++++++++++++ community/tinc/tinc.install | 20 ++++++++++++++++++++ community/tinc/tincd.conf | 5 +++++ community/tinc/tincd.rc | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 community/tinc/PKGBUILD create mode 100644 community/tinc/tinc.install create mode 100644 community/tinc/tincd.conf create mode 100644 community/tinc/tincd.rc (limited to 'community/tinc') diff --git a/community/tinc/PKGBUILD b/community/tinc/PKGBUILD new file mode 100644 index 000000000..b9d82940a --- /dev/null +++ b/community/tinc/PKGBUILD @@ -0,0 +1,40 @@ +# $Id: PKGBUILD 60867 2011-12-19 16:25:32Z tredaelli $ +# Maintainer: Timothy Redaelli +# Contributor: helios +# Contributor: Lothar Gesslein + +pkgname=tinc +pkgver=1.0.16 +pkgrel=1 +pkgdesc="VPN (Virtual Private Network) daemon" +arch=('i686' 'x86_64') +url="http://www.tinc-vpn.org/" +license=('GPL') +depends=('lzo2' 'openssl') +backup=(etc/conf.d/tincd.conf) +install=tinc.install +source=("http://www.tinc-vpn.org/packages/tinc-$pkgver.tar.gz" + "tincd.rc" "tincd.conf") +md5sums=('f1c7ed94878725fb2cf4efb02bf160da' + '64bb53748d9051255f243003f0d511f5' + '7c0276d4812cc5d3cc18142562a3aa82') + +build() { + cd "$srcdir/$pkgname-$pkgver" + + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + make DESTDIR="$pkgdir/" install + install -dm755 "$pkgdir"/usr/share/tinc/examples + tar xozvf doc/sample-config.tar.gz -C $pkgdir/usr/share/tinc/examples + find "$pkgdir"/usr/share/tinc/examples -type f -exec chmod 644 {} + + find "$pkgdir"/usr/share/tinc/examples -type d -exec chmod 755 {} + + + install -Dm755 "$srcdir/tincd.rc" "$pkgdir/etc/rc.d/tincd" + install -Dm644 "$srcdir/tincd.conf" "$pkgdir/etc/conf.d/tincd.conf" +} diff --git a/community/tinc/tinc.install b/community/tinc/tinc.install new file mode 100644 index 000000000..1b804fd8d --- /dev/null +++ b/community/tinc/tinc.install @@ -0,0 +1,20 @@ +infodir=/usr/share/info +filelist=(tinc.info.gz) + +post_install() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info $infodir/$file $infodir/dir 2> /dev/null + done +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + [ -x usr/bin/install-info ] || return 0 + for file in ${filelist[@]}; do + install-info --delete $infodir/$file $infodir/dir 2> /dev/null + done +} diff --git a/community/tinc/tincd.conf b/community/tinc/tincd.conf new file mode 100644 index 000000000..6e0902bbb --- /dev/null +++ b/community/tinc/tincd.conf @@ -0,0 +1,5 @@ +# Extra options to be passed to tincd. +# TINCD_EXTRAOPTS="-d" + +# Arrays containing all names of the networks to be started from rc.d. +NETNAMES=() diff --git a/community/tinc/tincd.rc b/community/tinc/tincd.rc new file mode 100644 index 000000000..48c132f25 --- /dev/null +++ b/community/tinc/tincd.rc @@ -0,0 +1,42 @@ +#!/bin/bash + +daemon_name=tincd + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/$daemon_name.conf + +case "$1" in + start) + for net in "${NETNAMES[@]}"; do + stat_busy "Starting ${daemon_name}" + /usr/sbin/tincd -n "${net}" $TINCD_EXTRAOPTS &>/dev/null + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon ${daemon_name} + stat_done + fi + done + ;; + stop) + stat_busy "Stopping ${daemon_name}" + for net in "${NETNAMES[@]}"; do + /usr/sbin/tincd -k -n "${net}" &>/dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon ${daemon_name} + stat_done + fi + done + ;; + restart) + "$0" stop + sleep 5 + "$0" start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 -- cgit v1.2.3-54-g00ecf