summaryrefslogtreecommitdiff
blob: 2a07553ec85aeb1aff8bba96b300a893014b2198 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/cipe/cipe-1.5.4.ebuild,v 1.4 2004/07/01 20:53:23 squinky86 Exp $

inherit eutils

CIPE_TEXINFO="${PN}-1.5.1.texinfo"

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
	http://sites.inka.de/bigred/sw/${CIPE_TEXINFO}"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* ~x86"
IUSE="ssl"

RDEPEND="virtual/libc
	ssl? ( >=dev-libs/openssl-0.9.6 )"

DEPEND="${RDEPEND}
	virtual/linux-sources"

S=${WORKDIR}/${P}

src_unpack() {
	unpack ${A}

	cp ${DISTDIR}/${CIPE_TEXINFO} ${S}/${PN}.texinfo

	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 "For info on configuring cipe, do 'info cipe'"
}