diff options
Diffstat (limited to 'meta-networking/recipes-protocols/frr/frr_10.3.bb')
-rw-r--r-- | meta-networking/recipes-protocols/frr/frr_10.3.bb | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/frr/frr_10.3.bb b/meta-networking/recipes-protocols/frr/frr_10.3.bb new file mode 100644 index 0000000000..f0f3f34ab3 --- /dev/null +++ b/meta-networking/recipes-protocols/frr/frr_10.3.bb | |||
@@ -0,0 +1,137 @@ | |||
1 | SUMMARY = "BGP/OSPF/RIP routing daemon" | ||
2 | DESCRIPTION = "FRRouting is a free and open source Internet routing protocol suite for Linux \ | ||
3 | and Unix platforms. It implements BGP, OSPF, RIP, IS-IS, PIM, LDP, BFD, Babel, PBR, OpenFabric \ | ||
4 | and VRRP, with alpha support for EIGRP and NHRP." | ||
5 | HOMEPAGE = "https://frrouting.org/" | ||
6 | SECTION = "net" | ||
7 | |||
8 | LICENSE = "GPL-2.0-only & LGPL-2.1-only" | ||
9 | LIC_FILES_CHKSUM = "file://doc/licenses/GPL-2.0;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
10 | file://doc/licenses/LGPL-2.1;md5=4fbd65380cdd255951079008b364516c" | ||
11 | |||
12 | |||
13 | SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/10.3 \ | ||
14 | file://frr.pam \ | ||
15 | " | ||
16 | |||
17 | SRCREV = "85cf1ed576deed121751e16a64970f8a652a9e1e" | ||
18 | |||
19 | UPSTREAM_CHECK_GITTAGREGEX = "frr-(?P<pver>\d+(\.\d+)+)$" | ||
20 | |||
21 | CVE_PRODUCT = "frrouting" | ||
22 | |||
23 | |||
24 | inherit autotools-brokensep python3native pkgconfig useradd systemd | ||
25 | |||
26 | DEPENDS:class-native = "bison-native elfutils-native" | ||
27 | DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native protobuf-c-native protobuf-c" | ||
28 | |||
29 | RDEPENDS:${PN}:class-target = "iproute2 python3-core bash" | ||
30 | |||
31 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" | ||
32 | PACKAGECONFIG:class-native = "" | ||
33 | |||
34 | PACKAGECONFIG[fpm] = "--enable-fpm,--disable-fpm" | ||
35 | PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam" | ||
36 | PACKAGECONFIG[grpc] = "--enable-grpc,--disable-grpc,grpc-native grpc" | ||
37 | PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp" | ||
38 | PACKAGECONFIG[zeromq] = "--enable-zeromq,--disable-zeromq,zeromq" | ||
39 | PACKAGECONFIG[protobuf] = "--enable-protobuf,--disable-protobuf,protobuf-c-native protobuf-c" | ||
40 | PACKAGECONFIG[capabilities] = "--enable-capabilities,--disable-capabilities,libcap" | ||
41 | PACKAGECONFIG[cumulus] = "--enable-cumulus,--disable-cumulus" | ||
42 | PACKAGECONFIG[datacenter] = "--enable-datacenter,--disable-datacenter" | ||
43 | PACKAGECONFIG[ospfclient] = "--enable-ospfapi --enable-ospfclient,--disable-ospfapi --disable-ospfclient" | ||
44 | |||
45 | EXTRA_OECONF:class-native = "--enable-clippy-only" | ||
46 | |||
47 | EXTRA_OECONF:class-target = "--sbindir=${libexecdir}/frr \ | ||
48 | --sysconfdir=${sysconfdir}/frr \ | ||
49 | --localstatedir=${localstatedir}/run/frr \ | ||
50 | --enable-vtysh \ | ||
51 | --enable-multipath=64 \ | ||
52 | --enable-user=frr \ | ||
53 | --enable-group=frr \ | ||
54 | --enable-vty-group=frrvty \ | ||
55 | --enable-configfile-mask=0640 \ | ||
56 | --enable-logfile-mask=0640 \ | ||
57 | --disable-doc \ | ||
58 | --with-clippy=${RECIPE_SYSROOT_NATIVE}/usr/lib/clippy \ | ||
59 | " | ||
60 | |||
61 | CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" | ||
62 | |||
63 | # https://github.com/FRRouting/frr/issues/14469 | ||
64 | DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map" | ||
65 | |||
66 | LDFLAGS:append:mips = " -latomic" | ||
67 | LDFLAGS:append:mipsel = " -latomic" | ||
68 | LDFLAGS:append:powerpc = " -latomic" | ||
69 | LDFLAGS:append:riscv32 = " -latomic" | ||
70 | |||
71 | SYSTEMD_PACKAGES = "${PN}" | ||
72 | SYSTEMD_SERVICE:${PN} = "frr.service" | ||
73 | SYSTEMD_AUTO_ENABLE = "disable" | ||
74 | |||
75 | inherit update-alternatives multilib_script multilib_header | ||
76 | |||
77 | ALTERNATIVE_PRIORITY = "100" | ||
78 | ALTERNATIVE:${PN} = " ietf-interfaces ietf-netconf-acm ietf-netconf-with-defaults ietf-netconf" | ||
79 | ALTERNATIVE_LINK_NAME[ietf-interfaces] = "${datadir}/yang/ietf-interfaces.yang" | ||
80 | ALTERNATIVE_LINK_NAME[ietf-netconf-acm] = "${datadir}/yang/ietf-netconf-acm.yang" | ||
81 | ALTERNATIVE_LINK_NAME[ietf-netconf-with-defaults] = "${datadir}/yang/ietf-netconf-with-defaults.yang" | ||
82 | ALTERNATIVE_LINK_NAME[ietf-netconf] = "${datadir}/yang/ietf-netconf.yang" | ||
83 | do_compile:prepend () { | ||
84 | sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' \ | ||
85 | -e 's#${RECIPE_SYSROOT}##g' ${S}/lib/version.h | ||
86 | } | ||
87 | |||
88 | do_compile:class-native () { | ||
89 | oe_runmake clippy-only | ||
90 | } | ||
91 | |||
92 | do_install:class-native () { | ||
93 | install -d ${D}${libdir} | ||
94 | install -m 755 ${S}/lib/clippy ${D}${libdir}/clippy | ||
95 | } | ||
96 | |||
97 | do_install:append:class-target () { | ||
98 | install -m 0755 -d ${D}${sysconfdir}/frr | ||
99 | install -m 0755 -d ${D}${libexecdir}/frr | ||
100 | install -m 0640 ${S}/tools/etc/frr/* ${D}${sysconfdir}/frr/ | ||
101 | chown frr:frrvty ${D}${sysconfdir}/frr | ||
102 | chown frr:frr ${D}${sysconfdir}/frr/* | ||
103 | chown frr:frrvty ${D}${sysconfdir}/frr/vtysh.conf | ||
104 | chmod 640 ${D}${sysconfdir}/frr/* | ||
105 | |||
106 | if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then | ||
107 | install -d ${D}/${sysconfdir}/pam.d | ||
108 | install -m 644 ${UNPACKDIR}/frr.pam ${D}/${sysconfdir}/pam.d/frr | ||
109 | fi | ||
110 | |||
111 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
112 | install -d ${D}${sysconfdir}/init.d | ||
113 | install -m 0755 ${B}/tools/frrinit.sh ${D}${sysconfdir}/init.d/frr | ||
114 | |||
115 | install -d ${D}${sysconfdir}/default/volatiles | ||
116 | echo "d frr frr 0755 ${localstatedir}/run/frr none" \ | ||
117 | > ${D}${sysconfdir}/default/volatiles/99_frr | ||
118 | fi | ||
119 | |||
120 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
121 | install -d ${D}${systemd_system_unitdir} | ||
122 | install -m 0644 ${B}/tools/frr*.service ${D}${systemd_system_unitdir} | ||
123 | |||
124 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
125 | echo "d /run/frr 0755 frr frr -" \ | ||
126 | > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf | ||
127 | fi | ||
128 | oe_multilib_header frr/version.h | ||
129 | } | ||
130 | |||
131 | USERADD_PACKAGES = "${PN}" | ||
132 | GROUPADD_PARAM:${PN} = "--system frr ; --system frrvty" | ||
133 | USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/frr/ -M -g frr -G frrvty --shell /bin/false frr" | ||
134 | |||
135 | FILES:${PN} += "${datadir}/yang" | ||
136 | |||
137 | BBCLASSEXTEND = "native" | ||