Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | SUMMARY = "An L2TP client/server, designed for VPN use." |
| 2 | DESCRIPTION = "OpenL2TP is an open source L2TP client / server, written \ |
| 3 | specifically for Linux. It has been designed for use as an enterprise \ |
| 4 | L2TP VPN server or in commercial, Linux-based, embedded networking \ |
| 5 | products and is able to support hundreds of sessions, each with \ |
| 6 | different configuration. It is used by several ISPs to provide \ |
| 7 | L2TP services and by corporations to implement L2TP VPNs." |
| 8 | HOMEPAGE = "http://www.openl2tp.org/" |
| 9 | SECTION = "net" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 10 | |
| 11 | # cli and usl use license LGPL-2.1 |
| 12 | LICENSE = "GPL-2.0 & LGPL-2.1" |
| 13 | LIC_FILES_CHKSUM = "file://COPYING;md5=e9d9259cbbf00945adc25a470c1d3585 \ |
| 14 | file://LICENSE;md5=f8970abd5ea9be701a0deedf5afd77a5 \ |
| 15 | file://cli/LICENSE;md5=9c1387a3c5213aa40671438af3e00793 \ |
| 16 | file://usl/LICENSE;md5=9c1387a3c5213aa40671438af3e00793 \ |
| 17 | " |
| 18 | |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 19 | DEPENDS = "popt flex readline" |
| 20 | |
Brad Bishop | 7f28bc5 | 2017-12-03 23:42:40 -0500 | [diff] [blame] | 21 | SRC_URI = "ftp://ftp.openl2tp.org/releases/${BP}/${BP}.tar.gz \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 22 | file://Makefile-modify-CFLAGS-to-aviod-build-error.patch \ |
| 23 | file://openl2tp-simplify-gcc-warning-hack.patch \ |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 24 | file://Makefile-obey-LDFLAGS.patch \ |
| 25 | file://0001-test-pppd_dummy.c-Fix-return-value.patch \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 26 | file://0001-Use-1-instead-of-WAIT_ANY.patch \ |
| 27 | file://0002-cli-include-fcntl.h-for-O_CREAT-define.patch \ |
| 28 | file://0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch \ |
| 29 | file://0001-l2tp_api-Included-needed-headers.patch \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 30 | file://openl2tpd-initscript-fix.patch \ |
| 31 | file://openl2tpd-initscript-fix-sysconfig.patch \ |
| 32 | file://openl2tpd-initscript-fix-warning.patch \ |
| 33 | file://openl2tpd.service \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 34 | file://openl2tpd-enable-tests.patch \ |
| 35 | file://run-ptest \ |
| 36 | file://fix_linux_4.15_compile.patch \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 37 | " |
| 38 | |
| 39 | SRC_URI_append_libc-musl = "\ |
| 40 | file://0004-Adjust-for-linux-kernel-headers-assumptions-on-glibc.patch \ |
| 41 | file://0002-user-ipv6-structures.patch \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 42 | file://0001-l2tp_api.c-include-rpc-clnt.h-for-resultproc_t.patch \ |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 43 | " |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 44 | SRC_URI[md5sum] = "e3d08dedfb9e6a9a1e24f6766f6dadd0" |
| 45 | SRC_URI[sha256sum] = "1c97704d4b963a87fbc0e741668d4530933991515ae9ab0dffd11b5444f4860f" |
| 46 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 47 | inherit autotools-brokensep pkgconfig systemd ptest |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 48 | |
| 49 | SYSTEMD_SERVICE_${PN} = "openl2tpd.service" |
| 50 | SYSTEMD_AUTO_ENABLE = "disable" |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 51 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 52 | DEPENDS_append_libc-musl = " libtirpc" |
| 53 | CPPFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc" |
| 54 | CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc" |
| 55 | LDFLAGS_append_libc-musl = " -ltirpc" |
| 56 | |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 57 | PARALLEL_MAKE = "" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 58 | EXTRA_OEMAKE = 'CFLAGS="${CFLAGS} -Wno-unused-but-set-variable" CPPFLAGS="${CPPFLAGS}" OPT_CFLAGS="${CFLAGS}"' |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 59 | |
| 60 | do_compile_prepend() { |
| 61 | sed -i -e "s:SYS_LIBDIR=.*:SYS_LIBDIR=${libdir}:g" \ |
| 62 | -e 's:$(CROSS_COMPILE)as:${AS}:g' \ |
| 63 | -e 's:$(CROSS_COMPILE)ld:${LD}:g' \ |
| 64 | -e 's:$(CROSS_COMPILE)gcc:${CC}:g' \ |
| 65 | -e 's:$(CROSS_COMPILE)ar:${AR}:g' \ |
| 66 | -e 's:$(CROSS_COMPILE)nm:${NM}:g' \ |
| 67 | -e 's:$(CROSS_COMPILE)strip:${STRIP}:g' \ |
| 68 | -e 's:$(CROSS_COMPILE)install:install:g' \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 69 | -e 's:CPPFLAGS-y:CPPFLAGS:g' \ |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 70 | ${S}/Makefile |
| 71 | } |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 72 | |
| 73 | do_install_append () { |
| 74 | install -d ${D}${sysconfdir}/init.d |
| 75 | install -d ${D}${sysconfdir}/default |
| 76 | install -m 0755 ${S}/etc/rc.d/init.d/openl2tpd ${D}${sysconfdir}/init.d/openl2tpd |
| 77 | install -m 0755 ${S}/etc/sysconfig/openl2tpd ${D}${sysconfdir}/default/openl2tpd |
| 78 | |
| 79 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 80 | install -D -m 0644 ${WORKDIR}/openl2tpd.service ${D}${systemd_system_unitdir}/openl2tpd.service |
| 81 | sed -i -e 's,@STATEDIR@,${localstatedir},g' \ |
| 82 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ |
| 83 | -e 's,@SBINDIR@,${sbindir},g' \ |
| 84 | -e 's,@BINDIR@,${bindir},g' \ |
| 85 | -e 's,@BASE_SBINDIR@,${base_sbindir},g' \ |
| 86 | -e 's,@BASE_BINDIR@,${base_bindir},g' \ |
| 87 | ${D}${systemd_system_unitdir}/openl2tpd.service |
| 88 | fi |
| 89 | } |
| 90 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 91 | do_install_ptest () { |
| 92 | for i in all.tcl configfile.test peer_profile.test ppp_profile.test \ |
| 93 | session_profile.test session.test system.test test_procs.tcl \ |
| 94 | thirdparty_lns.test tunnel_profile.test tunnel.test; do |
| 95 | install -m 0755 ${S}/test/$i ${D}${PTEST_PATH} |
| 96 | done |
| 97 | } |
| 98 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 99 | RDEPENDS_${PN} = "ppp ppp-l2tp bash" |