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 | |
| 12 | SRC_URI = "git://github.com/FRRouting/frr.git;protocol=https;branch=stable/8.2 \ |
| 13 | file://frr.pam \ |
| 14 | " |
| 15 | |
| 16 | SRCREV = "79188bf710e92acf42fb5b9b0a2e9593a5ee9b05" |
| 17 | |
| 18 | S = "${WORKDIR}/git" |
| 19 | |
| 20 | # Due to libyang not supported on these arches: |
| 21 | COMPATIBLE_HOST:riscv32 = "null" |
| 22 | COMPATIBLE_HOST:riscv64 = "null" |
| 23 | COMPATIBLE_HOST:armv5 = "null" |
| 24 | |
| 25 | # Fail to build on mips64 with error: |
| 26 | # Error: PC-relative reference to a different section |
| 27 | COMPATIBLE_HOST:mips64 = "null" |
| 28 | |
| 29 | inherit autotools-brokensep python3native pkgconfig useradd systemd |
| 30 | |
| 31 | DEPENDS:class-native = "bison-native elfutils-native" |
| 32 | DEPENDS:class-target = "bison-native json-c readline c-ares libyang frr-native" |
| 33 | |
| 34 | RDEPENDS:${PN}:class-target = "iproute2 python3-core bash" |
| 35 | |
| 36 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" |
| 37 | PACKAGECONFIG:class-native = "" |
| 38 | |
| 39 | PACKAGECONFIG[fpm] = "--enable-fpm,--disable-fpm" |
| 40 | PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam" |
| 41 | PACKAGECONFIG[grpc] = "--enable-grpc,--disable-grpc,grpc-native grpc" |
| 42 | PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp" |
| 43 | PACKAGECONFIG[zeromq] = "--enable-zeromq,--disable-zeromq,zeromq" |
| 44 | PACKAGECONFIG[protobuf] = "--enable-protobuf,--disable-protobuf,protobuf-c-native protobuf-c" |
| 45 | PACKAGECONFIG[capabilities] = "--enable-capabilities,--disable-capabilities,libcap" |
| 46 | PACKAGECONFIG[cumulus] = "--enable-cumulus,--disable-cumulus" |
| 47 | PACKAGECONFIG[datacenter] = "--enable-datacenter,--disable-datacenter" |
| 48 | PACKAGECONFIG[ospfclient] = "--enable-ospfapi --enable-ospfclient,--disable-ospfapi --disable-ospfclient" |
| 49 | |
| 50 | EXTRA_OECONF:class-native = "--enable-clippy-only" |
| 51 | |
| 52 | EXTRA_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 | |
| 66 | CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" |
| 67 | |
| 68 | LDFLAGS:append:mips = " -latomic" |
| 69 | LDFLAGS:append:mipsel = " -latomic" |
| 70 | LDFLAGS:append:powerpc = " -latomic" |
| 71 | |
| 72 | SYSTEMD_PACKAGES = "${PN}" |
| 73 | SYSTEMD_SERVICE:${PN} = "frr.service" |
| 74 | SYSTEMD_AUTO_ENABLE = "disable" |
| 75 | |
| 76 | do_compile:class-native () { |
| 77 | oe_runmake clippy-only |
| 78 | } |
| 79 | |
| 80 | do_install:class-native () { |
| 81 | install -d ${D}${libdir} |
| 82 | install -m 755 ${S}/lib/clippy ${D}${libdir}/clippy |
| 83 | } |
| 84 | |
| 85 | do_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 | |
| 117 | USERADD_PACKAGES = "${PN}" |
| 118 | GROUPADD_PARAM:${PN} = "--system frr ; --system frrvty" |
| 119 | USERADD_PARAM:${PN} = "--system --home ${localstatedir}/run/frr/ -M -g frr -G frrvty --shell /bin/false frr" |
| 120 | |
| 121 | FILES:${PN} += "${datadir}/yang" |
| 122 | |
| 123 | BBCLASSEXTEND = "native" |