Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 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" |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 9 | LIC_FILES_CHKSUM = "file://doc/licenses/GPL-2.0;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
| 10 | file://doc/licenses/LGPL-2.1;md5=4fbd65380cdd255951079008b364516c" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 11 | |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 12 | PR = "r1" |
| 13 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 14 | SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/9.1 \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 15 | file://frr.pam \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 16 | " |
| 17 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 18 | SRCREV = "312faf8008bb4f3b9e84b8e2758cd2cbdf5742b5" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 19 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 20 | UPSTREAM_CHECK_GITTAGREGEX = "frr-(?P<pver>\d+(\.\d+)+)$" |
| 21 | |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 22 | CVE_PRODUCT = "frrouting" |
| 23 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 24 | S = "${WORKDIR}/git" |
| 25 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 26 | inherit autotools-brokensep python3native pkgconfig useradd systemd |
| 27 | |
| 28 | DEPENDS:class-native = "bison-native elfutils-native" |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 29 | DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native protobuf-c-native protobuf-c" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 30 | |
| 31 | RDEPENDS:${PN}:class-target = "iproute2 python3-core bash" |
| 32 | |
| 33 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" |
| 34 | PACKAGECONFIG:class-native = "" |
| 35 | |
| 36 | PACKAGECONFIG[fpm] = "--enable-fpm,--disable-fpm" |
| 37 | PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam" |
| 38 | PACKAGECONFIG[grpc] = "--enable-grpc,--disable-grpc,grpc-native grpc" |
| 39 | PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp" |
| 40 | PACKAGECONFIG[zeromq] = "--enable-zeromq,--disable-zeromq,zeromq" |
| 41 | PACKAGECONFIG[protobuf] = "--enable-protobuf,--disable-protobuf,protobuf-c-native protobuf-c" |
| 42 | PACKAGECONFIG[capabilities] = "--enable-capabilities,--disable-capabilities,libcap" |
| 43 | PACKAGECONFIG[cumulus] = "--enable-cumulus,--disable-cumulus" |
| 44 | PACKAGECONFIG[datacenter] = "--enable-datacenter,--disable-datacenter" |
| 45 | PACKAGECONFIG[ospfclient] = "--enable-ospfapi --enable-ospfclient,--disable-ospfapi --disable-ospfclient" |
| 46 | |
| 47 | EXTRA_OECONF:class-native = "--enable-clippy-only" |
| 48 | |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 49 | EXTRA_OECONF:class-target = "--sbindir=${libexecdir}/frr \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 50 | --sysconfdir=${sysconfdir}/frr \ |
| 51 | --localstatedir=${localstatedir}/run/frr \ |
| 52 | --enable-vtysh \ |
| 53 | --enable-multipath=64 \ |
| 54 | --enable-user=frr \ |
| 55 | --enable-group=frr \ |
| 56 | --enable-vty-group=frrvty \ |
| 57 | --enable-configfile-mask=0640 \ |
| 58 | --enable-logfile-mask=0640 \ |
| 59 | --disable-doc \ |
| 60 | --with-clippy=${RECIPE_SYSROOT_NATIVE}/usr/lib/clippy \ |
| 61 | " |
| 62 | |
| 63 | CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" |
| 64 | |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 65 | # https://github.com/FRRouting/frr/issues/14469 |
| 66 | DEBUG_PREFIX_MAP:remove = "-fcanon-prefix-map" |
| 67 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 68 | LDFLAGS:append:mips = " -latomic" |
| 69 | LDFLAGS:append:mipsel = " -latomic" |
| 70 | LDFLAGS:append:powerpc = " -latomic" |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 71 | LDFLAGS:append:riscv32 = " -latomic" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 72 | |
| 73 | SYSTEMD_PACKAGES = "${PN}" |
| 74 | SYSTEMD_SERVICE:${PN} = "frr.service" |
| 75 | SYSTEMD_AUTO_ENABLE = "disable" |
| 76 | |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 77 | inherit update-alternatives multilib_script multilib_header |
| 78 | |
| 79 | ALTERNATIVE_PRIORITY = "100" |
| 80 | ALTERNATIVE:${PN} = " ietf-interfaces " |
| 81 | ALTERNATIVE_LINK_NAME[ietf-interfaces] = "${datadir}/yang/ietf-interfaces.yang" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 82 | do_compile:prepend () { |
| 83 | sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' \ |
| 84 | -e 's#${RECIPE_SYSROOT}##g' ${S}/lib/version.h |
| 85 | } |
| 86 | |
| 87 | do_compile:class-native () { |
| 88 | oe_runmake clippy-only |
| 89 | } |
| 90 | |
| 91 | do_install:class-native () { |
| 92 | install -d ${D}${libdir} |
| 93 | install -m 755 ${S}/lib/clippy ${D}${libdir}/clippy |
| 94 | } |
| 95 | |
| 96 | do_install:append:class-target () { |
| 97 | install -m 0755 -d ${D}${sysconfdir}/frr |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 98 | install -m 0755 -d ${D}${libexecdir}/frr |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 99 | install -m 0640 ${S}/tools/etc/frr/* ${D}${sysconfdir}/frr/ |
| 100 | chown frr:frrvty ${D}${sysconfdir}/frr |
| 101 | chown frr:frr ${D}${sysconfdir}/frr/* |
| 102 | chown frr:frrvty ${D}${sysconfdir}/frr/vtysh.conf |
| 103 | chmod 640 ${D}${sysconfdir}/frr/* |
| 104 | |
| 105 | if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then |
| 106 | install -d ${D}/${sysconfdir}/pam.d |
| 107 | install -m 644 ${WORKDIR}/frr.pam ${D}/${sysconfdir}/pam.d/frr |
| 108 | fi |
| 109 | |
| 110 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 111 | install -d ${D}${sysconfdir}/init.d |
| 112 | install -m 0755 ${B}/tools/frrinit.sh ${D}${sysconfdir}/init.d/frr |
| 113 | |
| 114 | install -d ${D}${sysconfdir}/default/volatiles |
| 115 | echo "d frr frr 0755 ${localstatedir}/run/frr none" \ |
| 116 | > ${D}${sysconfdir}/default/volatiles/99_frr |
| 117 | fi |
| 118 | |
| 119 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 120 | install -d ${D}${systemd_system_unitdir} |
| 121 | install -m 0644 ${B}/tools/frr*.service ${D}${systemd_system_unitdir} |
| 122 | |
| 123 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 124 | echo "d /run/frr 0755 frr frr -" \ |
| 125 | > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf |
| 126 | fi |
Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 127 | oe_multilib_header frr/version.h |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | USERADD_PACKAGES = "${PN}" |
| 131 | GROUPADD_PARAM:${PN} = "--system frr ; --system frrvty" |
| 132 | USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/frr/ -M -g frr -G frrvty --shell /bin/false frr" |
| 133 | |
| 134 | FILES:${PN} += "${datadir}/yang" |
| 135 | |
| 136 | BBCLASSEXTEND = "native" |