diff options
Diffstat (limited to 'meta-networking/recipes-daemons/ippool/ippool_1.3.bb')
| -rw-r--r-- | meta-networking/recipes-daemons/ippool/ippool_1.3.bb | 105 |
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 @@ | |||
| 1 | SUMMARY = "An IP address pool manager" | ||
| 2 | DESCRIPTION = "IpPool is implemented as a separate server daemon \ | ||
| 3 | to allow any application to use its address pools. This makes it possible \ | ||
| 4 | to define address pools that are shared by PPP, L2TP, PPTP etc. It may be \ | ||
| 5 | useful in some VPN server setups. IpPool comes with a command line \ | ||
| 6 | management application, ippoolconfig to manage and query address pool \ | ||
| 7 | status. A pppd plugin is supplied which allows pppd to request IP \ | ||
| 8 | addresses from ippoold. \ | ||
| 9 | " | ||
| 10 | HOMEPAGE = "http://www.openl2tp.org/" | ||
| 11 | SECTION = "console/network" | ||
| 12 | LICENSE = "GPLv2+" | ||
| 13 | |||
| 14 | SRC_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 | |||
| 25 | LIC_FILES_CHKSUM = "file://LICENSE;md5=4c59283b82fc2b166455e0fc23c71c6f" | ||
| 26 | SRC_URI[md5sum] = "e2401e65db26a3764585b97212888fae" | ||
| 27 | SRC_URI[sha256sum] = "d3eab7d6cad5da8ccc9d1e31d5303e27a39622c07bdb8fa3618eea314412075b" | ||
| 28 | |||
| 29 | inherit systemd | ||
| 30 | |||
| 31 | DEPENDS = "readline ppp ncurses gzip-native" | ||
| 32 | RDEPENDS_${PN} = "rpcbind" | ||
| 33 | |||
| 34 | EXTRA_OEMAKE = "CC='${CC}' AS='${AS}' LD='${LD}' AR='${AR}' NM='${NM}' STRIP='${STRIP}'" | ||
| 35 | EXTRA_OEMAKE += "PPPD_VERSION=${PPPD_VERSION} SYS_LIBDIR=${libdir}" | ||
| 36 | # enable self tests | ||
| 37 | EXTRA_OEMAKE += "IPPOOL_TEST=y" | ||
| 38 | |||
| 39 | |||
| 40 | SYSTEMD_SERVICE_${PN} = "ippool.service" | ||
| 41 | SYSTEMD_AUTO_ENABLE = "disable" | ||
| 42 | |||
| 43 | |||
| 44 | do_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 | |||
| 57 | do_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 | |||
| 75 | PACKAGES =+ "${PN}-test" | ||
| 76 | |||
| 77 | FILES_${PN} += "${libdir}/pppd/${PPPD_VERSION}/ippool.so" | ||
| 78 | FILES_${PN}-dbg += "${libdir}/pppd/${PPPD_VERSION}/.debug/ippool.so" | ||
| 79 | FILES_${PN}-test = "/opt/${BPN}" | ||
| 80 | |||
| 81 | # needs tcl to run tests | ||
| 82 | RDEPENDS_${PN}-test += "tcl ${BPN}" | ||
| 83 | |||
| 84 | PPPD_VERSION="${@get_ppp_version(d)}" | ||
| 85 | |||
| 86 | def 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 | |||
