2 # Copyright (C) 2019 Wind River Systems, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 SUMMARY = "A 802.1ab implementation (LLDP) to help you locate neighbors of all your equipments"
19 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d"
21 DEPENDS = "libbsd libevent json-c"
26 SRCREV = "0bf4b546df8c7fdec8cfc6cb6f71b9609ee54306"
29 http://media.luffy.cx/files/${BPN}/${BPN}-${PV}.tar.gz \
30 git://opendev.org/starlingx/${SRCNAME}.git;protocol=${PROTOCOL};rev=${SRCREV};branch=${BRANCH};destsuffix=stx-patches;subpath=networking/lldpd \
33 SRC_URI[md5sum] = "ed0226129b0c90b3a45c273fe1aba8de"
34 SRC_URI[sha256sum] = "300e4a590f7bf21c79d5ff94c2d6a69d0b2c34dbc21e17281496462a04ca80bc"
37 bb.build.exec_func('stx_do_patch', d)
42 patch -p1 < ${WORKDIR}/stx-patches/lldpd-0.9.0/lldpd-interface-show.patch
43 patch -p1 < ${WORKDIR}/stx-patches/centos/files/lldpd-create-run-dir.patch
44 patch -p1 < ${WORKDIR}/stx-patches/centos/files/lldpd-i40e-disable.patch
45 patch -p1 < ${WORKDIR}/stx-patches/centos/files/lldpd-clear-station.patch
48 SOURCE1 = "${WORKDIR}/stx-patches/lldpd-0.9.0/lldpd.init"
49 SOURCE2 = "${WORKDIR}/stx-patches/lldpd-0.9.0/lldpd.default"
50 SOURCE3 = "${WORKDIR}/stx-patches/centos/files/i40e-lldp-configure.sh"
52 DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit"
54 inherit autotools update-rc.d useradd systemd pkgconfig bash-completion
56 USERADD_PACKAGES = "${PN}"
57 USERADD_PARAM_${PN} = "--system -g lldpd --shell /bin/false lldpd"
58 GROUPADD_PARAM_${PN} = "--system lldpd"
60 EXTRA_OECONF += "--without-embedded-libevent \
62 --with-privsep-user=lldpd \
63 --with-privsep-group=lldpd \
64 --with-systemdsystemunitdir=${systemd_system_unitdir} \
65 --without-sysusersdir \
68 PACKAGECONFIG ??= "cdp fdp edp sonmp lldpmed dot1 dot3"
69 PACKAGECONFIG[xml] = "--with-xml,--without-xml,libxm2"
70 PACKAGECONFIG[snmp] = "--with-snmp,--without-snmp,net-snmp"
71 PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
72 PACKAGECONFIG[seccomp] = "--with-seccomp,--without-seccomp,libseccomp"
73 PACKAGECONFIG[cdp] = "--enable-cdp,--disable-cdp"
74 PACKAGECONFIG[fdp] = "--enable-fdp,--disable-fdp"
75 PACKAGECONFIG[edp] = "--enable-edp,--disable-edp"
76 PACKAGECONFIG[sonmp] = "--enable-sonmp,--disable-sonmp"
77 PACKAGECONFIG[lldpmed] = "--enable-lldpmed,--disable-lldpmed"
78 PACKAGECONFIG[dot1] = "--enable-dot1,--disable-dot1"
79 PACKAGECONFIG[dot3] = "--enable-dot3,--disable-dot3"
80 PACKAGECONFIG[custom] = "--enable-custom,--disable-custom"
82 INITSCRIPT_NAME = "lldpd"
83 INITSCRIPT_PARAMS = "defaults"
85 SYSTEMD_SERVICE_${PN} = "lldpd.service"
88 install -d -m 0755 ${D}/${sysconfdir}/init.d
89 install -Dm 0755 ${SOURCE1} ${D}${sysconfdir}/init.d/lldpd
90 install -Dm 0644 ${SOURCE2} ${D}${sysconfdir}/default/lldpd
91 install -Dm 0755 ${SOURCE3} ${D}${sysconfdir}/init.d/
92 # Make an empty configuration file
93 touch ${D}${sysconfdir}/lldpd.conf
96 PACKAGES =+ "${PN}-zsh-completion"
98 FILES_${PN} += "${libdir}/sysusers.d"
99 RDEPENDS_${PN} += "os-release bash"
101 FILES_${PN}-zsh-completion += "${datadir}/zsh/"
102 # FIXME: zsh is broken in meta-oe so this cannot be enabled for now
103 #RDEPENDS_${PN}-zsh-completion += "zsh"