1 # Copyright 1999-2009 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/~equinox/${P}.tar.gz"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="examples gcrypt"
16 RDEPEND=">=dev-libs/boost-1.35
18 gcrypt? ( dev-libs/libgcrypt )
19 !gcrypt? ( dev-libs/openssl )"
21 <app-text/asciidoc-8.5.0" # asciidoc a2x >= 8.5.0 requires an -L switch not present in lower versions
27 use gcrypt || myconf="--use-ssl-crypto"
28 # anytun's configure right now only takes 1! option (no --prefix etc), so econf would be too
29 # much for your little script and the build would fail
31 ./configure ${myconf} || die "configure failed"
33 emake || die "make failed"
35 einfo "Building manpages"
36 emake manpage || die "failed building manpages"
40 dosbin anytun || die "failed to copy/install an executable"
41 dobin anytun-config anytun-controld anytun-showtables anytun-nosync || die "failed to copy/install an executable"
42 newinitd "${FILESDIR}/${PN}-0.3.1.init" anytun || die "failed to copy/install initrd script"
43 keepdir /var/run/anytun || die "failed to mkdir"
44 keepdir /var/run/anytun-controld || die "failed to mkdir"
47 doman anyrtpproxy.8 anytun-config.8 anytun-controld.8 anytun-showtables.8 anytun.8 || die "failed to install manpages"
50 insinto /usr/share/${P}/wireshark-lua/
51 doins wireshark-lua/* || die "failed to install wireshark-lua contrib script"
53 dodoc AUTHORS ChangeLog README || die "failed to install docs"
56 insinto /usr/share/doc/${PF}/etc-anytun-examples/
57 doins -r etc/anytun/* || die "failed to install examples"
62 [ -e "${ROOT}"/etc/anytun ] && die "${ROOT}/etc/anytun/ already present, rm -R it first"
63 [ ! -d "${ROOT}"/usr/share/doc/${PF}/etc-anytun-examples/ ] && \
64 die "can't copy example configs since examples were not installed (reemerge with USE=\"examples\")"
65 mkdir -p "${ROOT}"/etc/anytun/ || die "couldn't mkdir ${ROOT}/etc/anytun/"
66 cp -r "${ROOT}"/usr/share/doc/${PF}/etc-anytun-examples/* "${ROOT}"/etc/anytun/ || die "failed to copy examples"
71 enewuser anytun -1 -1 /var/run/anytun anytun
72 einfo "Note that each VPN gets its own directory under /etc/anytun/"
73 einfo " (see examples provided with the package)"
74 einfo "You can either add tunnels to /etc/anytun/autostart and"
75 einfo "start them using /etc/init.d/anytun"
76 einfo "Or you can forget the autostart file and create"
77 einfo "gentoo-style anytun.{VPN} initrd scripts for each VPN"
78 einfo "# ln -s /etc/init.d/anytun /etc/init.d/anytun.client1"
80 einfo "You can disect anytun traffic using wireshark by plugging the script"
81 einfo " /usr/share/${P}/wireshark-lua/satp.lua into wireshark"