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