]> Pileus Git - ~andy/sunrise/blob - net-misc/anytun/anytun-0.3.1.ebuild
net-misc/uanytun: New Version 0.3.2. ebuild changes to reflect improvements in uanytu...
[~andy/sunrise] / net-misc / anytun / anytun-0.3.1.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils
6
7 DESCRIPTION="VPN daemon using Secure Anycast Tunneling"
8 HOMEPAGE="http://anytun.org/"
9 SRC_URI="http://anytun.org/~equinox/${P}.tar.gz"
10
11 LICENSE="GPL-3"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="examples gcrypt"
15
16 RDEPEND=">=dev-libs/boost-1.35
17         <dev-libs/boost-1.40
18         gcrypt? ( dev-libs/libgcrypt )
19         !gcrypt? ( dev-libs/openssl )"
20 DEPEND="${RDEPEND}
21         <app-text/asciidoc-8.5.0" # asciidoc a2x >= 8.5.0 requires an -L switch not     present in lower versions
22
23 S=${S}/src
24
25 src_compile() {
26         local myconf=""
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
30         #econf ${myconf}
31         ./configure ${myconf} || die "configure failed"
32
33         emake || die "make failed"
34
35         einfo "Building manpages"
36         emake manpage || die "failed building manpages"
37 }
38
39 src_install() {
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"
45
46         cd man/
47         doman anyrtpproxy.8 anytun-config.8 anytun-controld.8 anytun-showtables.8 anytun.8 || die "failed to install manpages"
48
49         cd ../../
50         insinto /usr/share/${P}/wireshark-lua/
51         doins wireshark-lua/* || die "failed to install wireshark-lua contrib script"
52
53         dodoc AUTHORS ChangeLog README || die "failed to install docs"
54
55         if use examples; then
56                 insinto /usr/share/doc/${PF}/etc-anytun-examples/
57                 doins -r etc/anytun/* || die "failed to install examples"
58         fi
59 }
60
61 pkg_config() {
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"
67 }
68
69 pkg_postinst() {
70         enewgroup anytun
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"
79         einfo
80         einfo "You can disect anytun traffic using wireshark by plugging the script"
81         einfo " /usr/share/${P}/wireshark-lua/satp.lua into wireshark"
82 }