summaryrefslogtreecommitdiff
blob: 03dcc35f22a1392c5f5984bf103741f5040e1188 (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dialup/l2tpd/l2tpd-0.69.ebuild,v 1.5 2004/07/01 22:08:11 eradicator Exp $

inherit eutils

DESCRIPTION="Layer 2 Tunnelling Protocol Daemon"
HOMEPAGE="http://www.l2tpd.org/"
SRC_URI="http://www.l2tpd.org/downloads/${P}.tar.gz
	mirror://gentoo/${PN}-${PV}-gcc-3.3.patch.gz"
#	http://www.jacco2.dds.nl/networking/freeswanl2tpconfig-1.1.tgz"
DEPEND="virtual/libc"
LICENSE="GPL-2"
KEYWORDS="x86"
SLOT="0"
IUSE=""

src_unpack() {
	unpack ${A} || die
	cd ${S} || die

	epatch ${DISTDIR}/${PN}-${PV}-gcc-3.3.patch.gz

	#compile optimized
	cp Makefile Makefile.orig
	sed -e "s|-g -O2|${CFLAGS}|" Makefile.orig >Makefile
		#-e "s|^#\(OSFLAGS+= -DUSE_KERNEL\)|\1|" \
		#^wants an #include <linux/l2tp>

	#make sure these stay just like so
	cp file.h file.h.orig
	sed -e 's|\(#define DEFAULT_AUTH_FILE \).*|\1"/etc/l2tpd/l2tp-secrets"|' \
	    -e 's|\(#define DEFAULT_CONFIG_FILE \).*|\1"/etc/l2tpd/l2tpd.conf"|' \
	    -e 's|\(#define DEFAULT_PID_FILE \).*|\1"/var/run/l2tpd.pid"|' \
	    file.h.orig >file.h
}

src_compile() {
	emake || die
}

src_install() {
	dosbin l2tpd
	doman doc/*.[85]

	dodoc BUGS CHANGELOG LICENSE CREDITS README TODO \
		doc/rfc2661.txt doc/*.sample
	#cp -a ../freeswanl2tpconfig ${D}/usr/share/doc/${PF}
	#chown -R root.root ${D}/usr/share/doc/${PF}
	#mv ${D}/usr/share/doc/${PF}/freeswanl2tpconfig \
	#	${D}/usr/share/doc/${PF}/samples

	insinto /etc/l2tpd
	newins doc/l2tp-secrets.sample l2tp-secrets
	newins doc/l2tpd.conf.sample l2tpd.conf

	exeinto /etc/init.d
	newexe ${FILESDIR}/l2tpd-init l2tpd
}