1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 DESCRIPTION="Userspace tools for kernel L2TP implementation"
9 HOMEPAGE="http://www.openl2tp.org/"
10 SRC_URI="mirror://sourceforge/openl2tp/${P}.tar.gz"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="+client debug dmalloc doc +examples rpc server stats"
17 REQUIRED_USE="|| ( client server )"
20 >=net-libs/rpcsvc-proto-1.3.1-r1
25 >=net-dialup/ppp-2.4.5
26 >=net-libs/libtirpc-1.0.3
28 dmalloc? ( dev-libs/dmalloc )
31 rpc? ( net-nds/rpcbind )
34 CONFIG_CHECK="~PPPOL2TP"
37 "${FILESDIR}/${P}-werror.patch"
38 "${FILESDIR}/${P}-ldflags.patch"
39 "${FILESDIR}/${P}-pppd-2.patch"
40 "${FILESDIR}/${P}-man.patch"
41 "${FILESDIR}/${P}-l2tpconfig.patch"
42 "${FILESDIR}/${P}-parallelbuild.patch"
43 "${FILESDIR}/${P}-optionsfile.patch"
44 "${FILESDIR}/${P}-clientip_as_ipparam.patch"
45 "${FILESDIR}/${P}-setkey.patch"
46 "${FILESDIR}/${P}-unused-var.patch"
47 "${FILESDIR}/${P}-configure-Makefile.patch"
48 "${FILESDIR}/${P}-cflags.patch"
49 "${FILESDIR}/${P}-tirpc.patch"
54 sed -i 's/CFLAGS.optimize/CFLAGS_optimize/g' Makefile */Makefile || die "Makefile sed failed"
60 use client || myconf+=" L2TP_FEATURE_LAC_SUPPORT=n
61 L2TP_FEATURE_LAIC_SUPPORT=n
62 L2TP_FEATURE_LAOC_SUPPORT=n "
64 use server || myconf+=" L2TP_FEATURE_LNS_SUPPORT=n
65 L2TP_FEATURE_LNIC_SUPPORT=n
66 L2TP_FEATURE_LNOC_SUPPORT=n "
68 use rpc || myconf+=" L2TP_FEATURE_RPC_MANAGEMENT=n "
70 use stats && myconf+=" L2TP_FEATURE_LOCAL_STAT_FILE=y "
71 use debug && myconf+=" L2TP_DEBUG=y "
72 use dmalloc && myconf+=" USE_DMALLOC=y "
74 echo ${myconf} > "${T}/myconf"
78 emake $(cat "${T}/myconf")
82 emake $(cat "${T}/myconf") DESTDIR="${D}" install
86 dodoc doc/{event_sock_example.c,README.event_sock}
88 dodoc -r "${FILESDIR}"/examples
93 newdoc plugins/README README.plugins
97 newinitd "${FILESDIR}"/openl2tpd.initd openl2tpd
98 # init.d script is quite different for RPC and non-RPC versions.
99 use rpc || sed -i s/userpc=\"yes\"/userpc=\"no\"/ "${D}/etc/init.d/openl2tpd" || die "sed failed"
100 newconfd "${FILESDIR}"/openl2tpd.confd openl2tpd
106 ewarn "RPC control does not provide any auth checks for control connection."
107 ewarn "Unless you need this you should disable it, for reference:"
108 ewarn "http://forums.openl2tp.org/viewtopic.php?f=4&t=41"
110 ewarn "Therefore DO NOT USE RPC IN INSECURE ENVIRONMENTS!"
113 ewarn "Without RPC support you won't be able to use l2tpconfig."
114 ewarn "Please read http://forums.openl2tp.org/viewtopic.php?f=4&t=41"
115 ewarn "for more information about the security risk before enabling."
117 ewarn "If you are using numerical strings (e.g. login name containing only"
118 ewarn "digits) or special characters in password, please use double quotes"
119 ewarn "to enclose them."
123 ewarn "To enable status files openl2tpd must be started with -S option."
124 ewarn "Upstream warns about runtime overhead with status files enabled."