From 771c19519ccae8d3e1cbdc4bda2c23a08db29648 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 14 Sep 2010 13:21:13 +0000 Subject: testing/tinc: new aport tinc is a Virtual Private Network (VPN) daemon http://www.tinc-vpn.org/ ref #431 --- testing/tinc/APKBUILD | 50 +++++++++++++++++++++++++++++++++++ testing/tinc/tinc.networks | 13 +++++++++ testing/tinc/tincd.initd | 64 +++++++++++++++++++++++++++++++++++++++++++++ testing/tinc/tincd.lo.initd | 46 ++++++++++++++++++++++++++++++++ 4 files changed, 173 insertions(+) create mode 100644 testing/tinc/APKBUILD create mode 100644 testing/tinc/tinc.networks create mode 100644 testing/tinc/tincd.initd create mode 100644 testing/tinc/tincd.lo.initd (limited to 'testing') diff --git a/testing/tinc/APKBUILD b/testing/tinc/APKBUILD new file mode 100644 index 0000000000..0a91979c1e --- /dev/null +++ b/testing/tinc/APKBUILD @@ -0,0 +1,50 @@ +# Maintainer: Natanael Copa +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 0000000000..e1844ce2ba --- /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 0000000000..452687dfb6 --- /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 0000000000..79c185b381 --- /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 +} -- cgit v1.2.3