blob: 966926094547cf8fb4cbcaec7718ee658bc11c41 [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"
9LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
10 file://COPYING-LGPLv2.1;md5=4fbd65380cdd255951079008b364516c"
11
12SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/8.4 \
13 file://frr.pam \
14 file://0001-m4-ax_python.m4-check-for-python-x.y-emded.pc-not-py.patch \
15 "
16
Patrick Williams864cc432023-02-09 14:54:44 -060017SRCREV = "62ac43de9f3bc470586cf4f51fadf013bf542b32"
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"
28DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native"
29
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
64LDFLAGS:append:mips = " -latomic"
65LDFLAGS:append:mipsel = " -latomic"
66LDFLAGS:append:powerpc = " -latomic"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050067LDFLAGS:append:riscv32 = " -latomic"
Andrew Geissler517393d2023-01-13 08:55:19 -060068
69SYSTEMD_PACKAGES = "${PN}"
70SYSTEMD_SERVICE:${PN} = "frr.service"
71SYSTEMD_AUTO_ENABLE = "disable"
72
73do_compile:prepend () {
74 sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' \
75 -e 's#${RECIPE_SYSROOT}##g' ${S}/lib/version.h
76}
77
78do_compile:class-native () {
79 oe_runmake clippy-only
80}
81
82do_install:class-native () {
83 install -d ${D}${libdir}
84 install -m 755 ${S}/lib/clippy ${D}${libdir}/clippy
85}
86
87do_install:append:class-target () {
88 install -m 0755 -d ${D}${sysconfdir}/frr
89 install -m 0640 ${S}/tools/etc/frr/* ${D}${sysconfdir}/frr/
90 chown frr:frrvty ${D}${sysconfdir}/frr
91 chown frr:frr ${D}${sysconfdir}/frr/*
92 chown frr:frrvty ${D}${sysconfdir}/frr/vtysh.conf
93 chmod 640 ${D}${sysconfdir}/frr/*
94
95 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
96 install -d ${D}/${sysconfdir}/pam.d
97 install -m 644 ${WORKDIR}/frr.pam ${D}/${sysconfdir}/pam.d/frr
98 fi
99
100 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
101 install -d ${D}${sysconfdir}/init.d
102 install -m 0755 ${B}/tools/frrinit.sh ${D}${sysconfdir}/init.d/frr
103
104 install -d ${D}${sysconfdir}/default/volatiles
105 echo "d frr frr 0755 ${localstatedir}/run/frr none" \
106 > ${D}${sysconfdir}/default/volatiles/99_frr
107 fi
108
109 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
110 install -d ${D}${systemd_system_unitdir}
111 install -m 0644 ${B}/tools/frr*.service ${D}${systemd_system_unitdir}
112
113 install -d ${D}${sysconfdir}/tmpfiles.d
114 echo "d /run/frr 0755 frr frr -" \
115 > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
116 fi
117}
118
119USERADD_PACKAGES = "${PN}"
120GROUPADD_PARAM:${PN} = "--system frr ; --system frrvty"
121USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/frr/ -M -g frr -G frrvty --shell /bin/false frr"
122
123FILES:${PN} += "${datadir}/yang"
124
125BBCLASSEXTEND = "native"