blob: bddc08aebbaa626ea28eb8b93f2c4ec5d62dba6b [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
Andrew Geissler220dafd2023-10-04 10:18:08 -050012SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/9.0 \
Andrew Geissler517393d2023-01-13 08:55:19 -060013 file://frr.pam \
Andrew Geissler220dafd2023-10-04 10:18:08 -050014 file://0001-tools-make-quiet-actually-suppress-output.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060015 "
16
Andrew Geissler220dafd2023-10-04 10:18:08 -050017SRCREV = "31ed3dd753d62b5d8916998bc32814007e91364b"
Andrew Geissler517393d2023-01-13 08:55:19 -060018
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050019UPSTREAM_CHECK_GITTAGREGEX = "frr-(?P<pver>\d+(\.\d+)+)$"
20
Andrew Geissler3eeda902023-05-19 10:14:02 -050021CVE_PRODUCT = "frrouting"
22
Andrew Geissler517393d2023-01-13 08:55:19 -060023S = "${WORKDIR}/git"
24
Andrew Geissler517393d2023-01-13 08:55:19 -060025inherit autotools-brokensep python3native pkgconfig useradd systemd
26
27DEPENDS:class-native = "bison-native elfutils-native"
Andrew Geissler220dafd2023-10-04 10:18:08 -050028DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native protobuf-c-native protobuf-c"
Andrew Geissler517393d2023-01-13 08:55:19 -060029
30RDEPENDS:${PN}:class-target = "iproute2 python3-core bash"
31
32PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
33PACKAGECONFIG:class-native = ""
34
35PACKAGECONFIG[fpm] = "--enable-fpm,--disable-fpm"
36PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam"
37PACKAGECONFIG[grpc] = "--enable-grpc,--disable-grpc,grpc-native grpc"
38PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
39PACKAGECONFIG[zeromq] = "--enable-zeromq,--disable-zeromq,zeromq"
40PACKAGECONFIG[protobuf] = "--enable-protobuf,--disable-protobuf,protobuf-c-native protobuf-c"
41PACKAGECONFIG[capabilities] = "--enable-capabilities,--disable-capabilities,libcap"
42PACKAGECONFIG[cumulus] = "--enable-cumulus,--disable-cumulus"
43PACKAGECONFIG[datacenter] = "--enable-datacenter,--disable-datacenter"
44PACKAGECONFIG[ospfclient] = "--enable-ospfapi --enable-ospfclient,--disable-ospfapi --disable-ospfclient"
45
46EXTRA_OECONF:class-native = "--enable-clippy-only"
47
48EXTRA_OECONF:class-target = "--sbindir=${libdir}/frr \
49 --sysconfdir=${sysconfdir}/frr \
50 --localstatedir=${localstatedir}/run/frr \
51 --enable-vtysh \
52 --enable-multipath=64 \
53 --enable-user=frr \
54 --enable-group=frr \
55 --enable-vty-group=frrvty \
56 --enable-configfile-mask=0640 \
57 --enable-logfile-mask=0640 \
58 --disable-doc \
59 --with-clippy=${RECIPE_SYSROOT_NATIVE}/usr/lib/clippy \
60 "
61
62CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
63
Andrew Geissler220dafd2023-10-04 10:18:08 -050064# https://github.com/FRRouting/frr/issues/14469
65DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map"
66
Andrew Geissler517393d2023-01-13 08:55:19 -060067LDFLAGS:append:mips = " -latomic"
68LDFLAGS:append:mipsel = " -latomic"
69LDFLAGS:append:powerpc = " -latomic"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050070LDFLAGS:append:riscv32 = " -latomic"
Andrew Geissler517393d2023-01-13 08:55:19 -060071
72SYSTEMD_PACKAGES = "${PN}"
73SYSTEMD_SERVICE:${PN} = "frr.service"
74SYSTEMD_AUTO_ENABLE = "disable"
75
76do_compile:prepend () {
77 sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' \
78 -e 's#${RECIPE_SYSROOT}##g' ${S}/lib/version.h
79}
80
81do_compile:class-native () {
82 oe_runmake clippy-only
83}
84
85do_install:class-native () {
86 install -d ${D}${libdir}
87 install -m 755 ${S}/lib/clippy ${D}${libdir}/clippy
88}
89
90do_install:append:class-target () {
91 install -m 0755 -d ${D}${sysconfdir}/frr
92 install -m 0640 ${S}/tools/etc/frr/* ${D}${sysconfdir}/frr/
93 chown frr:frrvty ${D}${sysconfdir}/frr
94 chown frr:frr ${D}${sysconfdir}/frr/*
95 chown frr:frrvty ${D}${sysconfdir}/frr/vtysh.conf
96 chmod 640 ${D}${sysconfdir}/frr/*
97
98 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
99 install -d ${D}/${sysconfdir}/pam.d
100 install -m 644 ${WORKDIR}/frr.pam ${D}/${sysconfdir}/pam.d/frr
101 fi
102
103 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
104 install -d ${D}${sysconfdir}/init.d
105 install -m 0755 ${B}/tools/frrinit.sh ${D}${sysconfdir}/init.d/frr
106
107 install -d ${D}${sysconfdir}/default/volatiles
108 echo "d frr frr 0755 ${localstatedir}/run/frr none" \
109 > ${D}${sysconfdir}/default/volatiles/99_frr
110 fi
111
112 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
113 install -d ${D}${systemd_system_unitdir}
114 install -m 0644 ${B}/tools/frr*.service ${D}${systemd_system_unitdir}
115
116 install -d ${D}${sysconfdir}/tmpfiles.d
117 echo "d /run/frr 0755 frr frr -" \
118 > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
119 fi
120}
121
122USERADD_PACKAGES = "${PN}"
123GROUPADD_PARAM:${PN} = "--system frr ; --system frrvty"
124USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/frr/ -M -g frr -G frrvty --shell /bin/false frr"
125
126FILES:${PN} += "${datadir}/yang"
127
128BBCLASSEXTEND = "native"