summaryrefslogtreecommitdiff
path: root/contrib/gentoo/net-dialup/accel-ppp/accel-ppp-9999.ebuild
blob: 02bf282f7249140ca0075665ea08aea4466baaf5 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=2

inherit eutils git linux-mod cmake-utils

EGIT_REPO_URI="git://accel-ppp.git.sourceforge.net/gitroot/accel-ppp/accel-ppp"

DESCRIPTION="PPtP/L2TP/PPPoE Server for Linux"
SRC_URI=""
HOMEPAGE="http://accel-ppp.sourceforge.net/"

SLOT="0"
LICENSE="GPL"
KEYWORDS="~amd64 ~x86"
IUSE="postgres debug shaper pptp_driver radius"

DEPEND=">=sys-libs/glibc-2.8
	dev-libs/openssl
	dev-libs/libaio
	shaper? ( =dev-libs/libnl-2* )
	postgres? ( dev-db/postgresql-base )"

RDEPEND="$DEPEND
         pptp_driver? ( virtual/modutils )"

BUILD_TARGETS="default"
BUILD_PARAMS="KDIR=${KERNEL_DIR}"
CONFIG_CHECK="PPP PPPOE"
MODULESD_PPTP_ALIASES=("net-pf-24 pptp")
PREFIX="/"
MODULE_NAMES="pptp(extra:${S}/driver/)"

src_unpack () {
	git_src_unpack
}

src_prepare() {
	sed -i -e "/mkdir/d" "${S}/accel-pppd/CMakeLists.txt"
	sed -i -e "/echo/d" "${S}/accel-pppd/CMakeLists.txt"
	sed -i -e "/INSTALL/d" "${S}/driver/CMakeLists.txt"
}

src_configure() {
	if use debug; then
		mycmakeargs+=( "-DCMAKE_BUILD_TYPE=Debug" )
	fi

	if  use postgres; then
		mycmakeargs+=( "-DLOG_PGSQL=TRUE" )
	fi
	
	if use shaper; then
		mycmakeargs+=( "-DSHAPER=TRUE" )
	fi

	if ! use radius; then
		mycmakeargs+=( "-DRADIUS=FALSE" )
	fi

	mycmakeargs+=( "-DCMAKE_INSTALL_PREFIX=/usr" )

	cmake-utils_src_configure
}

src_compile() {
	cmake-utils_src_compile
	
	if use pptp_driver; then
		cd ${S}/driver
		#convert_to_m Makefile
		linux-mod_src_compile || die "failed to build driver"
	fi
}

src_install() {
	cmake-utils_src_install

	if use pptp_driver; then
		cd ${S}/driver
		linux-mod_src_install
	fi

	exeinto /etc/init.d
	newexe "${S}/contrib/gentoo/net-dialup/accel-ppp/files/accel-pppd-init" accel-pppd

	insinto /etc/conf.d
	newins "${S}/contrib/gentoo/net-dialup/accel-ppp/files/accel-pppd-confd" accel-pppd

	dodir /var/log/accel-ppp
	dodir /var/run/accel-ppp
	dodir /var/run/radattr
}