diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-09-14 13:21:13 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-09-14 13:48:29 +0000 |
commit | 771c19519ccae8d3e1cbdc4bda2c23a08db29648 (patch) | |
tree | 8d69ddd205582dc8ab0b7e6b57ebd200acb88636 | |
parent | dd384ac8e791fd4303e3ca7f147bb672cfce2690 (diff) | |
download | aports-771c19519ccae8d3e1cbdc4bda2c23a08db29648.tar.bz2 aports-771c19519ccae8d3e1cbdc4bda2c23a08db29648.tar.xz |
testing/tinc: new aport
tinc is a Virtual Private Network (VPN) daemon
http://www.tinc-vpn.org/
ref #431
-rw-r--r-- | testing/tinc/APKBUILD | 50 | ||||
-rw-r--r-- | testing/tinc/tinc.networks | 13 | ||||
-rw-r--r-- | testing/tinc/tincd.initd | 64 | ||||
-rw-r--r-- | testing/tinc/tincd.lo.initd | 46 |
4 files changed, 173 insertions, 0 deletions
diff --git a/testing/tinc/APKBUILD b/testing/tinc/APKBUILD new file mode 100644 index 000000000..0a91979c1 --- /dev/null +++ b/testing/tinc/APKBUILD @@ -0,0 +1,50 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=tinc +pkgver=1.0.13 +pkgrel=0 +pkgdesc="tinc is a Virtual Private Network (VPN) daemon" +url="http://www.tinc-vpn.org/" +license="GPL-2" +depends= +makedepends="zlib-dev lzo-dev" +install= +subpackages="$pkgname-doc" +source="http://www.tinc-vpn.org/packages/tinc-$pkgver.tar.gz + tincd.initd + tincd.lo.initd + tinc.networks" + +_builddir="$srcdir"/$pkgname-$pkgver +prepare() { + cd "$_builddir" + # apply patches here +} + +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --enable-jumbograms \ + --enable-lzo \ + --enable-zlib + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install + + mkdir "$pkgdir"/etc/tinc + install -m755 -D "$srcdir"/tincd.initd "$pkgdir"/etc/init.d/tincd + install -m755 -D "$srcdir"/tincd.lo.initd \ + "$pkgdir"/etc/init.d/tincd.lo + install -m644 -D "$srcdir"/tinc.networks \ + "$pkgdir"/etc/conf.d/tinc.networks +} + +md5sums="86263994d38c750431efd17e9a91a248 tinc-1.0.13.tar.gz +89d104d38bab84d6f92d27464e48628d tincd.initd +96d8778284637fa7790a4c6239a72070 tincd.lo.initd +475d64d9aa410ec7e91f5b079800abc9 tinc.networks" diff --git a/testing/tinc/tinc.networks b/testing/tinc/tinc.networks new file mode 100644 index 000000000..e1844ce2b --- /dev/null +++ b/testing/tinc/tinc.networks @@ -0,0 +1,13 @@ +# file: /etc/conf.d/tinc.networks for /etc/init.d/tincd + +# In this file you define the tinc networks you want to connect to + +# USAGE: +# you add a network to the init script by defining: +# NETWORK: your_network_name +# +# if you want to connect to multiple VPN's just set them behind each other. e.g. +# NETWORK: foo +# NETWORK: bar +# +# this would join the network foo and the network bar. diff --git a/testing/tinc/tincd.initd b/testing/tinc/tincd.initd new file mode 100644 index 000000000..452687dfb --- /dev/null +++ b/testing/tinc/tincd.initd @@ -0,0 +1,64 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd,v 1.5 2008/04/01 14:08:45 dragonheart Exp $ + +opts="reload" + +depend() { + use logger dns + need net +} + +checkconfig() { + if ! grep -q '^ *NETWORK:' /etc/conf.d/tinc.networks + then + eerror "No VPN networks configured in /etc/conf.d/tinc.networks" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting tinc VPN networks" + eend 0 + awk '/^ *NETWORK:/ { print $2 }' /etc/conf.d/tinc.networks | while read TINCNET + do + if [ ! -f /etc/tinc/"$TINCNET"/tinc.conf ] + then + eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !" + else + ebegin "Starting tinc network $TINCNET" + /usr/sbin/tincd --net="$TINCNET" --logfile=/var/log/tinc.$TINCNET.log --pidfile=/var/run/tinc.$TINCNET.pid + eend $? + fi + done +} + +stop() { + ebegin "Stopping tinc VPN networks" + eend 0 + awk '/^ *NETWORK:/ { print $2 }' /etc/conf.d/tinc.networks | while read TINCNET + do + if [ -f /var/run/tinc."$TINCNET".pid ] + then + ebegin "Stopping tinc network $TINCNET" + /usr/sbin/tincd --kill --pidfile=/var/run/tinc."$TINCNET".pid + eend $? + fi + done +} + +reload() { + ebegin "Reloading configuration for tinc VPN networks" + eend 0 + awk '/^ *NETWORK:/ { print $2 }' /etc/conf.d/tinc.networks | while read TINCNET + do + if [ -f /var/run/tinc."$TINCNET".pid ] + then + ebegin "Reloading tinc network $TINCNET" + /usr/sbin/tincd --kill HUP --pidfile=/var/run/tinc."$TINCNET".pid + eend $? + fi + done +} diff --git a/testing/tinc/tincd.lo.initd b/testing/tinc/tincd.lo.initd new file mode 100644 index 000000000..79c185b38 --- /dev/null +++ b/testing/tinc/tincd.lo.initd @@ -0,0 +1,46 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd.lo,v 1.1 2010/07/18 10:04:56 dragonheart Exp $ + +opts="reload" + +depend() +{ + use logger dns + need net +} + +start() +{ + TINCNET=${RC_SVCNAME#*.} + if [ -f /etc/tinc/"$TINCNET"/tinc.conf ] ; then + ebegin "Starting tinc network $TINCNET" + /usr/sbin/tincd --debug=1 --net="$TINCNET" --logfile=/var/log/tinc.$TINCNET.log --pidfile=/var/run/tinc.$TINCNET.pid + eend $? + else + eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !" + fi +} + +stop() +{ + TINCNET=${RC_SVCNAME#*.} + if [ -f /var/run/tinc."$TINCNET".pid ] ; then + ebegin "Stopping tinc network $TINCNET" + /usr/sbin/tincd --kill --pidfile=/var/run/tinc."$TINCNET".pid + eend $? + else + eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !" + fi +} + +reload() +{ + TINCNET=${RC_SVCNAME#*.} + if [ -f /var/run/tinc."$TINCNET".pid ] ; then + ebegin "Reloading configuration for tinc network $TINCNET" + /usr/sbin/tincd --kill HUP --pidfile=/var/run/tinc."$TINCNET".pid + eend $? + fi +} |