# $Header: $ inherit eutils DESCRIPTION="Cryptographic IP tunneling daemon/module" HOMEPAGE="http://sites.inka.de/bigred/devel/cipe.html" SRC_URI="http://sites.inka.de/bigred/sw/${P}.tar.gz ftp://ftp.netheaven.com/pub/cipe/cipe-1.6.0-kernel-2.6.14.2.patch" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86 -*" IUSE="ssl" RDEPEND="virtual/libc ssl? ( >=dev-libs/openssl-0.9.6 )" DEPEND="${RDEPEND} virtual/linux-sources" src_unpack() { unpack ${A} check_KV >=2.6.14 \ && cd ${S} && epatch ${DISTDIR}/cipe-1.6.0-kernel-2.6.14.2.patch epatch ${FILESDIR}/${P}-gentoo.patch } src_compile() { local myconf="" use ssl \ && myconf="${myconf} --enable-pkcipe" \ || myconf="${myconf} --disable-pkcipe" # A custom use flag for bug compatability mode # Do we need this? #use cipebc && myconf="${myconf} --enable-bug-compatible" econf ${myconf} || die emake || die } src_install() { make DESTDIR=${D} install || die insinto /etc/cipe insopts -m755 doins samples/ip-{up,down} insopts -m600 doins samples/options exeinto /etc/init.d newexe ${FILESDIR}/init.d-ciped ciped dodoc README* CHANGES COPYING tcpdump.patch dodoc samples/{ip-{up,down},options} } pkg_postinst() { if [ -f /usr/bin/rsa-keygen ] && [ ! -f /etc/cipe/identity.priv ] then ebegin "Generating new identity (host) key" emsg="`rsa-keygen /etc/cipe/identity 2>&1`" eend $? $emsg fi update-modules depmod -a echo einfo "To run cipe as daemon don't forget to add cipcb in /etc/modules.autoload.d/kernel-*" einfo "For info on configuring cipe, do 'info cipe'" }