summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/ippool/ippool_1.3.bb
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2017-06-07 13:42:51 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2017-06-28 10:28:18 -0400
commitc4b9c4886a4a6f70870e4090d9a35b5c1f0d4b90 (patch)
treec08fca39876511bad890f01a0940b298dd61b6e6 /meta-networking/recipes-daemons/ippool/ippool_1.3.bb
parent58e88534df2ae3bb16ca9e8ba85bea4db29f4899 (diff)
downloadmeta-openembedded-c4b9c4886a4a6f70870e4090d9a35b5c1f0d4b90.tar.gz
ippool: add new recipe
IpPool is a userspace daemon for managing one or more pools of IP addresses. It was developed as part of the OpenL2TP project but has since been repackaged so that it may be used independently of OpenL2TP. Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
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 000000000..969f434cc
--- /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