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