summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Tittelbach <service-anytun@tittelbach.org>2015-01-16 00:41:03 +0000
committerBernhard Tittelbach <service-anytun@tittelbach.org>2015-01-16 00:41:03 +0000
commit4fedef5726f3ccdfc7d1a99e9393af9e59d5c8a0 (patch)
treee69da57a9cd088961bd5177efc6a5f03f1a9a74a
parentupdated command option letters (diff)
some preliminary work for next version, but neither tested nor propably finished
-rw-r--r--gentoo-linux/net-misc/anytun/anytun-0.3.6.ebuild85
1 files changed, 85 insertions, 0 deletions
diff --git a/gentoo-linux/net-misc/anytun/anytun-0.3.6.ebuild b/gentoo-linux/net-misc/anytun/anytun-0.3.6.ebuild
new file mode 100644
index 0000000..7d5a433
--- /dev/null
+++ b/gentoo-linux/net-misc/anytun/anytun-0.3.6.ebuild
@@ -0,0 +1,85 @@
+# 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 nettle systemd"
+
+RDEPEND=">=dev-libs/boost-1.35
+ gcrypt? ( dev-libs/libgcrypt )
+ nettle? ( dev-libs/nettle )
+ !(gcrypt||nettle)? ( dev-libs/openssl )
+ systemd? ( sys-apps/systemd )
+ "
+DEPEND="${RDEPEND}
+ app-text/asciidoc"
+
+S=${S}/src
+
+src_compile() {
+ local myconf
+# the next two are either / or, thus no ${myconf} is used in string
+ use gcrypt || myconf="--use-ssl-crypto"
+ use nettle && myconf="--use-nettle"
+ use examples\
+ && myconf="${myconf} --examplesdir=/usr/share/doc/${PF}/examples/etc" \
+ || myconf="${myconf} --no-examples"
+ use systemd && myconf="${myconf} --with-systemd"
+ 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"
+}