summaryrefslogtreecommitdiff
blob: 08f473710c0489d0ba257081296402987e819483 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit linux-info eutils multilib toolchain-funcs

DESCRIPTION="Layer 2 tunneling protocol network server (LNS)"
HOMEPAGE="http://sourceforge.net/projects/l2tpns"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

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

DEPEND=">=dev-libs/libcli-1.8.5"
RDEPEND="${DEPEND}"

src_unpack() {
	unpack ${A}

	pushd "${S}"
	epatch "${FILESDIR}/${PN}-trust-localhost.patch"

	sed -i  \
		-e '/^#include <libcli.h>$/ a #include <linux/types.h>' \
		"${S}"/l2tpns.c || die "sed on l2tpns.c failed"
}

src_compile() {
	emake \
		OPTIM="${CFLAGS}" \
		LDFLAGS="${LDFLAGS}" \
		CC="$(tc-getCC)" \
		LD="$(tc-getCC)" \
		libdir="/usr/$(get_libdir)/${PN}" \
		|| die "emake failed"
}

src_install() {
	emake install \
		DESTDIR="${D}" \
		libdir="/usr/$(get_libdir)/${PN}" \
		|| die "emake install failed"
}