blob: 183c0066dfbb9b3d2616343148302d213991478b [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "An L2TP client/server, designed for VPN use."
2DESCRIPTION = "OpenL2TP is an open source L2TP client / server, written \
3specifically for Linux. It has been designed for use as an enterprise \
4L2TP VPN server or in commercial, Linux-based, embedded networking \
5products and is able to support hundreds of sessions, each with \
6different configuration. It is used by several ISPs to provide \
7L2TP services and by corporations to implement L2TP VPNs."
8HOMEPAGE = "http://www.openl2tp.org/"
9SECTION = "net"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050010
11# cli and usl use license LGPL-2.1
Andrew Geissler9aee5002022-03-30 16:27:02 +000012LICENSE = "GPL-2.0-only & LGPL-2.1-only"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050013LIC_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
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080019DEPENDS = "popt flex readline rpcsvc-proto-native bison-native"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050020
Brad Bishope42b3e32020-01-15 22:08:42 -050021SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BP}.tar.gz \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050022 file://Makefile-modify-CFLAGS-to-aviod-build-error.patch \
23 file://openl2tp-simplify-gcc-warning-hack.patch \
Patrick Williamsddad1a12017-02-23 20:36:32 -060024 file://Makefile-obey-LDFLAGS.patch \
25 file://0001-test-pppd_dummy.c-Fix-return-value.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050026 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 Bishopd7bf8c12018-02-25 22:55:05 -050030 file://openl2tpd-initscript-fix.patch \
31 file://openl2tpd-initscript-fix-sysconfig.patch \
32 file://openl2tpd-initscript-fix-warning.patch \
33 file://openl2tpd.service \
Brad Bishop316dfdd2018-06-25 12:45:53 -040034 file://openl2tpd-enable-tests.patch \
35 file://run-ptest \
36 file://fix_linux_4.15_compile.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037 file://0002-user-ipv6-structures.patch \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050038 file://0001-l2tp_rpc_server.c-Add-missing-prototype-for-l2tp_api.patch \
39 file://0001-lex-yacc-Add-missing-function-prototypes.patch \
Patrick Williamsddad1a12017-02-23 20:36:32 -060040 "
Patrick Williamsb48b7b42016-08-17 15:04:38 -050041SRC_URI[md5sum] = "e3d08dedfb9e6a9a1e24f6766f6dadd0"
42SRC_URI[sha256sum] = "1c97704d4b963a87fbc0e741668d4530933991515ae9ab0dffd11b5444f4860f"
43
Brad Bishop316dfdd2018-06-25 12:45:53 -040044inherit autotools-brokensep pkgconfig systemd ptest
Brad Bishopd7bf8c12018-02-25 22:55:05 -050045
Patrick Williams213cb262021-08-07 19:21:33 -050046SYSTEMD_SERVICE:${PN} = "openl2tpd.service"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050047SYSTEMD_AUTO_ENABLE = "disable"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050048
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080049DEPENDS += "libtirpc"
50CPPFLAGS += "-I${STAGING_INCDIR}/tirpc"
51CFLAGS += "-I${STAGING_INCDIR}/tirpc"
52LDFLAGS += "-ltirpc"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050053
Patrick Williamsb48b7b42016-08-17 15:04:38 -050054PARALLEL_MAKE = ""
Brad Bishop6e60e8b2018-02-01 10:27:11 -050055EXTRA_OEMAKE = 'CFLAGS="${CFLAGS} -Wno-unused-but-set-variable" CPPFLAGS="${CPPFLAGS}" OPT_CFLAGS="${CFLAGS}"'
Patrick Williamsb48b7b42016-08-17 15:04:38 -050056
Patrick Williams213cb262021-08-07 19:21:33 -050057do_compile:prepend() {
Patrick Williamsb48b7b42016-08-17 15:04:38 -050058 sed -i -e "s:SYS_LIBDIR=.*:SYS_LIBDIR=${libdir}:g" \
59 -e 's:$(CROSS_COMPILE)as:${AS}:g' \
60 -e 's:$(CROSS_COMPILE)ld:${LD}:g' \
61 -e 's:$(CROSS_COMPILE)gcc:${CC}:g' \
62 -e 's:$(CROSS_COMPILE)ar:${AR}:g' \
63 -e 's:$(CROSS_COMPILE)nm:${NM}:g' \
64 -e 's:$(CROSS_COMPILE)strip:${STRIP}:g' \
65 -e 's:$(CROSS_COMPILE)install:install:g' \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050066 -e 's:CPPFLAGS-y:CPPFLAGS:g' \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050067 ${S}/Makefile
68}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050069
Patrick Williams213cb262021-08-07 19:21:33 -050070do_install:append () {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050071 install -d ${D}${sysconfdir}/init.d
72 install -d ${D}${sysconfdir}/default
73 install -m 0755 ${S}/etc/rc.d/init.d/openl2tpd ${D}${sysconfdir}/init.d/openl2tpd
74 install -m 0755 ${S}/etc/sysconfig/openl2tpd ${D}${sysconfdir}/default/openl2tpd
75
76 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
77 install -D -m 0644 ${WORKDIR}/openl2tpd.service ${D}${systemd_system_unitdir}/openl2tpd.service
78 sed -i -e 's,@STATEDIR@,${localstatedir},g' \
79 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
80 -e 's,@SBINDIR@,${sbindir},g' \
81 -e 's,@BINDIR@,${bindir},g' \
82 -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
83 -e 's,@BASE_BINDIR@,${base_bindir},g' \
84 ${D}${systemd_system_unitdir}/openl2tpd.service
85 fi
86}
87
Brad Bishop316dfdd2018-06-25 12:45:53 -040088do_install_ptest () {
89 for i in all.tcl configfile.test peer_profile.test ppp_profile.test \
90 session_profile.test session.test system.test test_procs.tcl \
91 thirdparty_lns.test tunnel_profile.test tunnel.test; do
92 install -m 0755 ${S}/test/$i ${D}${PTEST_PATH}
93 done
94}
95
Patrick Williams213cb262021-08-07 19:21:33 -050096RDEPENDS:${PN} = "ppp ppp-l2tp bash"