blob: c447df0512c5f514382cd82e349c195998ddc403 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "BGP/OSPF/RIP routing daemon"
2DESCRIPTION = "FRRouting is a free and open source Internet routing protocol suite for Linux \
3and Unix platforms. It implements BGP, OSPF, RIP, IS-IS, PIM, LDP, BFD, Babel, PBR, OpenFabric \
4and VRRP, with alpha support for EIGRP and NHRP."
5HOMEPAGE = "https://frrouting.org/"
6SECTION = "net"
7
8LICENSE = "GPL-2.0-only & LGPL-2.1-only"
Andrew Geissler220dafd2023-10-04 10:18:08 -05009LIC_FILES_CHKSUM = "file://doc/licenses/GPL-2.0;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
10 file://doc/licenses/LGPL-2.1;md5=4fbd65380cdd255951079008b364516c"
Andrew Geissler517393d2023-01-13 08:55:19 -060011
Patrick Williamsac13d5f2023-11-24 18:59:46 -060012PR = "r1"
13
Andrew Geissler220dafd2023-10-04 10:18:08 -050014SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/9.0 \
Andrew Geissler517393d2023-01-13 08:55:19 -060015 file://frr.pam \
Andrew Geissler220dafd2023-10-04 10:18:08 -050016 file://0001-tools-make-quiet-actually-suppress-output.patch \
Patrick Williamsac13d5f2023-11-24 18:59:46 -060017 file://CVE-2023-46752.patch \
18 file://CVE-2023-46753.patch \
19 file://CVE-2023-47235.patch \
20 file://CVE-2023-47234.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060021 "
22
Andrew Geissler220dafd2023-10-04 10:18:08 -050023SRCREV = "31ed3dd753d62b5d8916998bc32814007e91364b"
Andrew Geissler517393d2023-01-13 08:55:19 -060024
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050025UPSTREAM_CHECK_GITTAGREGEX = "frr-(?P<pver>\d+(\.\d+)+)$"
26
Andrew Geissler3eeda902023-05-19 10:14:02 -050027CVE_PRODUCT = "frrouting"
28
Andrew Geissler517393d2023-01-13 08:55:19 -060029S = "${WORKDIR}/git"
30
Andrew Geissler517393d2023-01-13 08:55:19 -060031inherit autotools-brokensep python3native pkgconfig useradd systemd
32
33DEPENDS:class-native = "bison-native elfutils-native"
Andrew Geissler220dafd2023-10-04 10:18:08 -050034DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native protobuf-c-native protobuf-c"
Andrew Geissler517393d2023-01-13 08:55:19 -060035
36RDEPENDS:${PN}:class-target = "iproute2 python3-core bash"
37
38PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
39PACKAGECONFIG:class-native = ""
40
41PACKAGECONFIG[fpm] = "--enable-fpm,--disable-fpm"
42PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam"
43PACKAGECONFIG[grpc] = "--enable-grpc,--disable-grpc,grpc-native grpc"
44PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
45PACKAGECONFIG[zeromq] = "--enable-zeromq,--disable-zeromq,zeromq"
46PACKAGECONFIG[protobuf] = "--enable-protobuf,--disable-protobuf,protobuf-c-native protobuf-c"
47PACKAGECONFIG[capabilities] = "--enable-capabilities,--disable-capabilities,libcap"
48PACKAGECONFIG[cumulus] = "--enable-cumulus,--disable-cumulus"
49PACKAGECONFIG[datacenter] = "--enable-datacenter,--disable-datacenter"
50PACKAGECONFIG[ospfclient] = "--enable-ospfapi --enable-ospfclient,--disable-ospfapi --disable-ospfclient"
51
52EXTRA_OECONF:class-native = "--enable-clippy-only"
53
54EXTRA_OECONF:class-target = "--sbindir=${libdir}/frr \
55 --sysconfdir=${sysconfdir}/frr \
56 --localstatedir=${localstatedir}/run/frr \
57 --enable-vtysh \
58 --enable-multipath=64 \
59 --enable-user=frr \
60 --enable-group=frr \
61 --enable-vty-group=frrvty \
62 --enable-configfile-mask=0640 \
63 --enable-logfile-mask=0640 \
64 --disable-doc \
65 --with-clippy=${RECIPE_SYSROOT_NATIVE}/usr/lib/clippy \
66 "
67
68CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
69
Andrew Geissler220dafd2023-10-04 10:18:08 -050070# https://github.com/FRRouting/frr/issues/14469
71DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map"
72
Andrew Geissler517393d2023-01-13 08:55:19 -060073LDFLAGS:append:mips = " -latomic"
74LDFLAGS:append:mipsel = " -latomic"
75LDFLAGS:append:powerpc = " -latomic"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050076LDFLAGS:append:riscv32 = " -latomic"
Andrew Geissler517393d2023-01-13 08:55:19 -060077
78SYSTEMD_PACKAGES = "${PN}"
79SYSTEMD_SERVICE:${PN} = "frr.service"
80SYSTEMD_AUTO_ENABLE = "disable"
81
82do_compile:prepend () {
83 sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' \
84 -e 's#${RECIPE_SYSROOT}##g' ${S}/lib/version.h
85}
86
87do_compile:class-native () {
88 oe_runmake clippy-only
89}
90
91do_install:class-native () {
92 install -d ${D}${libdir}
93 install -m 755 ${S}/lib/clippy ${D}${libdir}/clippy
94}
95
96do_install:append:class-target () {
97 install -m 0755 -d ${D}${sysconfdir}/frr
98 install -m 0640 ${S}/tools/etc/frr/* ${D}${sysconfdir}/frr/
99 chown frr:frrvty ${D}${sysconfdir}/frr
100 chown frr:frr ${D}${sysconfdir}/frr/*
101 chown frr:frrvty ${D}${sysconfdir}/frr/vtysh.conf
102 chmod 640 ${D}${sysconfdir}/frr/*
103
104 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
105 install -d ${D}/${sysconfdir}/pam.d
106 install -m 644 ${WORKDIR}/frr.pam ${D}/${sysconfdir}/pam.d/frr
107 fi
108
109 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
110 install -d ${D}${sysconfdir}/init.d
111 install -m 0755 ${B}/tools/frrinit.sh ${D}${sysconfdir}/init.d/frr
112
113 install -d ${D}${sysconfdir}/default/volatiles
114 echo "d frr frr 0755 ${localstatedir}/run/frr none" \
115 > ${D}${sysconfdir}/default/volatiles/99_frr
116 fi
117
118 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
119 install -d ${D}${systemd_system_unitdir}
120 install -m 0644 ${B}/tools/frr*.service ${D}${systemd_system_unitdir}
121
122 install -d ${D}${sysconfdir}/tmpfiles.d
123 echo "d /run/frr 0755 frr frr -" \
124 > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
125 fi
126}
127
128USERADD_PACKAGES = "${PN}"
129GROUPADD_PARAM:${PN} = "--system frr ; --system frrvty"
130USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/frr/ -M -g frr -G frrvty --shell /bin/false frr"
131
132FILES:${PN} += "${datadir}/yang"
133
134BBCLASSEXTEND = "native"