blob: 0926f84214d700054a75442ebe64194739cfc085 [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
Patrick Williamsda295312023-12-05 16:48:56 -060014SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/9.1 \
Andrew Geissler517393d2023-01-13 08:55:19 -060015 file://frr.pam \
Andrew Geissler517393d2023-01-13 08:55:19 -060016 "
17
Patrick Williamsda295312023-12-05 16:48:56 -060018SRCREV = "312faf8008bb4f3b9e84b8e2758cd2cbdf5742b5"
Andrew Geissler517393d2023-01-13 08:55:19 -060019
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050020UPSTREAM_CHECK_GITTAGREGEX = "frr-(?P<pver>\d+(\.\d+)+)$"
21
Andrew Geissler3eeda902023-05-19 10:14:02 -050022CVE_PRODUCT = "frrouting"
23
Andrew Geissler517393d2023-01-13 08:55:19 -060024S = "${WORKDIR}/git"
25
Andrew Geissler517393d2023-01-13 08:55:19 -060026inherit autotools-brokensep python3native pkgconfig useradd systemd
27
28DEPENDS:class-native = "bison-native elfutils-native"
Andrew Geissler220dafd2023-10-04 10:18:08 -050029DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native protobuf-c-native protobuf-c"
Andrew Geissler517393d2023-01-13 08:55:19 -060030
31RDEPENDS:${PN}:class-target = "iproute2 python3-core bash"
32
33PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
34PACKAGECONFIG:class-native = ""
35
36PACKAGECONFIG[fpm] = "--enable-fpm,--disable-fpm"
37PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam"
38PACKAGECONFIG[grpc] = "--enable-grpc,--disable-grpc,grpc-native grpc"
39PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
40PACKAGECONFIG[zeromq] = "--enable-zeromq,--disable-zeromq,zeromq"
41PACKAGECONFIG[protobuf] = "--enable-protobuf,--disable-protobuf,protobuf-c-native protobuf-c"
42PACKAGECONFIG[capabilities] = "--enable-capabilities,--disable-capabilities,libcap"
43PACKAGECONFIG[cumulus] = "--enable-cumulus,--disable-cumulus"
44PACKAGECONFIG[datacenter] = "--enable-datacenter,--disable-datacenter"
45PACKAGECONFIG[ospfclient] = "--enable-ospfapi --enable-ospfclient,--disable-ospfapi --disable-ospfclient"
46
47EXTRA_OECONF:class-native = "--enable-clippy-only"
48
Patrick Williams56b44a92024-01-19 08:49:29 -060049EXTRA_OECONF:class-target = "--sbindir=${libexecdir}/frr \
Andrew Geissler517393d2023-01-13 08:55:19 -060050 --sysconfdir=${sysconfdir}/frr \
51 --localstatedir=${localstatedir}/run/frr \
52 --enable-vtysh \
53 --enable-multipath=64 \
54 --enable-user=frr \
55 --enable-group=frr \
56 --enable-vty-group=frrvty \
57 --enable-configfile-mask=0640 \
58 --enable-logfile-mask=0640 \
59 --disable-doc \
60 --with-clippy=${RECIPE_SYSROOT_NATIVE}/usr/lib/clippy \
61 "
62
63CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
64
Andrew Geissler220dafd2023-10-04 10:18:08 -050065# https://github.com/FRRouting/frr/issues/14469
66DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map"
67
Andrew Geissler517393d2023-01-13 08:55:19 -060068LDFLAGS:append:mips = " -latomic"
69LDFLAGS:append:mipsel = " -latomic"
70LDFLAGS:append:powerpc = " -latomic"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050071LDFLAGS:append:riscv32 = " -latomic"
Andrew Geissler517393d2023-01-13 08:55:19 -060072
73SYSTEMD_PACKAGES = "${PN}"
74SYSTEMD_SERVICE:${PN} = "frr.service"
75SYSTEMD_AUTO_ENABLE = "disable"
76
Patrick Williams56b44a92024-01-19 08:49:29 -060077inherit update-alternatives multilib_script multilib_header
78
79ALTERNATIVE_PRIORITY = "100"
80ALTERNATIVE:${PN} = " ietf-interfaces "
81ALTERNATIVE_LINK_NAME[ietf-interfaces] = "${datadir}/yang/ietf-interfaces.yang"
Andrew Geissler517393d2023-01-13 08:55:19 -060082do_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
Patrick Williams56b44a92024-01-19 08:49:29 -060098 install -m 0755 -d ${D}${libexecdir}/frr
Andrew Geissler517393d2023-01-13 08:55:19 -060099 install -m 0640 ${S}/tools/etc/frr/* ${D}${sysconfdir}/frr/
100 chown frr:frrvty ${D}${sysconfdir}/frr
101 chown frr:frr ${D}${sysconfdir}/frr/*
102 chown frr:frrvty ${D}${sysconfdir}/frr/vtysh.conf
103 chmod 640 ${D}${sysconfdir}/frr/*
104
105 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
106 install -d ${D}/${sysconfdir}/pam.d
107 install -m 644 ${WORKDIR}/frr.pam ${D}/${sysconfdir}/pam.d/frr
108 fi
109
110 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
111 install -d ${D}${sysconfdir}/init.d
112 install -m 0755 ${B}/tools/frrinit.sh ${D}${sysconfdir}/init.d/frr
113
114 install -d ${D}${sysconfdir}/default/volatiles
115 echo "d frr frr 0755 ${localstatedir}/run/frr none" \
116 > ${D}${sysconfdir}/default/volatiles/99_frr
117 fi
118
119 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
120 install -d ${D}${systemd_system_unitdir}
121 install -m 0644 ${B}/tools/frr*.service ${D}${systemd_system_unitdir}
122
123 install -d ${D}${sysconfdir}/tmpfiles.d
124 echo "d /run/frr 0755 frr frr -" \
125 > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
126 fi
Patrick Williams56b44a92024-01-19 08:49:29 -0600127 oe_multilib_header frr/version.h
Andrew Geissler517393d2023-01-13 08:55:19 -0600128}
129
130USERADD_PACKAGES = "${PN}"
131GROUPADD_PARAM:${PN} = "--system frr ; --system frrvty"
132USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/frr/ -M -g frr -G frrvty --shell /bin/false frr"
133
134FILES:${PN} += "${datadir}/yang"
135
136BBCLASSEXTEND = "native"