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