blob: c69720e6f02e274e3b8ca7fd9b4308673f244d64 [file] [log] [blame]
Patrick Williams03907ee2022-05-01 06:28:52 -05001SUMMARY = "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
Patrick Williams8dd68482022-10-04 07:57:18 -050012SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/8.3 \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050013 file://0001-configure-Check-for-readline-function-instead-of-mai.patch \
Patrick Williams8dd68482022-10-04 07:57:18 -050014 file://0001-ospfd-Adding-SUPPORT_OSPF_API-define-in-ospf_spf.c.patch \
15 file://0001-bgpd-avoid-notify-race-between-io-and-main-pthreads.patch \
Patrick Williams03907ee2022-05-01 06:28:52 -050016 file://frr.pam \
17 "
18
Patrick Williams8dd68482022-10-04 07:57:18 -050019SRCREV = "a74f7a9ad9623e6f9654fe4a7177e5da0b194828"
Patrick Williams03907ee2022-05-01 06:28:52 -050020
21S = "${WORKDIR}/git"
22
23# Due to libyang not supported on these arches:
24COMPATIBLE_HOST:riscv32 = "null"
25COMPATIBLE_HOST:riscv64 = "null"
26COMPATIBLE_HOST:armv5 = "null"
27
28# Fail to build on mips64 with error:
29# Error: PC-relative reference to a different section
30COMPATIBLE_HOST:mips64 = "null"
31
32inherit autotools-brokensep python3native pkgconfig useradd systemd
33
34DEPENDS:class-native = "bison-native elfutils-native"
35DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native"
36
37RDEPENDS:${PN}:class-target = "iproute2 python3-core bash"
38
39PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
40PACKAGECONFIG:class-native = ""
41
42PACKAGECONFIG[fpm] = "--enable-fpm,--disable-fpm"
43PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam"
44PACKAGECONFIG[grpc] = "--enable-grpc,--disable-grpc,grpc-native grpc"
45PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
46PACKAGECONFIG[zeromq] = "--enable-zeromq,--disable-zeromq,zeromq"
47PACKAGECONFIG[protobuf] = "--enable-protobuf,--disable-protobuf,protobuf-c-native protobuf-c"
48PACKAGECONFIG[capabilities] = "--enable-capabilities,--disable-capabilities,libcap"
49PACKAGECONFIG[cumulus] = "--enable-cumulus,--disable-cumulus"
50PACKAGECONFIG[datacenter] = "--enable-datacenter,--disable-datacenter"
51PACKAGECONFIG[ospfclient] = "--enable-ospfapi --enable-ospfclient,--disable-ospfapi --disable-ospfclient"
52
53EXTRA_OECONF:class-native = "--enable-clippy-only"
54
55EXTRA_OECONF:class-target = "--sbindir=${libdir}/frr \
56 --sysconfdir=${sysconfdir}/frr \
57 --localstatedir=${localstatedir}/run/frr \
58 --enable-vtysh \
59 --enable-multipath=64 \
60 --enable-user=frr \
61 --enable-group=frr \
62 --enable-vty-group=frrvty \
63 --enable-configfile-mask=0640 \
64 --enable-logfile-mask=0640 \
65 --disable-doc \
66 --with-clippy=${RECIPE_SYSROOT_NATIVE}/usr/lib/clippy \
67 "
68
69CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
70
71LDFLAGS:append:mips = " -latomic"
72LDFLAGS:append:mipsel = " -latomic"
73LDFLAGS:append:powerpc = " -latomic"
74
75SYSTEMD_PACKAGES = "${PN}"
76SYSTEMD_SERVICE:${PN} = "frr.service"
77SYSTEMD_AUTO_ENABLE = "disable"
78
Patrick Williams92b42cb2022-09-03 06:53:57 -050079do_compile:prepend () {
80 sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' \
81 -e 's#${RECIPE_SYSROOT}##g' ${S}/lib/version.h
82}
83
Patrick Williams03907ee2022-05-01 06:28:52 -050084do_compile:class-native () {
85 oe_runmake clippy-only
86}
87
88do_install:class-native () {
89 install -d ${D}${libdir}
90 install -m 755 ${S}/lib/clippy ${D}${libdir}/clippy
91}
92
93do_install:append:class-target () {
94 install -m 0755 -d ${D}${sysconfdir}/frr
95 install -m 0640 ${S}/tools/etc/frr/* ${D}${sysconfdir}/frr/
96 chown frr:frrvty ${D}${sysconfdir}/frr
97 chown frr:frr ${D}${sysconfdir}/frr/*
98 chown frr:frrvty ${D}${sysconfdir}/frr/vtysh.conf
99 chmod 640 ${D}${sysconfdir}/frr/*
100
101 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
102 install -d ${D}/${sysconfdir}/pam.d
103 install -m 644 ${WORKDIR}/frr.pam ${D}/${sysconfdir}/pam.d/frr
104 fi
105
106 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
107 install -d ${D}${sysconfdir}/init.d
108 install -m 0755 ${B}/tools/frrinit.sh ${D}${sysconfdir}/init.d/frr
109
110 install -d ${D}${sysconfdir}/default/volatiles
111 echo "d frr frr 0755 ${localstatedir}/run/frr none" \
112 > ${D}${sysconfdir}/default/volatiles/99_frr
113 fi
114
115 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
116 install -d ${D}${systemd_system_unitdir}
117 install -m 0644 ${B}/tools/frr*.service ${D}${systemd_system_unitdir}
118
119 install -d ${D}${sysconfdir}/tmpfiles.d
120 echo "d /run/frr 0755 frr frr -" \
121 > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
122 fi
123}
124
125USERADD_PACKAGES = "${PN}"
126GROUPADD_PARAM:${PN} = "--system frr ; --system frrvty"
127USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/frr/ -M -g frr -G frrvty --shell /bin/false frr"
128
129FILES:${PN} += "${datadir}/yang"
130
131BBCLASSEXTEND = "native"