Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-integ / recipes-daemons / lldpd / lldpd_0.9.0.bb
1 #
2 # Copyright (C) 2019 Wind River Systems, Inc.
3 #
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
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15
16 SUMMARY = "A 802.1ab implementation (LLDP) to help you locate neighbors of all your equipments"
17 SECTION = "net/misc"
18 LICENSE = "ISC"
19 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d"
20
21 DEPENDS = "libbsd libevent json-c"
22
23 SRC_URI = "\
24     http://media.luffy.cx/files/${BPN}/${BPN}-${PV}.tar.gz \
25     "
26
27 SRC_URI[md5sum] = "ed0226129b0c90b3a45c273fe1aba8de"
28 SRC_URI[sha256sum] = "300e4a590f7bf21c79d5ff94c2d6a69d0b2c34dbc21e17281496462a04ca80bc"
29
30 inherit stx-metadata
31
32 STX_REPO = "integ"
33 STX_SUBPATH = "networking/lldpd"
34
35 SRC_URI_STX = " \
36     file://centos/files/lldpd-create-run-dir.patch \
37     file://centos/files/lldpd-i40e-disable.patch \
38     file://centos/files/lldpd-clear-station.patch \
39     file://${BP}/lldpd-interface-show.patch \
40     "
41
42 SOURCE1 = "${STX_METADATA_PATH}/${BP}/lldpd.init"
43 SOURCE2 = "${STX_METADATA_PATH}/${BP}/lldpd.default"
44 SOURCE3 = "${STX_METADATA_PATH}/centos/files/i40e-lldp-configure.sh"
45
46 DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit"
47
48 inherit autotools update-rc.d useradd systemd pkgconfig bash-completion
49
50 USERADD_PACKAGES = "${PN}"
51 USERADD_PARAM_${PN} = "--system -g lldpd --shell /bin/false lldpd"
52 GROUPADD_PARAM_${PN} = "--system lldpd"
53
54 EXTRA_OECONF += "--without-embedded-libevent \
55                  --disable-oldies \
56                  --with-privsep-user=lldpd \
57                  --with-privsep-group=lldpd \
58                  --with-systemdsystemunitdir=${systemd_system_unitdir} \
59                  --without-sysusersdir \
60 "
61
62 PACKAGECONFIG ??= "cdp fdp edp sonmp lldpmed dot1 dot3"
63 PACKAGECONFIG[xml] = "--with-xml,--without-xml,libxm2"
64 PACKAGECONFIG[snmp] = "--with-snmp,--without-snmp,net-snmp"
65 PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
66 PACKAGECONFIG[seccomp] = "--with-seccomp,--without-seccomp,libseccomp"
67 PACKAGECONFIG[cdp] = "--enable-cdp,--disable-cdp"
68 PACKAGECONFIG[fdp] = "--enable-fdp,--disable-fdp"
69 PACKAGECONFIG[edp] = "--enable-edp,--disable-edp"
70 PACKAGECONFIG[sonmp] = "--enable-sonmp,--disable-sonmp"
71 PACKAGECONFIG[lldpmed] = "--enable-lldpmed,--disable-lldpmed"
72 PACKAGECONFIG[dot1] = "--enable-dot1,--disable-dot1"
73 PACKAGECONFIG[dot3] = "--enable-dot3,--disable-dot3"
74 PACKAGECONFIG[custom] = "--enable-custom,--disable-custom"
75
76 INITSCRIPT_NAME = "lldpd"
77 INITSCRIPT_PARAMS = "defaults"
78
79 SYSTEMD_SERVICE_${PN} = "lldpd.service"
80
81 do_install_append() {
82     install -d -m 0755 ${D}/${sysconfdir}/init.d
83     install -Dm 0755 ${SOURCE1} ${D}${sysconfdir}/init.d/lldpd
84     install -Dm 0644 ${SOURCE2} ${D}${sysconfdir}/default/lldpd
85     install -Dm 0755 ${SOURCE3} ${D}${sysconfdir}/init.d/
86     # Make an empty configuration file
87     touch ${D}${sysconfdir}/lldpd.conf
88 }
89
90 PACKAGES =+ "${PN}-zsh-completion"
91
92 FILES_${PN} += "${libdir}/sysusers.d"
93 RDEPENDS_${PN} += "os-release bash"
94
95 FILES_${PN}-zsh-completion += "${datadir}/zsh/"
96 # FIXME: zsh is broken in meta-oe so this cannot be enabled for now
97 #RDEPENDS_${PN}-zsh-completion += "zsh"