ippool_1.3.bb 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 = "GPL-2.0-or-later"
  13. SRC_URI = "https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
  14. file://runtest.sh \
  15. file://ippool.service \
  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://0001-usl_timer-Check-for-return-value-of-write-API.patch \
  22. file://0001-Respect-flags-from-env.patch \
  23. file://0001-read-returns-ssize_t.patch \
  24. file://0002-Mark-first-element-of-a-string-as-null.patch \
  25. file://0003-cli-Mark-return-of-strtol-as-long-int.patch \
  26. file://0002-link-with-libtirpc.patch \
  27. file://0003-musl-fixes.patch \
  28. file://strncpy-truncation.patch \
  29. file://0001-pppd-ippool.c-Fix-type-casting-issues-between-in_add.patch \
  30. file://0002-ippool_rpc_server.c-Add-missing-prototype-for-ippool.patch \
  31. file://0001-Use-unsigned-int-type-for-1-bit-integer-bitfield.patch \
  32. file://0001-ippool-Port-to-ppp-2.5-APIs.patch \
  33. "
  34. LIC_FILES_CHKSUM = "file://LICENSE;md5=4c59283b82fc2b166455e0fc23c71c6f"
  35. SRC_URI[md5sum] = "e2401e65db26a3764585b97212888fae"
  36. SRC_URI[sha256sum] = "d3eab7d6cad5da8ccc9d1e31d5303e27a39622c07bdb8fa3618eea314412075b"
  37. inherit systemd
  38. DEPENDS = "readline ppp ncurses gzip-native rpcsvc-proto-native libtirpc"
  39. RDEPENDS:${PN} = "rpcbind"
  40. EXTRA_OEMAKE = "CC='${CC}' AS='${AS}' LD='${LD}' AR='${AR}' NM='${NM}' STRIP='${STRIP}'"
  41. EXTRA_OEMAKE += "PPPD_VERSION=${PPPD_VERSION} SYS_LIBDIR=${libdir}"
  42. # enable self tests
  43. EXTRA_OEMAKE += "IPPOOL_TEST=y"
  44. CPPFLAGS += "${SELECTED_OPTIMIZATION} -I${STAGING_INCDIR}/tirpc"
  45. SYSTEMD_SERVICE:${PN} = "ippool.service"
  46. do_compile:prepend() {
  47. # fix the CFLAGS= and CPPFLAGS= in main Makefile, to have the extra CFLAGS in env
  48. sed -i -e "s/^CFLAGS=/CFLAGS+=/" ${S}/Makefile
  49. sed -i -e "s/^CPPFLAGS=/CPPFLAGS+=/" ${S}/Makefile
  50. sed -i -e "s:-I/usr/include/pppd:-I=/usr/include/pppd:" ${S}/pppd/Makefile
  51. }
  52. do_install() {
  53. oe_runmake DESTDIR=${D} install
  54. install -D -m 0755 ${S}/debian/init.d ${D}${sysconfdir}/init.d/ippoold
  55. install -D -m 0644 ${UNPACKDIR}/ippool.service ${D}${systemd_system_unitdir}/ippool.service
  56. sed -i -e 's:@SBINDIR@:${sbindir}:g' ${D}${systemd_system_unitdir}/ippool.service
  57. # install self test
  58. install -d ${D}/opt/${BPN}
  59. install ${S}/test/all.tcl ${S}/test/ippool.test \
  60. ${S}/test/test_procs.tcl ${D}/opt/${BPN}
  61. install ${UNPACKDIR}/runtest.sh ${D}/opt/${BPN}
  62. # fix the ../ippoolconfig in test_procs.tcl
  63. sed -i -e "s:../ippoolconfig:ippoolconfig:" \
  64. ${D}/opt/${BPN}/test_procs.tcl
  65. }
  66. PACKAGES =+ "${PN}-test"
  67. FILES:${PN} += "${libdir}/pppd/${PPPD_VERSION}/ippool.so"
  68. FILES:${PN}-dbg += "${libdir}/pppd/${PPPD_VERSION}/.debug/ippool.so"
  69. FILES:${PN}-test = "/opt/${BPN}"
  70. # needs tcl to run tests
  71. RDEPENDS:${PN}-test += "tcl ${BPN}"
  72. PPPD_VERSION="${@get_ppp_version(d)}"
  73. def get_ppp_version(d):
  74. import re
  75. pppd_plugin = d.expand('${STAGING_LIBDIR}/pppd')
  76. if not os.path.isdir(pppd_plugin):
  77. return None
  78. bb.debug(1, "pppd plugin dir %s" % pppd_plugin)
  79. r = re.compile(r"\d*\.\d*\.\d*")
  80. for f in os.listdir(pppd_plugin):
  81. if os.path.isdir(os.path.join(pppd_plugin, f)):
  82. ma = r.match(f)
  83. if ma:
  84. bb.debug(1, "pppd version dir %s" % f)
  85. return f
  86. else:
  87. bb.debug(1, "under pppd plugin dir %s" % f)
  88. return None