initial import
This commit is contained in:
70
tinc/PKGBUILD
Normal file
70
tinc/PKGBUILD
Normal file
@@ -0,0 +1,70 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgname=tinc
|
||||
pkgver=1.0.36
|
||||
_debver=$pkgver
|
||||
_debrel=2
|
||||
pkgrel=1
|
||||
pkgdesc="VPN (Virtual Private Network) daemon"
|
||||
url="https://www.tinc-vpn.org/"
|
||||
arch=('i686' 'x86_64')
|
||||
license=('custom:GPL-2+OpenSSL-Linking-Exception+LZO-Linking-Exception')
|
||||
depends=('lzo' 'libressl' 'zlib')
|
||||
makedepends=('quilt')
|
||||
source=(https://www.tinc-vpn.org/packages/tinc-$pkgver.tar.gz{,.sig}
|
||||
https://deb.debian.org/debian/pool/main/t/tinc/tinc_$_debver-$_debrel.debian.tar.xz
|
||||
tincd.confd
|
||||
tincd.initd
|
||||
tincd.run)
|
||||
sha512sums=('23af9162f7ae700bad01e1f59f23f32d1b183b185ec35f4a69a987c52c53cfebfa9e852203b399f035988078e9131e5d59b018554a52a30044f34df6e64b5289'
|
||||
'SKIP'
|
||||
'c58b0b4c3983ced1d03ae0490a56b45c7ba1929a1185ced955a294e69d806d961b3d076b8b0b508c0046d73834d4e9967a88e6c76daa0c8bb71bbda122509523'
|
||||
'f8d9354af5ebc07420ced98059262751bffef434b61c6333964338f327e2ac01ae676e375954efa794a1bccf8b939c78387b9fb7261f675f1237b0d946b529c9'
|
||||
'cd4e56cd49cc48409b753e4366c8a2f57babe9da80bdf048f3bd562debd82405c641af7f3c4c73460a720c3e458194cb5af6bf4ed84f04758b47b991fb01c385'
|
||||
'51f259d4584945c9eb99d3a0bb837e90126a331fc63c4477ce751b902a3fffdeb5247d1465d19de00004b0e5f46f87d3c568d9847c732bf7a5dd86375f6aa883')
|
||||
validpgpkeys=('D62BDD168EFBE48BC60E8E234A6084B9C0D71F4A')
|
||||
|
||||
prepare() {
|
||||
cd $pkgname-$pkgver
|
||||
|
||||
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES=debian/patches
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "$srcdir"/debian .
|
||||
|
||||
quilt push -av
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
cd $pkgname-$pkgver
|
||||
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd $pkgname-$pkgver
|
||||
|
||||
make DESTDIR="$pkgdir/" install
|
||||
install -dm755 "$pkgdir"/usr/share/tinc/examples
|
||||
cp -a doc/sample-config/. "$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 {} +
|
||||
|
||||
# services
|
||||
install -Dm644 $srcdir/tincd.confd "$pkgdir"/etc/conf.d/tincd
|
||||
install -Dm755 $srcdir/tincd.initd "$pkgdir"/etc/init.d/tincd
|
||||
install -Dm755 $srcdir/tincd.run "$pkgdir"/etc/sv/tincd/run
|
||||
|
||||
# licenses
|
||||
for i in COPYING{,.README}; do
|
||||
install -Dm644 $i "$pkgdir"/usr/share/licenses/$pkgname/$i
|
||||
done
|
||||
}
|
||||
20
tinc/tincd.confd
Normal file
20
tinc/tincd.confd
Normal file
@@ -0,0 +1,20 @@
|
||||
#rc_need="net.net"
|
||||
|
||||
#If you want tincd to log to syslog, then set this to "yes"
|
||||
#Anything else and tincd will log to /var/log/tinc.NETNAME.log.
|
||||
SYSLOG="yes"
|
||||
|
||||
#Set debug level, useful for error probe
|
||||
# 0 Quiet mode, only show starting/stopping of the daemon
|
||||
# 1 Show (dis)connects of other tinc daemons via TCP
|
||||
# 2 Show error messages received from other hosts
|
||||
# 2 Show status messages received from other hosts
|
||||
# 3 Show the requests that are sent/received
|
||||
# 4 Show contents of every request that is sent/received
|
||||
# 5 Show network traffic information
|
||||
# 6 Show contents of each packet that is being sent/received
|
||||
# 10 You have been warned
|
||||
DEBUG_LEVEL="0"
|
||||
|
||||
#Extra Options, if you want addtional customization
|
||||
EXTRA_OPTS=""
|
||||
78
tinc/tincd.initd
Normal file
78
tinc/tincd.initd
Normal file
@@ -0,0 +1,78 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
extra_started_commands="reload"
|
||||
|
||||
NETS="/etc/tinc.networks"
|
||||
DAEMON="/usr/sbin/tincd"
|
||||
|
||||
depend() {
|
||||
use logger dns
|
||||
need net
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
if [ "${RC_SVCNAME}" = "tincd" ] ; then
|
||||
ALL_NETNAME="$(awk '/^ *NETWORK:/ { print $2 }' "${NETS}")"
|
||||
else
|
||||
ALL_NETNAME="${RC_SVCNAME#*.}"
|
||||
fi
|
||||
# warn this if still not found
|
||||
if [ -z "${ALL_NETNAME}" ] ; then
|
||||
eerror "No VPN networks configured in ${NETS}"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting tinc VPN networks"
|
||||
checkconfig || return 1
|
||||
for NETNAME in ${ALL_NETNAME}
|
||||
do
|
||||
CONFIG="/etc/tinc/${NETNAME}/tinc.conf"
|
||||
PIDFILE="/run/tinc.${NETNAME}.pid"
|
||||
if [ ! -f "${CONFIG}" ]; then
|
||||
eerror "Cannot start network ${NETNAME}."
|
||||
eerror "Please set up ${CONFIG} !"
|
||||
else
|
||||
ebegin "Starting tinc network ${NETNAME}"
|
||||
if [ "${SYSLOG}" = "yes" ]; then
|
||||
LOG=""
|
||||
else
|
||||
LOG="--logfile=/var/log/tinc.${NETNAME}.log"
|
||||
fi
|
||||
start-stop-daemon --start --exec "${DAEMON}" --pidfile "${PIDFILE}" -- --net="${NETNAME}" ${LOG} --pidfile "${PIDFILE}" --debug="${DEBUG_LEVEL}" ${EXTRA_OPTS}
|
||||
eend $?
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping tinc VPN networks"
|
||||
checkconfig || return 1
|
||||
for NETNAME in ${ALL_NETNAME}
|
||||
do
|
||||
PIDFILE="/run/tinc.${NETNAME}.pid"
|
||||
if [ -f "${PIDFILE}" ]; then
|
||||
ebegin "Stopping tinc network ${NETNAME}"
|
||||
start-stop-daemon --stop --pidfile "${PIDFILE}"
|
||||
eend $?
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "Reloading configuration for tinc VPN networks"
|
||||
checkconfig || return 1
|
||||
for NETNAME in ${ALL_NETNAME}
|
||||
do
|
||||
PIDFILE="/run/tinc.${NETNAME}.pid"
|
||||
if [ -f "${PIDFILE}" ]; then
|
||||
ebegin "Reloading tinc network ${NETNAME}"
|
||||
start-stop-daemon --signal HUP --pidfile ${PIDFILE}
|
||||
eend $?
|
||||
fi
|
||||
done
|
||||
}
|
||||
2
tinc/tincd.run
Normal file
2
tinc/tincd.run
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec tincd -D
|
||||
Reference in New Issue
Block a user