From 11d461cfc3ac90cb6258047445b3ec33763db2ae Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Sat, 14 Jan 2012 18:01:47 +0000 Subject: version bump for gentoo ebuild anytun 0.3.4 --- gentoo-linux/net-misc/anytun/anytun-0.3.4.ebuild | 79 ++++++++++++++++++++++ .../net-misc/anytun/files/anytun-0.3.3.init | 22 +++--- gentoo-linux/tar_dropbox.sh | 2 - 3 files changed, 90 insertions(+), 13 deletions(-) create mode 100644 gentoo-linux/net-misc/anytun/anytun-0.3.4.ebuild delete mode 100755 gentoo-linux/tar_dropbox.sh diff --git a/gentoo-linux/net-misc/anytun/anytun-0.3.4.ebuild b/gentoo-linux/net-misc/anytun/anytun-0.3.4.ebuild new file mode 100644 index 0000000..e1fb9b7 --- /dev/null +++ b/gentoo-linux/net-misc/anytun/anytun-0.3.4.ebuild @@ -0,0 +1,79 @@ +# Copyright 1999-2010 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/download/${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" + +S=${S}/src + +src_compile() { + local myconf + use gcrypt || myconf="--use-ssl-crypto" + use examples\ + && myconf="${myconf} --examplesdir=/usr/share/doc/${PF}/examples/etc" \ + || myconf="${myconf} --no-examples" + econf --ebuild-compat ${myconf} + + einfo "Building executables" + emake || die "make failed" + + einfo "Building manpages" + emake manpage || die "failed building manpages" +} + +src_install() { + emake DESTDIR="${D}" install || die "make install failed" + rm -Rf "${D}"/etc/init.d + #as long as README just contains path to examples, only install it with examples + use examples || rm -f "${D}"/etc/${PN}/README + keepdir /var/run/anytun || die "failed to mkdir" + keepdir /var/run/anytun-controld || die "failed to mkdir" + + newinitd "${FILESDIR}/${PN}-0.3.3.init" ${PN} || die "failed to copy/install initrd script" + + cd ../ + dodoc AUTHORS ChangeLog README || die "failed to install docs" + + #forgotten in current upstream package + #insinto /usr/share/${P}/wireshark-lua/ + #doins wireshark-lua/satp.lua || die "failed to install wireshark-lua contrib script" +} + +pkg_config() { + [ ! -d "${ROOT}"/usr/share/doc/${PF}/examples/etc/${PN} ] && \ + die "can't copy example configs since examples were not installed (reemerge with USE='examples')" + for example in autostart server client1 client2 client3 p2p-a p2p-b; do + [ -e "${ROOT}"/etc/${PN}/${example} ] && die "${ROOT}/etc/${PN}/${example} already present, rm -R it first" + done + cp -rv "${ROOT}"/usr/share/doc/${PF}/examples/etc/${PN} "${ROOT}"/etc/ || die "failed to copy examples" +} + +pkg_postinst() { + enewgroup anytun + enewuser anytun -1 -1 /var/run/anytun anytun + elog "Please refer to the README file regarding the syntax of the /etc/${PN}/" + elog "configuration files or see examples provided with the package" + elog "You can use gentoo-style ${PN}.{VPN} initrd scripts to start " + elog "VPNs separately. Just symlink to the initscript, e.g.:" + elog "# ln -s /etc/init.d/${PN} /etc/init.d/${PN}.client1" + elog + elog "You can disect anytun traffic using wireshark by plugging the script" + elog "satp.lua into wireshark. Get it here:" + elog " http://svn.anytun.org/anytun-common/trunk/wireshark-lua/satp.lua" + #elog " /usr/share/${P}/wireshark-lua/satp.lua into wireshark" +} diff --git a/gentoo-linux/net-misc/anytun/files/anytun-0.3.3.init b/gentoo-linux/net-misc/anytun/files/anytun-0.3.3.init index 7a61b11..e629043 100755 --- a/gentoo-linux/net-misc/anytun/files/anytun-0.3.3.init +++ b/gentoo-linux/net-misc/anytun/files/anytun-0.3.3.init @@ -40,7 +40,7 @@ start_vpn () { test -d $VARRUN_DIR || mkdir -p $VARRUN_DIR DAEMONARG=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e '\w' | sed 's/^/--/' | tr '\n' ' '` start-stop-daemon --start --pidfile $VARRUN_DIR/${NAME}.pid --exec $DAEMON -- --write-pid $VARRUN_DIR/${NAME}.pid $POSTUP \ - $DAEMONOPTS $DAEMONARG || return 1 + $DAEMONOPTS $DAEMONARG || return 1 else eerror "no config found" return 1 @@ -49,7 +49,7 @@ start_vpn () { return 0 } stop_vpn () { - start-stop-daemon --stop --pidfile $PIDFILE --exec $DAEMON --oknodo + start-stop-daemon --stop --pidfile $PIDFILE --exec $DAEMON rm -f $PIDFILE stop_configd } @@ -60,8 +60,8 @@ start_configd () { chmod 700 $VARCONFIG_DIR rm -f $VARCONFIG_DIR/$NAME 2>/dev/null KDPRF=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e 'kd-prf' | sed 's/^/ --/' | xargs echo` - for CLIENTNAME in `ls $CONFIG_DIR/$NAME/conf.d`; do - DAEMONARG=`sed 's/#.*//' < $CONFIG_DIR/$NAME/conf.d/$CLIENTNAME | grep -e '\w' | sed 's/^/ --/' | xargs echo` + for CLIENTPATH in $CONFIG_DIR/$NAME/conf.d/* ; do + DAEMONARG=`sed 's/#.*//' < $CLIENTPATH | grep -e '\w' | sed 's/^/ --/' | xargs echo` $ANYTUNCONFIG $DAEMONARG $CIPHER $AUTHALGO $KDPRF >> $VARCONFIG_DIR/$NAME done CONTROLHOST=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e 'control-host' | sed 's/^/ --/'i | xargs echo` @@ -71,7 +71,7 @@ start_configd () { } stop_configd () { if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then - start-stop-daemon --stop --pidfile $VARCONFIG_DIR/${NAME}.pid --exec $CONTROLDAEMON --oknodo + start-stop-daemon --stop --pidfile $VARCONFIG_DIR/${NAME}.pid --exec $CONTROLDAEMON rm -f $VARCONFIG_DIR/${NAME}.pid fi } @@ -98,15 +98,15 @@ start () { stop () { if test -z "$VPN" ; then - for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do + for PIDFILE in ${VARRUN_DIR}/*.pid ; do NAME=`basename $PIDFILE .pid` ebegin "Stopping ${DESC} VPN: ${NAME}" stop_vpn eend $? done else - if test -e $VARRUN_DIR/${VPN}.pid ; then - PIDFILE=`ls $VARRUN_DIR/${VPN}.pid 2> /dev/null` + if test -e ${VARRUN_DIR}/${VPN}.pid ; then + PIDFILE=${VARRUN_DIR}/${VPN}.pid NAME=`basename $PIDFILE .pid` ebegin "Stopping ${DESC} VPN: ${NAME}" stop_vpn @@ -119,7 +119,7 @@ stop () { reload () { if test -z "$VPN" ; then - for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do + for PIDFILE in ${VARRUN_DIR}/*.pid ; do NAME=`basename $PIDFILE .pid` if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then ebegin "Reloading ${DESC} VPN: ${NAME}" @@ -134,8 +134,8 @@ reload () { fi done else - if test -e $VARRUN_DIR/${VPN}.pid ; then - PIDFILE=`ls $VARRUN_DIR/${VPN}.pid 2> /dev/null` + if test -e ${VARRUN_DIR}/${VPN}.pid ; then + PIDFILE=${VARRUN_DIR}/${VPN}.pid NAME=`basename $PIDFILE .pid` if [ -d $CONFIG_DIR/$NAME/conf.d ] ; then ebegin "Reloading ${DESC} VPN: ${NAME}" diff --git a/gentoo-linux/tar_dropbox.sh b/gentoo-linux/tar_dropbox.sh deleted file mode 100755 index c49bccc..0000000 --- a/gentoo-linux/tar_dropbox.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -tar cjv --owner root --group root -f ~/Dropbox/Public/anytun-gentoo.tar.bz2 net-misc/ -- cgit v1.2.3