diff options
Diffstat (limited to 'gentoo-linux/net-misc')
-rw-r--r-- | gentoo-linux/net-misc/anytun/anytun-0.3.2.ebuild | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/gentoo-linux/net-misc/anytun/anytun-0.3.2.ebuild b/gentoo-linux/net-misc/anytun/anytun-0.3.2.ebuild new file mode 100644 index 0000000..119e2c7 --- /dev/null +++ b/gentoo-linux/net-misc/anytun/anytun-0.3.2.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2009 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="${WORKDIR}/${P}/src" + +src_compile() { + local myconf="" + use gcrypt || myconf="--use-ssl-crypto" + econf --ebuild-compat ${myconf} || die "configure failed" + + einfo "Building executables" + emake || die "make failed" + + einfo "Building manpages" + emake manpage || die "failed building manpages" +} + +src_install() { + emake install DESTDIR=${D} + rm -Rf ${D}/etc/init.d + rm -Rf ${D}/etc/anytun/* #let's not clutter already existing configuration subdirs + keepdir /etc/anytun || die "failed to keep dir" + keepdir /var/run/anytun || die "failed to mkdir" + keepdir /var/run/anytun-controld || die "failed to mkdir" + prepallman + + newinitd "${FILESDIR}/${PN}-0.3.1.init" anytun || die "failed to copy/install initrd script" + + cd ../../ + insinto /usr/share/${P}/wireshark-lua/ + doins wireshark-lua/* || die "failed to install wireshark-lua contrib script" + + dodoc AUTHORS ChangeLog README || die "failed to install docs" + + if use examples; then + insinto /usr/share/doc/${PF}/etc-anytun-examples/ + doins -r etc/anytun/* || die "failed to install examples" + fi +} + +pkg_config() { + [ -e "${ROOT}"/etc/anytun ] && die "${ROOT}/etc/anytun/ already present, rm -R it first " + if [ ! -d "${ROOT}"/usr/share/doc/${PF}/etc-anytun-examples/ ]; then + die "can't copy example configs since examples were not installed (reemerge with USE=\"examples\")" + fi + mkdir -p "${ROOT}"/etc/anytun/ || die "couldn't mkdir ${ROOT}/etc/anytun/" + cp -r "${ROOT}"/usr/share/doc/${PF}/etc-anytun-examples/* "${ROOT}"/etc/anytun/ || die "failed to copy examples" +} + +pkg_postinst() { + enewgroup anytun + enewuser anytun -1 -1 /var/run/anytun anytun + einfo "Note that each VPN gets its own directory under /etc/anytun/" + einfo " (see examples provided with the package)" + einfo "You can either add tunnels to /etc/anytun/autostart and" + einfo "start them using /etc/init.d/anytun" + einfo "Or you can forget the autostart file and create" + einfo "gentoo-style anytun.{VPN} initrd scripts for each VPN" + einfo "# ln -s /etc/init.d/anytun /etc/init.d/anytun.client1" + einfo + einfo "You can disect anytun traffic using wireshark by plugging the script" + einfo " /usr/share/${P}/wireshark-lua/satp.lua into wireshark" +} |