blob: d01d895a80067f306599f405d1102527555a4236 [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 Geissler517393d2023-01-13 08:55:19 -060021S = "${WORKDIR}/git"
22
Andrew Geissler517393d2023-01-13 08:55:19 -060023inherit autotools-brokensep python3native pkgconfig useradd systemd
24
25DEPENDS:class-native = "bison-native elfutils-native"
26DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native"
27
28RDEPENDS:${PN}:class-target = "iproute2 python3-core bash"
29
30PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
31PACKAGECONFIG:class-native = ""
32
33PACKAGECONFIG[fpm] = "--enable-fpm,--disable-fpm"
34PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam"
35PACKAGECONFIG[grpc] = "--enable-grpc,--disable-grpc,grpc-native grpc"
36PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
37PACKAGECONFIG[zeromq] = "--enable-zeromq,--disable-zeromq,zeromq"
38PACKAGECONFIG[protobuf] = "--enable-protobuf,--disable-protobuf,protobuf-c-native protobuf-c"
39PACKAGECONFIG[capabilities] = "--enable-capabilities,--disable-capabilities,libcap"
40PACKAGECONFIG[cumulus] = "--enable-cumulus,--disable-cumulus"
41PACKAGECONFIG[datacenter] = "--enable-datacenter,--disable-datacenter"
42PACKAGECONFIG[ospfclient] = "--enable-ospfapi --enable-ospfclient,--disable-ospfapi --disable-ospfclient"
43
44EXTRA_OECONF:class-native = "--enable-clippy-only"
45
46EXTRA_OECONF:class-target = "--sbindir=${libdir}/frr \
47 --sysconfdir=${sysconfdir}/frr \
48 --localstatedir=${localstatedir}/run/frr \
49 --enable-vtysh \
50 --enable-multipath=64 \
51 --enable-user=frr \
52 --enable-group=frr \
53 --enable-vty-group=frrvty \
54 --enable-configfile-mask=0640 \
55 --enable-logfile-mask=0640 \
56 --disable-doc \
57 --with-clippy=${RECIPE_SYSROOT_NATIVE}/usr/lib/clippy \
58 "
59
60CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
61
62LDFLAGS:append:mips = " -latomic"
63LDFLAGS:append:mipsel = " -latomic"
64LDFLAGS:append:powerpc = " -latomic"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050065LDFLAGS:append:riscv32 = " -latomic"
Andrew Geissler517393d2023-01-13 08:55:19 -060066
67SYSTEMD_PACKAGES = "${PN}"
68SYSTEMD_SERVICE:${PN} = "frr.service"
69SYSTEMD_AUTO_ENABLE = "disable"
70
71do_compile:prepend () {
72 sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' \
73 -e 's#${RECIPE_SYSROOT}##g' ${S}/lib/version.h
74}
75
76do_compile:class-native () {
77 oe_runmake clippy-only
78}
79
80do_install:class-native () {
81 install -d ${D}${libdir}
82 install -m 755 ${S}/lib/clippy ${D}${libdir}/clippy
83}
84
85do_install:append:class-target () {
86 install -m 0755 -d ${D}${sysconfdir}/frr
87 install -m 0640 ${S}/tools/etc/frr/* ${D}${sysconfdir}/frr/
88 chown frr:frrvty ${D}${sysconfdir}/frr
89 chown frr:frr ${D}${sysconfdir}/frr/*
90 chown frr:frrvty ${D}${sysconfdir}/frr/vtysh.conf
91 chmod 640 ${D}${sysconfdir}/frr/*
92
93 if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
94 install -d ${D}/${sysconfdir}/pam.d
95 install -m 644 ${WORKDIR}/frr.pam ${D}/${sysconfdir}/pam.d/frr
96 fi
97
98 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
99 install -d ${D}${sysconfdir}/init.d
100 install -m 0755 ${B}/tools/frrinit.sh ${D}${sysconfdir}/init.d/frr
101
102 install -d ${D}${sysconfdir}/default/volatiles
103 echo "d frr frr 0755 ${localstatedir}/run/frr none" \
104 > ${D}${sysconfdir}/default/volatiles/99_frr
105 fi
106
107 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
108 install -d ${D}${systemd_system_unitdir}
109 install -m 0644 ${B}/tools/frr*.service ${D}${systemd_system_unitdir}
110
111 install -d ${D}${sysconfdir}/tmpfiles.d
112 echo "d /run/frr 0755 frr frr -" \
113 > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
114 fi
115}
116
117USERADD_PACKAGES = "${PN}"
118GROUPADD_PARAM:${PN} = "--system frr ; --system frrvty"
119USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/frr/ -M -g frr -G frrvty --shell /bin/false frr"
120
121FILES:${PN} += "${datadir}/yang"
122
123BBCLASSEXTEND = "native"