1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 DESCRIPTION="VPN daemon using Secure Anycast Tunneling"
8 HOMEPAGE="http://anytun.org/"
9 SRC_URI="http://anytun.org/download/${P}.tar.gz"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="examples gcrypt"
16 RDEPEND=">=dev-libs/boost-1.35
17 gcrypt? ( dev-libs/libgcrypt )
18 !gcrypt? ( dev-libs/openssl )"
26 use gcrypt || myconf="--use-ssl-crypto"
28 && myconf="${myconf} --examplesdir=/usr/share/doc/${PF}/examples/etc" \
29 || myconf="${myconf} --no-examples"
30 econf --ebuild-compat ${myconf}
32 einfo "Building executables"
33 emake || die "make failed"
35 einfo "Building manpages"
36 emake manpage || die "failed building manpages"
40 emake DESTDIR="${D}" install || die "make install failed"
41 rm -Rf "${D}"/etc/init.d
42 #as long as README just contains path to examples, only install it with examples
43 use examples || rm -f "${D}"/etc/${PN}/README
44 keepdir /var/run/anytun || die "failed to mkdir"
45 keepdir /var/run/anytun-controld || die "failed to mkdir"
47 newinitd "${FILESDIR}/${PN}-0.3.3.init" ${PN} || die "failed to copy/install initrd script"
50 dodoc AUTHORS ChangeLog README || die "failed to install docs"
52 #forgotten in current upstream package
53 #insinto /usr/share/${P}/wireshark-lua/
54 #doins wireshark-lua/satp.lua || die "failed to install wireshark-lua contrib script"
58 [ ! -d "${ROOT}"/usr/share/doc/${PF}/examples/etc/${PN} ] && \
59 die "can't copy example configs since examples were not installed (reemerge with USE='examples')"
60 for example in autostart server client1 client2 client3 p2p-a p2p-b; do
61 [ -e "${ROOT}"/etc/${PN}/${example} ] && die "${ROOT}/etc/${PN}/${example} already present, rm -R it first"
63 cp -rv "${ROOT}"/usr/share/doc/${PF}/examples/etc/${PN} "${ROOT}"/etc/ || die "failed to copy examples"
68 enewuser anytun -1 -1 /var/run/anytun anytun
69 elog "Please refer to the README file regarding the syntax of the /etc/${PN}/"
70 elog "configuration files or see examples provided with the package"
71 elog "You can use gentoo-style ${PN}.{VPN} initrd scripts to start "
72 elog "VPNs separately. Just symlink to the initscript, e.g.:"
73 elog "# ln -s /etc/init.d/${PN} /etc/init.d/${PN}.client1"
75 elog "You can disect anytun traffic using wireshark by plugging the script"
76 elog "satp.lua into wireshark. Get it here:"
77 elog " http://svn.anytun.org/anytun-common/trunk/wireshark-lua/satp.lua"
78 #elog " /usr/share/${P}/wireshark-lua/satp.lua into wireshark"