From b70d422361400cc6a43c322e9f446dc2b3791504 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 10 Dec 2010 20:04:19 +0000 Subject: main/tinc: renamed --- main/tinc/APKBUILD | 50 +++++++++++++++++++++++++++++++++++++ main/tinc/tinc.networks | 13 ++++++++++ main/tinc/tincd.initd | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ main/tinc/tincd.lo.initd | 46 ++++++++++++++++++++++++++++++++++ 4 files changed, 173 insertions(+) create mode 100644 main/tinc/APKBUILD create mode 100644 main/tinc/tinc.networks create mode 100644 main/tinc/tincd.initd create mode 100644 main/tinc/tincd.lo.initd (limited to 'main/tinc') diff --git a/main/tinc/APKBUILD b/main/tinc/APKBUILD new file mode 100644 index 000000000..1ae15310e --- /dev/null +++ b/main/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 openssl-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/main/tinc/tinc.networks b/main/tinc/tinc.networks new file mode 100644 index 000000000..e1844ce2b --- /dev/null +++ b/main/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/main/tinc/tincd.initd b/main/tinc/tincd.initd new file mode 100644 index 000000000..452687dfb --- /dev/null +++ b/main/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/main/tinc/tincd.lo.initd b/main/tinc/tincd.lo.initd new file mode 100644 index 000000000..79c185b38 --- /dev/null +++ b/main/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