summaryrefslogtreecommitdiff
path: root/gentoo-linux
diff options
context:
space:
mode:
authorBernhard Tittelbach <service-anytun@tittelbach.org>2009-12-05 16:27:47 +0000
committerBernhard Tittelbach <service-anytun@tittelbach.org>2009-12-05 16:27:47 +0000
commit8824166d8fd79da8a5b0c5e53d0e60656bc2d3c9 (patch)
tree6d1e5dffbec5af2587093f545b3fd3bb1a27bcbd /gentoo-linux
parentinstall statt cp (diff)
gentoo pre-testing version
Diffstat (limited to 'gentoo-linux')
-rw-r--r--gentoo-linux/net-misc/anytun/Manifest5
-rw-r--r--gentoo-linux/net-misc/anytun/anytun-0.3.1.ebuild166
-rw-r--r--gentoo-linux/net-misc/anytun/files/anytun-0.3.1-boost-mt.patch22
-rwxr-xr-xgentoo-linux/net-misc/anytun/files/anytun-0.3.1.init190
4 files changed, 274 insertions, 109 deletions
diff --git a/gentoo-linux/net-misc/anytun/Manifest b/gentoo-linux/net-misc/anytun/Manifest
new file mode 100644
index 0000000..b0a8abb
--- /dev/null
+++ b/gentoo-linux/net-misc/anytun/Manifest
@@ -0,0 +1,5 @@
+AUX anytun-0.3.1-boost-mt.patch 880 RMD160 ef4b35b7c2d976de3e970c6b5f9937e771654a21 SHA1 e03371a06741eee48e14bb3af3c5347fb0d19999 SHA256 27fed2ddf30da748ca96676c47e54c24172a67c2789b3bde7769919b76e86a58
+AUX anytun-0.3.1.init 4790 RMD160 cbf8157bceca641c600067e824d742b642bedd9e SHA1 bca46549390acc1bfb248144b95b5a4b63e06165 SHA256 9aa762ad1b375f50460560fe4597049d1808b97fe539c8dcaa4dea1634b13c9d
+DIST anytun-0.3.1.tar.gz 133451 RMD160 0750f681887dcfc527fbf92f525e16b8ab5bfa47 SHA1 7489ebff5b5cefe909e7f187feae783b874ab614 SHA256 e696b2b6767753234df21dbfce8d994d4a9bbb75e9f3f360081d25ece5eb80c6
+EBUILD anytun-0.3.1.ebuild 2982 RMD160 ac4cc308de113a47928cdab1ca9568e5db321ce7 SHA1 703f1e061edfd2fb14cbedfde72616c87314e267 SHA256 b0d8f9604083d79784bf9f081779d4fef199bce7235de82e660b0cb42225ddd4
+MISC metadata.xml 621 RMD160 9716c412c6848b0d6ace6783580d4990b06dacce SHA1 8bb0fe8adce8a4754fdc7c18b80ed4fc4223704f SHA256 fdd3e94a62d86efc9504fc7c5933ec19d91119a607310a20ded5638e171de9bf
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 511db16..79be4b7 100644
--- a/gentoo-linux/net-misc/anytun/anytun-0.3.1.ebuild
+++ b/gentoo-linux/net-misc/anytun/anytun-0.3.1.ebuild
@@ -1,8 +1,8 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: $
+# $Header: (C) Bernhard Tittelbach$
-inherit eutils multilib toolchain-funcs autotools
+inherit eutils toolchain-funcs autotools
DESCRIPTION="Anytun is an implementation of the Secure Anycast Tunneling
Protocol, intended to provide flexible and fault tolerant VPNs"
@@ -16,36 +16,33 @@ IUSE="gcrypt doc"
DEPEND=">=dev-libs/boost-1.35
gcrypt? ( dev-libs/libgcrypt )
!gcrypt? ( >=dev-libs/openssl-0.9.6 )
- doc? ( app-text/asciidoc )"
+ doc? ( <app-text/asciidoc-8.5.0 )" # asciidoc a2x <= 8.5.0 requires the -L switch
RDEPEND="${DEPEND}"
-pkg_setup() {
-}
+#pkg_setup() {
+#}
src_unpack() {
unpack ${A}
- cd "${S}"
-
- #epatch "${FILESDIR}/${PN}-2.1_rc13-peercred.patch"
- #epatch "${FILESDIR}"/openvpn-2.1_rc20-pkcs11.patch
- eautoreconf
+ cd "${S}/src"
+ if has_version ">=dev-libs/boost-1.37"; then
+ epatch "${FILESDIR}/${PN}-0.3.1-boost-mt.patch"
+ fi
+ #eautoreconf
}
src_compile() {
+ cd "${S}/src"
+
local myconf=""
-
if use gcrypt ; then
- #myconf="$(use_enable pkcs11)"
myconf="${myconf}"
else
myconf="${myconf} --use-ssl-crypto"
fi
+ econf ${myconf} || die "configure failed"
+ #./configure ${myconf} || die "configure failed"
- econf ${myconf} \
- || die "configure failed"
-
- #use static && sed -i -e '/^LIBS/s/LIBS = /LIBS = -static /' Makefile
-
emake || die "make failed"
if use static ; then
@@ -59,107 +56,58 @@ src_compile() {
}
src_install() {
- mkdir -p ${D}/usr/sbin ${D}/usr/bin ${D}/var/run/anytun ${D}/var/run/anytun-controld ${D}/etc/anytun ${D}/etc/rc.d/ ${D}/usr/share/$pkgname-$pkgver/etc-example/
- cp anytun ${D}/usr/sbin/
- cp anytun-config anytun-controld anytun-nosync anytun-showtables ${D}/usr/bin/
- #touch ${D}/var/run/anytun/.keep ${D}/var/run/anytun-controld/.keep
- cp $srcdir/$pkgname-$pkgver/etc/init.d/anytun ${D}/etc/rc.d/
- cp -R $srcdir/$pkgname-$pkgver/etc/anytun ${D}/usr/share/$pkgname-$pkgver/etc-example/
- cp $srcdir/$pkgname-$pkgver/etc/anytun/autostart ${D}/etc/anytun/
- cp -R ../wireshark-lua ${D}/usr/share/$pkgname-$pkgver/
- keepdir /var/run/anytun-controld
- use doc && dodoc
+ cd "${S}/src"
+ dosbin anytun
+ use static && dosbin anytun-static
+ dobin anytun-config anytun-controld anytun-showtables anytun-nosync
-..........
- make DESTDIR="${D}" install || die "make install failed"
+ newinitd "${FILESDIR}/${PN}-0.3.1.init" anytun
- # install documentation
- dodoc AUTHORS ChangeLog LICENSE README
- # remove empty dir
- rmdir "${D}/usr/share/doc/openvpn"
-
- # Empty dir
- dodir /etc/openvpn
- keepdir /etc/openvpn
-
- # Install some helper scripts
- exeinto /etc/openvpn
- doexe "${FILESDIR}/up.sh"
- doexe "${FILESDIR}/down.sh"
+ #exeinto /etc/init.d/
+ #doexe ${S}/etc/init.d/anytun
+
+ insinto /etc/default/
+ doins ${S}/etc/default/*
- # Install the init script and config file
- newinitd "${FILESDIR}/${PN}-2.1.init" openvpn
- newconfd "${FILESDIR}/${PN}-2.1.conf" openvpn
+ #insinto /etc/anytun/
+ #doins ${S}/etc/anytun/*
+ cd ${S}/etc/anytun/
+ find -type f -exec install -dm644 {} ${D}/etc/anytun/{}
+
+ insinto /usr/share/${P}/wireshark-lua/
+ doins ${S}/wireshark-lua/*
- # install examples, controlled by the respective useflag
- if use examples ; then
- # dodoc does not supportly support directory traversal, #15193
- insinto /usr/share/doc/${PF}/examples
- doins -r sample-{config-files,keys,scripts} contrib
+ dodir /var/run/anytun
+ keepdir /var/run/anytun
+ dodir /var/run/anytun-controld
+ keepdir /var/run/anytun-controld
+
+ if use doc; then
+ cd ${S}
+ dodoc AUTHORS ChangeLog LICENSE README
+ cd ${S}/src/man/
+ doman anyrtpproxy.8 anytun-config.8 anytun-controld.8 anytun-showtables.8 anytun.8
prepalldocs
fi
-
- # Install plugins and easy-rsa
- if ! use minimal ; then
- cd easy-rsa/2.0
- make install "DESTDIR=${D}/usr/share/${PN}/easy-rsa"
- cd ../..
-
- exeinto "/usr/$(get_libdir)/${PN}"
- doexe plugin/*/*.so
- fi
}
pkg_postinst() {
- # Add openvpn user so openvpn servers can drop privs
- # Clients should run as root so they can change ip addresses,
- # dns information and other such things.
- enewgroup openvpn
- enewuser openvpn "" "" "" openvpn
-
- if [[ -n $(ls /etc/openvpn/*/local.conf 2>/dev/null) ]] ; then
- ewarn "WARNING: The openvpn init script has changed"
- ewarn ""
- fi
-
- einfo "The openvpn init script expects to find the configuration file"
- einfo "openvpn.conf in /etc/openvpn along with any extra files it may need."
+ enewgroup anytun
+ enewuser anytun -1 /sbin/nologin /var/run/anytun anytun
+
+ einfo "Example configuration files have been installed in /etc/anytun"
+ einfo "tunnels get their own directory in /etc/anytun and should then"
+ einfo "be added to the /etc/anytun/autostart file"
einfo ""
- einfo "To create more VPNs, simply create a new .conf file for it and"
- einfo "then create a symlink to the openvpn init script from a link called"
- einfo "openvpn.newconfname - like so"
- einfo " cd /etc/openvpn"
- einfo " ${EDITOR##*/} foo.conf"
- einfo " cd /etc/init.d"
- einfo " ln -s openvpn openvpn.foo"
+ einfo "Alternatively you can forget the autostart file and create"
+ einfo "gentoostyle anytun.{VPN} initrd scripts for each VPN"
+ einfo " ex: ln -s /etc/init.d/anytun.client1 /etc/init.d/anytun"
einfo ""
- einfo "You can then treat openvpn.foo as any other service, so you can"
- einfo "stop one vpn and start another if you need to."
-
- if grep -Eq "^[ \t]*(up|down)[ \t].*" "${ROOT}/etc/openvpn"/*.conf 2>/dev/null ; then
- ewarn ""
- ewarn "WARNING: If you use the remote keyword then you are deemed to be"
- ewarn "a client by our init script and as such we force up,down scripts."
- ewarn "These scripts call /etc/openvpn/\$SVCNAME-{up,down}.sh where you"
- ewarn "can move your scripts to."
- fi
-
- if ! use minimal ; then
- einfo ""
- einfo "plugins have been installed into /usr/$(get_libdir)/${PN}"
- fi
-
- if use ipv6 ; then
- einfo ""
- einfo "This build contains IPv6-Patch from JuanJo Ciarlante."
- einfo "For more information please visit:"
- einfo "http://github.com/jjo/openvpn-ipv6"
- fi
-
- if use eurephia ; then
- einfo ""
- einfo "This build contains eurephia patch."
- einfo "For more information please visit:"
- einfo "http://www.eurephia.net/"
- fi
+ einfo "Don't forget to "
+ einfo " rc-update add anytun default"
+ einfo "or"
+ einfo " rc-update add anytun.client1 default"
+ einfo ""
+ einfo "You can disect anytun traffic using wireshark by plugging the script"
+ einfo "/usr/share/${P}/wireshark-lua/satp.lua into wireshark"
}
diff --git a/gentoo-linux/net-misc/anytun/files/anytun-0.3.1-boost-mt.patch b/gentoo-linux/net-misc/anytun/files/anytun-0.3.1-boost-mt.patch
new file mode 100644
index 0000000..b3f6f9e
--- /dev/null
+++ b/gentoo-linux/net-misc/anytun/files/anytun-0.3.1-boost-mt.patch
@@ -0,0 +1,22 @@
+--- ../../orig/anytun-0.3.1/src/configure 2009-10-29 01:29:31.000000000 +0100
++++ configure 2009-10-30 23:54:00.427183812 +0100
+@@ -34,7 +34,7 @@
+ TARGET=`uname -s`
+
+ CXXFLAGS='-g -Wall -O2 -DLOG_SYSLOG -DLOG_FILE -DLOG_STDOUT'
+-LDFLAGS='-g -Wall -O2 -lboost_thread -lboost_serialization -lboost_system -lboost_date_time'
++LDFLAGS='-g -Wall -O2 -lboost_thread-mt -lboost_serialization -lboost_system -lboost_date_time'
+
+ CRYPTO_LIB='gcrypt'
+ PASSPHRASE=1
+--- ../../orig/anytun-0.3.1/src/anyrtpproxy/Makefile 2009-10-29 01:29:31.000000000 +0100
++++ anyrtpproxy/Makefile 2009-10-30 23:54:07.031174716 +0100
+@@ -34,7 +34,7 @@
+ CXX = g++
+ CXXFLAGS = -g -Wall
+ LD = g++
+-LDFLAGS = -g -Wall -O2 -lboost_thread -lboost_serialization -lboost_system
++LDFLAGS = -g -Wall -O2 -lboost_thread-mt -lboost_serialization -lboost_system
+
+ OBJS = anyrtpproxy.o \
+ ../signalController.o \
diff --git a/gentoo-linux/net-misc/anytun/files/anytun-0.3.1.init b/gentoo-linux/net-misc/anytun/files/anytun-0.3.1.init
new file mode 100755
index 0000000..36822e2
--- /dev/null
+++ b/gentoo-linux/net-misc/anytun/files/anytun-0.3.1.init
@@ -0,0 +1,190 @@
+#!/sbin/runscript
+# Distributed under the terms of the GNU General Public License v3
+# Written by Bernhard Tittelbach based on examples from Gentoo, openvpn and anytun debian init.rd script
+
+depend() {
+ need net
+ use dns
+ after bootmisc
+}
+
+DAEMON=/usr/sbin/anytun
+ANYTUNCONFIG=/usr/bin/anytun-config
+CONTROLDAEMON=/usr/bin/anytun-controld
+NAME=anytun
+DESC=anytun
+CONFIG_DIR=/etc/anytun
+VARCONFIG_DIR=/var/run/anytun-controld
+VARRUN_DIR=/var/run/anytun
+
+VPN=${SVCNAME#*.}
+
+# Include anytun defaults if available
+if [ -f /etc/default/anytun ] ; then
+ . /etc/default/anytun
+fi
+
+test -x $DAEMON || exit 1
+
+
+start_vpn () {
+ STATUS="OK"
+ 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
+ test -d $VARRUN_DIR || mkdir -p $VARRUN_DIR
+ DAEMONARG=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e '\w' | sed 's/^/--/' | tr '\n' ' '`
+ $DAEMON --write-pid $VARRUN_DIR/$NAME.pid $POSTUP \
+ $DAEMONOPTS $DAEMONARG || STATUS="FAILED"
+ else
+ STATUS="no config found"
+ fi
+ start_configd
+ echo -n "($STATUS)"
+}
+stop_vpn () {
+ kill `cat $PIDFILE` || true
+ rm $PIDFILE
+ stop_configd
+}
+
+start_configd () {
+ if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then
+ test -d $VARCONFIG_DIR || mkdir -p $VARCONFIG_DIR
+ chmod 700 $VARCONFIG_DIR
+ rm -f $VARCONFIG_DIR/$NAME 2>/dev/null
+ for CLIENTNAME in `ls $CONFIG_DIR/$NAME/conf.d`; do
+ echo -n " ($CLIENTNAME)"
+ DAEMONARG=`sed 's/#.*//' < $CONFIG_DIR/$NAME/conf.d/$CLIENTNAME | grep -e '\w' | sed 's/^/ --/' | xargs echo`
+ $ANYTUNCONFIG $DAEMONARG >> $VARCONFIG_DIR/$NAME
+ done
+ CONTROLHOST=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e 'control-host' | sed 's/^/ --/'`
+ $CONTROLDAEMON -f $VARCONFIG_DIR/$NAME $DAEMONOPTS $CONTROLHOST \
+ --write-pid $VARCONFIG_DIR/$NAME.pid
+ # rm -f $VARCONFIG_DIR/$NAME
+ fi
+}
+stop_configd () {
+ if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then
+ echo -n " ($NAME)"
+ kill `cat $VARCONFIG_DIR/$NAME.pid` || true
+ rm $VARCONFIG_DIR/$NAME.pid
+ fi
+}
+
+
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start_vpn
+ eend $?
+
+ 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_DIR/*.pid 2> /dev/null`; do
+ NAME=`echo $PIDFILE | cut -c17-`
+ NAME=${NAME%%.pid}
+ ebegin "Stopping ${DESC} VPN: ${NAME}"
+ stop_vpn
+ eend $?
+ done
+ else
+ if test -e $VARRUN_DIR/$VPN.pid ; then
+ PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null`
+ NAME=`echo $PIDFILE | cut -c17-`
+ NAME=${NAME%%.pid}
+ ebegin "Stopping ${DESC} VPN: ${NAME}"
+ stop_vpn
+ eend $?
+ else
+ eerror " failure: No such tunnel is running: $VPN"
+ fi
+ fi
+}
+
+reload() {
+ if test -z "$VPN" ; then
+ for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do
+ NAME=`echo $PIDFILE | cut -c17-`
+ NAME=${NAME%%.pid}
+ if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then
+ ebegin "Reloading ${DESC} VPN: ${NAME}"
+ stop_vpn
+ start_vpn
+ eend $?
+ else
+ ebegin "Reloading ${DESC} VPN: ${NAME}"
+ stop_configd
+ start_configd
+ eend $?
+ fi
+ done
+ else
+ if test -e $VARRUN_DIR/$VPN.pid ; then
+ PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null`
+ NAME=`echo $PIDFILE | cut -c17-`
+ NAME=${NAME%%.pid}
+ if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then
+ ebegin "Reloading ${DESC} VPN: ${NAME}"
+ stop_vpn
+ start_vpn
+ eend $?
+ else
+ ebegin "Reloading ${DESC} VPN: ${NAME}"
+ stop_configd
+ start_configd
+ eend $?
+ fi
+ else
+ eerror "failure: No such tunnel is running: $VPN"
+ fi
+ fi
+}
+
+restart {
+ if test -z "$VPN" ; then
+ for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do
+ NAME=`echo $PIDFILE | cut -c17-`
+ NAME=${NAME%%.pid}
+ ebegin "Restarting ${DESC} VPN: ${NAME}"
+ stop_vpn
+ start_vpn
+ eend $?
+ done
+ else
+ if test -e $VARRUN_DIR/$VPN.pid ; then
+ PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null`
+ NAME=`echo $PIDFILE | cut -c17-`
+ NAME=${NAME%%.pid}
+ ebegin "Restarting ${DESC} VPN: ${NAME}"
+ stop_vpn
+ start_vpn
+ eend $?
+ else
+ eerror "failure: No such tunnel is running: $VPN"
+ fi
+ fi
+}