summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Tittelbach <service-anytun@tittelbach.org>2009-12-05 16:30:12 +0000
committerBernhard Tittelbach <service-anytun@tittelbach.org>2009-12-05 16:30:12 +0000
commit236bdda2f51f977e764ba737bf8bfb009284a7a3 (patch)
tree1681eff774c2491af82bccad663c5993a17a70d5
parentstart-stop-daemon (diff)
untestet new uanytun ebuild
-rw-r--r--gentoo-linux/net-misc/anytun/anytun-0.3.1.ebuild2
-rw-r--r--gentoo-linux/net-misc/anytun/anytun-0.3.2.ebuild2
-rwxr-xr-xgentoo-linux/net-misc/uanytun/files/uanytun-0.3.1.init90
-rw-r--r--gentoo-linux/net-misc/uanytun/metadata.xml12
-rw-r--r--gentoo-linux/net-misc/uanytun/uanytun-0.3.1.ebuild66
5 files changed, 170 insertions, 2 deletions
diff --git a/gentoo-linux/net-misc/anytun/anytun-0.3.1.ebuild b/gentoo-linux/net-misc/anytun/anytun-0.3.1.ebuild
index 5277c41..a636e3d 100644
--- a/gentoo-linux/net-misc/anytun/anytun-0.3.1.ebuild
+++ b/gentoo-linux/net-misc/anytun/anytun-0.3.1.ebuild
@@ -63,7 +63,7 @@ pkg_config() {
[ ! -d "${ROOT}"/usr/share/doc/${PF}/etc-anytun-examples/ ] && \
die "can't copy example configs since examples were not installed (reemerge with USE=\"examples\")"
mkdir -p "${ROOT}"/etc/anytun/ || die "couldn't mkdir ${ROOT}/etc/anytun/"
- cp -r "${ROOT}"/usr/share/doc/${PF}/etc-anytun-examples/* "${ROOT}"/etc/anytun/ || die "failed to copy examples"
+ cp -rv "${ROOT}"/usr/share/doc/${PF}/etc-anytun-examples/* "${ROOT}"/etc/anytun/ || die "failed to copy examples"
}
pkg_postinst() {
diff --git a/gentoo-linux/net-misc/anytun/anytun-0.3.2.ebuild b/gentoo-linux/net-misc/anytun/anytun-0.3.2.ebuild
index 7db3f9a..fe91d5a 100644
--- a/gentoo-linux/net-misc/anytun/anytun-0.3.2.ebuild
+++ b/gentoo-linux/net-misc/anytun/anytun-0.3.2.ebuild
@@ -57,7 +57,7 @@ pkg_config() {
[ -e "${ROOT}"/etc/anytun ] && die "${ROOT}/etc/anytun/ already present, rm -R it first"
[ ! -d "${ROOT}"/usr/share/doc/${PF}/examples/etc/anytun ] && \
die "can't copy example configs since examples were not installed (reemerge with USE=\"examples\")"
- cp -r "${ROOT}"/usr/share/doc/${PF}/examples/etc/anytun "${ROOT}"/etc/ || die "failed to copy examples"
+ cp -rv "${ROOT}"/usr/share/doc/${PF}/examples/etc/anytun "${ROOT}"/etc/ || die "failed to copy examples"
}
pkg_postinst() {
diff --git a/gentoo-linux/net-misc/uanytun/files/uanytun-0.3.1.init b/gentoo-linux/net-misc/uanytun/files/uanytun-0.3.1.init
new file mode 100755
index 0000000..4a4aaa3
--- /dev/null
+++ b/gentoo-linux/net-misc/uanytun/files/uanytun-0.3.1.init
@@ -0,0 +1,90 @@
+#!/sbin/runscript
+# Distributed under the terms of the GNU General Public License v3
+# Written by Bernhard Tittelbach based on examples from Gentoo, openvpn and uanytun debian initrd script
+
+depend() {
+ need net
+ use dns
+ after bootmisc
+}
+
+DAEMON=/usr/sbin/uanytun
+CONFIG_DIR=/etc/uanytun
+NAME=uanytun
+DESC=uanytun
+VARRUN_PREFIX=/var/run/uanytun
+
+VPN=${SVCNAME#*.}
+[ "$VPN" = "$SVCNAME" ] && VPN=""
+
+test -x $DAEMON || exit 1
+
+# Include uanytun defaults if available
+if [ -f /etc/default/uanytun ] ; then
+ . /etc/default/uanytun
+fi
+
+start_vpn () {
+ if [ -f $CONFIG_DIR/$NAME/config ] ; then
+ POSTUP=''
+ test -f $CONFIG_DIR/$NAME/post-up.sh && POSTUP="-x $CONFIG_DIR/$NAME/post-up.sh"
+ CHROOTDIR=`grep '^chroot' < $CONFIG_DIR/$NAME/config | sed 's/chroot\s*//'`
+ if [ -n "$CHROOTDIR" ] ; then
+ test -d $CHROOTDIR || mkdir -p $CHROOTDIR
+ fi
+ DAEMONARG=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e '\w' | sed 's/^/--/' | tr '\n' ' '`
+ start-stop-daemon --start --pidfile $VARRUN_PREFIX.${NAME}.pid --exec \
+ $DAEMON -- --write-pid $VARRUN_PREFIX.${NAME}.pid $POSTUP $DAEMONARG || return 1
+ else
+ eerror "no config found"
+ return 1
+ fi
+ return 0
+}
+stop_vpn () {
+ start-stop-daemon --stop --pidfile $PIDFILE --exec $DAEMON --oknodo
+ rm -f $PIDFILE
+}
+
+start () {
+ if test -z "$VPN" ; then
+ if [ -f $CONFIG_DIR/autostart ] ; then
+ for NAME in `sed 's/#.*//' < $CONFIG_DIR/autostart | grep -e '\w'`; do
+ ebegin "Starting ${DESC} VPN: ${NAME}"
+ start_vpn
+ eend $?
+ done
+ else
+ eerror "no config found"
+ return 1
+ fi
+ else
+ NAME="$VPN"
+ ebegin "Starting ${DESC} VPN: ${NAME}"
+ start_vpn
+ eend $?
+ fi
+}
+
+stop () {
+ if test -z "$VPN" ; then
+ for PIDFILE in `ls $VARRUN_PREFIX.*.pid 2> /dev/null`; do
+ NAME=`echo $PIDFILE | cut -c18-`
+ NAME=${NAME%%.pid}
+ ebegin "Stopping ${DESC} VPN: ${NAME}"
+ stop_vpn
+ eend $?
+ done
+ else
+ if test -e $VARRUN_PREFIX.${VPN}.pid ; then
+ PIDFILE=`ls $VARRUN_PREFIX.${VPN}.pid 2> /dev/null`
+ NAME=`echo $PIDFILE | cut -c18-`
+ NAME=${NAME%%.pid}
+ ebegin "Stopping ${DESC} VPN: ${NAME}"
+ stop_vpn
+ eend $?
+ else
+ eerror " failure: No such tunnel is running: $VPN"
+ fi
+ fi
+}
diff --git a/gentoo-linux/net-misc/uanytun/metadata.xml b/gentoo-linux/net-misc/uanytun/metadata.xml
new file mode 100644
index 0000000..89d94fd
--- /dev/null
+++ b/gentoo-linux/net-misc/uanytun/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>uanytun</herd>
+<longdescription>uAnytun is an simplified implementation of the Secure Anycast Tunneling Protocol. It is designed for use in embedded environments. Unlike anytun it does not implement the synchronisation of multiple server endpoints and can only act as client or single endpoint server.</longdescription>
+<use>
+ <flag name='examples'>Install example configuration into /usr/share/doc/...</flag>
+ <flag name='gcrypt'>Prefer <pkg>dev-libs/libgcrypt</pkg> over
+ <pkg>dev-libs/openssl</pkg> for encryption
+ </flag>
+</use>
+</pkgmetadata>
diff --git a/gentoo-linux/net-misc/uanytun/uanytun-0.3.1.ebuild b/gentoo-linux/net-misc/uanytun/uanytun-0.3.1.ebuild
new file mode 100644
index 0000000..c1b7572
--- /dev/null
+++ b/gentoo-linux/net-misc/uanytun/uanytun-0.3.1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit eutils
+
+DESCRIPTION="VPN daemon using Secure Anycast Tunneling"
+HOMEPAGE="http://anytun.org/"
+SRC_URI="http://anytun.org/~equinox/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples gcrypt"
+
+RDEPEND=">=dev-libs/boost-1.35
+ gcrypt? ( dev-libs/libgcrypt )
+ !gcrypt? ( dev-libs/openssl )"
+DEPEND="${RDEPEND}
+ <app-text/asciidoc-8.5.0" # asciidoc a2x >= 8.5.0 requires an -L switch not present in lower versions
+
+S=${S}/src
+
+src_compile() {
+ local myconf
+ use gcrypt || myconf="--use-ssl-crypto"
+ econf ${myconf} || die "configure failed"
+
+ emake || die "make failed"
+
+ einfo "Building manpages"
+ emake manpage || die "failed building manpages"
+}
+
+src_install() {
+ #make target install-bin is buggy
+ dosbin uanytun || die "failed to copy/install an executable"
+ newinitd "${FILESDIR}/${PN}-0.3.1.init" uanytun || die "failed to copy/install initrd script"
+
+ emake install-man || die "failed to install manpages"
+
+ cd ../
+ dodoc AUTHORS ChangeLog README || die "failed to install docs"
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples/etc/
+ doins -r etc/uanytun || die "failed to install examples"
+ fi
+}
+
+pkg_config() {
+ [ -e "${ROOT}"/etc/uanytun ] && die "${ROOT}/etc/uanytun/ already present, rm -R it first"
+ [ ! -d "${ROOT}"/usr/share/doc/${PF}/examples/etc/uanytun/ ] && \
+ die "can't copy example configs since examples were not installed (reemerge with USE=\"examples\")"
+ cp -vr "${ROOT}"/usr/share/doc/${PF}/examples/etc/uanytun "${ROOT}"/etc/ || die "failed to copy examples"
+}
+
+pkg_postinst() {
+ enewgroup uanytun
+ enewuser uanytun -1 -1 /var/run/ uanytun
+ einfo "Note that each VPN gets its own directory under /etc/uanytun/"
+ einfo " (see examples provided with the package)"
+ einfo "Use the following example to create gentoo-style"
+ einfo " uanytun.{VPN} initrd scripts for each VPN"
+ einfo "# ln -s /etc/init.d/uanytun /etc/init.d/uanytun.client1"
+}