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