summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/ippool/ippool_1.3.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-daemons/ippool/ippool_1.3.bb')
-rw-r--r--meta-networking/recipes-daemons/ippool/ippool_1.3.bb105
1 files changed, 105 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/ippool/ippool_1.3.bb b/meta-networking/recipes-daemons/ippool/ippool_1.3.bb
new file mode 100644
index 0000000000..969f434cc7
--- /dev/null
+++ b/meta-networking/recipes-daemons/ippool/ippool_1.3.bb
@@ -0,0 +1,105 @@
1SUMMARY = "An IP address pool manager"
2DESCRIPTION = "IpPool is implemented as a separate server daemon \
3to allow any application to use its address pools. This makes it possible \
4to define address pools that are shared by PPP, L2TP, PPTP etc. It may be \
5useful in some VPN server setups. IpPool comes with a command line \
6management application, ippoolconfig to manage and query address pool \
7status. A pppd plugin is supplied which allows pppd to request IP \
8addresses from ippoold. \
9"
10HOMEPAGE = "http://www.openl2tp.org/"
11SECTION = "console/network"
12LICENSE = "GPLv2+"
13
14SRC_URI = "\
15 https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
16 file://ippool_usl_timer.patch \
17 file://ippool_parallel_make_and_pic.patch \
18 file://ippool_init.d.patch \
19 file://always_syslog.patch \
20 file://makefile-add-ldflags.patch \
21 file://runtest.sh \
22 file://ippool.service \
23 "
24
25LIC_FILES_CHKSUM = "file://LICENSE;md5=4c59283b82fc2b166455e0fc23c71c6f"
26SRC_URI[md5sum] = "e2401e65db26a3764585b97212888fae"
27SRC_URI[sha256sum] = "d3eab7d6cad5da8ccc9d1e31d5303e27a39622c07bdb8fa3618eea314412075b"
28
29inherit systemd
30
31DEPENDS = "readline ppp ncurses gzip-native"
32RDEPENDS_${PN} = "rpcbind"
33
34EXTRA_OEMAKE = "CC='${CC}' AS='${AS}' LD='${LD}' AR='${AR}' NM='${NM}' STRIP='${STRIP}'"
35EXTRA_OEMAKE += "PPPD_VERSION=${PPPD_VERSION} SYS_LIBDIR=${libdir}"
36# enable self tests
37EXTRA_OEMAKE += "IPPOOL_TEST=y"
38
39
40SYSTEMD_SERVICE_${PN} = "ippool.service"
41SYSTEMD_AUTO_ENABLE = "disable"
42
43
44do_compile_prepend() {
45 # fix the CFLAGS= and CPPFLAGS= in main Makefile, to have the extra CFLAGS in env
46 sed -i -e "s/^CFLAGS=/CFLAGS+=/" ${S}/Makefile
47 sed -i -e "s/^CPPFLAGS=/CPPFLAGS+=/" ${S}/Makefile
48
49 sed -i -e "s:-I/usr/include/pppd:-I=/usr/include/pppd:" ${S}/pppd/Makefile
50
51 # ignore the OPT_CFLAGS?= in Makefile,
52 # it should be in CFLAGS from env
53 export OPT_CFLAGS=
54}
55
56
57do_install() {
58 oe_runmake DESTDIR=${D} install
59
60 install -D -m 0755 ${S}/debian/init.d ${D}${sysconfdir}/init.d/ippoold
61 install -D -m 0644 ${WORKDIR}/ippool.service ${D}${systemd_system_unitdir}/ippool.service
62 sed -i -e 's:@SBINDIR@:${sbindir}:g' ${D}${systemd_system_unitdir}/ippool.service
63
64 # install self test
65 install -d ${D}/opt/${BPN}
66 install ${S}/test/all.tcl ${S}/test/ippool.test \
67 ${S}/test/test_procs.tcl ${D}/opt/${BPN}
68 install ${WORKDIR}/runtest.sh ${D}/opt/${BPN}
69 # fix the ../ippoolconfig in test_procs.tcl
70 sed -i -e "s:../ippoolconfig:ippoolconfig:" \
71 ${D}/opt/${BPN}/test_procs.tcl
72}
73
74
75PACKAGES =+ "${PN}-test"
76
77FILES_${PN} += "${libdir}/pppd/${PPPD_VERSION}/ippool.so"
78FILES_${PN}-dbg += "${libdir}/pppd/${PPPD_VERSION}/.debug/ippool.so"
79FILES_${PN}-test = "/opt/${BPN}"
80
81# needs tcl to run tests
82RDEPENDS_${PN}-test += "tcl ${BPN}"
83
84PPPD_VERSION="${@get_ppp_version(d)}"
85
86def get_ppp_version(d):
87 import re
88
89 pppd_plugin = d.expand('${STAGING_LIBDIR}/pppd')
90 if not os.path.isdir(pppd_plugin):
91 return None
92
93 bb.debug(1, "pppd plugin dir %s" % pppd_plugin)
94 r = re.compile("\d*\.\d*\.\d*")
95 for f in os.listdir(pppd_plugin):
96 if os.path.isdir(os.path.join(pppd_plugin, f)):
97 ma = r.match(f)
98 if ma:
99 bb.debug(1, "pppd version dir %s" % f)
100 return f
101 else:
102 bb.debug(1, "under pppd plugin dir %s" % f)
103
104 return None
105