blob: 05195a3f65d8bcbaa993a84023e776c2aec2cfd1 [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
12SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/8.2 \
13 file://frr.pam \
14 "
15
16SRCREV = "79188bf710e92acf42fb5b9b0a2e9593a5ee9b05"
17
18S = "${WORKDIR}/git"
19
20# Due to libyang not supported on these arches:
21COMPATIBLE_HOST:riscv32 = "null"
22COMPATIBLE_HOST:riscv64 = "null"
23COMPATIBLE_HOST:armv5 = "null"
24
25# Fail to build on mips64 with error:
26# Error: PC-relative reference to a different section
27COMPATIBLE_HOST:mips64 = "null"
28
29inherit autotools-brokensep python3native pkgconfig useradd systemd
30
31DEPENDS:class-native = "bison-native elfutils-native"
32DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native"
33
34RDEPENDS:${PN}:class-target = "iproute2 python3-core bash"
35
36PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
37PACKAGECONFIG:class-native = ""
38
39PACKAGECONFIG[fpm] = "--enable-fpm,--disable-fpm"
40PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam"
41PACKAGECONFIG[grpc] = "--enable-grpc,--disable-grpc,grpc-native grpc"
42PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
43PACKAGECONFIG[zeromq] = "--enable-zeromq,--disable-zeromq,zeromq"
44PACKAGECONFIG[protobuf] = "--enable-protobuf,--disable-protobuf,protobuf-c-native protobuf-c"
45PACKAGECONFIG[capabilities] = "--enable-capabilities,--disable-capabilities,libcap"
46PACKAGECONFIG[cumulus] = "--enable-cumulus,--disable-cumulus"
47PACKAGECONFIG[datacenter] = "--enable-datacenter,--disable-datacenter"
48PACKAGECONFIG[ospfclient] = "--enable-ospfapi --enable-ospfclient,--disable-ospfapi --disable-ospfclient"
49
50EXTRA_OECONF:class-native = "--enable-clippy-only"
51
52EXTRA_OECONF:class-target = "--sbindir=${libdir}/frr \
53 --sysconfdir=${sysconfdir}/frr \
54 --localstatedir=${localstatedir}/run/frr \
55 --enable-vtysh \
56 --enable-multipath=64 \
57 --enable-user=frr \
58 --enable-group=frr \
59 --enable-vty-group=frrvty \
60 --enable-configfile-mask=0640 \
61 --enable-logfile-mask=0640 \
62 --disable-doc \
63 --with-clippy=${RECIPE_SYSROOT_NATIVE}/usr/lib/clippy \
64 "
65
66CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
67
68LDFLAGS:append:mips = " -latomic"
69LDFLAGS:append:mipsel = " -latomic"
70LDFLAGS:append:powerpc = " -latomic"
71
72SYSTEMD_PACKAGES = "${PN}"
73SYSTEMD_SERVICE:${PN} = "frr.service"
74SYSTEMD_AUTO_ENABLE = "disable"
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"