Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [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" |
| 9 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
| 10 | file://COPYING-LGPLv2.1;md5=4fbd65380cdd255951079008b364516c" |
| 11 | |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame^] | 12 | SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/8.3 \ |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 13 | file://0001-configure-Check-for-readline-function-instead-of-mai.patch \ |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame^] | 14 | file://0001-ospfd-Adding-SUPPORT_OSPF_API-define-in-ospf_spf.c.patch \ |
| 15 | file://0001-bgpd-avoid-notify-race-between-io-and-main-pthreads.patch \ |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 16 | file://frr.pam \ |
| 17 | " |
| 18 | |
Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame^] | 19 | SRCREV = "a74f7a9ad9623e6f9654fe4a7177e5da0b194828" |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
| 23 | # Due to libyang not supported on these arches: |
| 24 | COMPATIBLE_HOST:riscv32 = "null" |
| 25 | COMPATIBLE_HOST:riscv64 = "null" |
| 26 | COMPATIBLE_HOST:armv5 = "null" |
| 27 | |
| 28 | # Fail to build on mips64 with error: |
| 29 | # Error: PC-relative reference to a different section |
| 30 | COMPATIBLE_HOST:mips64 = "null" |
| 31 | |
| 32 | inherit autotools-brokensep python3native pkgconfig useradd systemd |
| 33 | |
| 34 | DEPENDS:class-native = "bison-native elfutils-native" |
| 35 | DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native" |
| 36 | |
| 37 | RDEPENDS:${PN}:class-target = "iproute2 python3-core bash" |
| 38 | |
| 39 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" |
| 40 | PACKAGECONFIG:class-native = "" |
| 41 | |
| 42 | PACKAGECONFIG[fpm] = "--enable-fpm,--disable-fpm" |
| 43 | PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam" |
| 44 | PACKAGECONFIG[grpc] = "--enable-grpc,--disable-grpc,grpc-native grpc" |
| 45 | PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp" |
| 46 | PACKAGECONFIG[zeromq] = "--enable-zeromq,--disable-zeromq,zeromq" |
| 47 | PACKAGECONFIG[protobuf] = "--enable-protobuf,--disable-protobuf,protobuf-c-native protobuf-c" |
| 48 | PACKAGECONFIG[capabilities] = "--enable-capabilities,--disable-capabilities,libcap" |
| 49 | PACKAGECONFIG[cumulus] = "--enable-cumulus,--disable-cumulus" |
| 50 | PACKAGECONFIG[datacenter] = "--enable-datacenter,--disable-datacenter" |
| 51 | PACKAGECONFIG[ospfclient] = "--enable-ospfapi --enable-ospfclient,--disable-ospfapi --disable-ospfclient" |
| 52 | |
| 53 | EXTRA_OECONF:class-native = "--enable-clippy-only" |
| 54 | |
| 55 | EXTRA_OECONF:class-target = "--sbindir=${libdir}/frr \ |
| 56 | --sysconfdir=${sysconfdir}/frr \ |
| 57 | --localstatedir=${localstatedir}/run/frr \ |
| 58 | --enable-vtysh \ |
| 59 | --enable-multipath=64 \ |
| 60 | --enable-user=frr \ |
| 61 | --enable-group=frr \ |
| 62 | --enable-vty-group=frrvty \ |
| 63 | --enable-configfile-mask=0640 \ |
| 64 | --enable-logfile-mask=0640 \ |
| 65 | --disable-doc \ |
| 66 | --with-clippy=${RECIPE_SYSROOT_NATIVE}/usr/lib/clippy \ |
| 67 | " |
| 68 | |
| 69 | CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" |
| 70 | |
| 71 | LDFLAGS:append:mips = " -latomic" |
| 72 | LDFLAGS:append:mipsel = " -latomic" |
| 73 | LDFLAGS:append:powerpc = " -latomic" |
| 74 | |
| 75 | SYSTEMD_PACKAGES = "${PN}" |
| 76 | SYSTEMD_SERVICE:${PN} = "frr.service" |
| 77 | SYSTEMD_AUTO_ENABLE = "disable" |
| 78 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 79 | do_compile:prepend () { |
| 80 | sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' \ |
| 81 | -e 's#${RECIPE_SYSROOT}##g' ${S}/lib/version.h |
| 82 | } |
| 83 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 84 | do_compile:class-native () { |
| 85 | oe_runmake clippy-only |
| 86 | } |
| 87 | |
| 88 | do_install:class-native () { |
| 89 | install -d ${D}${libdir} |
| 90 | install -m 755 ${S}/lib/clippy ${D}${libdir}/clippy |
| 91 | } |
| 92 | |
| 93 | do_install:append:class-target () { |
| 94 | install -m 0755 -d ${D}${sysconfdir}/frr |
| 95 | install -m 0640 ${S}/tools/etc/frr/* ${D}${sysconfdir}/frr/ |
| 96 | chown frr:frrvty ${D}${sysconfdir}/frr |
| 97 | chown frr:frr ${D}${sysconfdir}/frr/* |
| 98 | chown frr:frrvty ${D}${sysconfdir}/frr/vtysh.conf |
| 99 | chmod 640 ${D}${sysconfdir}/frr/* |
| 100 | |
| 101 | if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then |
| 102 | install -d ${D}/${sysconfdir}/pam.d |
| 103 | install -m 644 ${WORKDIR}/frr.pam ${D}/${sysconfdir}/pam.d/frr |
| 104 | fi |
| 105 | |
| 106 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 107 | install -d ${D}${sysconfdir}/init.d |
| 108 | install -m 0755 ${B}/tools/frrinit.sh ${D}${sysconfdir}/init.d/frr |
| 109 | |
| 110 | install -d ${D}${sysconfdir}/default/volatiles |
| 111 | echo "d frr frr 0755 ${localstatedir}/run/frr none" \ |
| 112 | > ${D}${sysconfdir}/default/volatiles/99_frr |
| 113 | fi |
| 114 | |
| 115 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 116 | install -d ${D}${systemd_system_unitdir} |
| 117 | install -m 0644 ${B}/tools/frr*.service ${D}${systemd_system_unitdir} |
| 118 | |
| 119 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 120 | echo "d /run/frr 0755 frr frr -" \ |
| 121 | > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf |
| 122 | fi |
| 123 | } |
| 124 | |
| 125 | USERADD_PACKAGES = "${PN}" |
| 126 | GROUPADD_PARAM:${PN} = "--system frr ; --system frrvty" |
| 127 | USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/frr/ -M -g frr -G frrvty --shell /bin/false frr" |
| 128 | |
| 129 | FILES:${PN} += "${datadir}/yang" |
| 130 | |
| 131 | BBCLASSEXTEND = "native" |