2 # Copyright (C) 2008-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=https
://github.com
/lldpd
/lldpd
/releases
/download
/$(PKG_VERSION
)/
16 PKG_HASH
:=89ae691a4917ac9e0ec3b8b2c1e634cc402d43b804f98850c73bd1c7df380882
18 PKG_MAINTAINER
:=Stijn Tintel
<stijn@linux-ipv6.be
>
20 PKG_CPE_ID
:=cpe
:/a
:lldpd_project
:lldpd
27 include $(INCLUDE_DIR
)/package.mk
32 SUBMENU
:=Routing and Redirection
33 TITLE
:=Link Layer Discovery Protocol daemon
34 URL
:=https
://vincentbernat.github.io
/lldpd
/
35 DEPENDS
:=+libcap
+libevent2
+USE_GLIBC
:libbsd
+LLDPD_WITH_JSON
:libjson-c
+LLDPD_WITH_SNMP
:libnetsnmp
36 USERID
:=lldp
=121:lldp
=129
40 define Package
/lldpd
/config
41 source
"$(SOURCE)/Config.in"
44 define Package
/lldpd
/description
45 LLDP
(Link Layer Discovery Protocol
) is an industry standard protocol designed
46 to supplant proprietary Link-Layer protocols such
as
47 Extreme
's EDP (Extreme Discovery Protocol) and
48 CDP (Cisco Discovery Protocol).
49 The goal of LLDP is to provide an inter-vendor compatible mechanism to deliver
50 Link-Layer notifications to adjacent network devices.
53 define Build/InstallDev
54 $(INSTALL_DIR) $(1)/usr/lib
55 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblldpctl.so* $(1)/usr/lib/
56 $(INSTALL_DIR) $(1)/usr/include
57 $(CP) $(PKG_INSTALL_DIR)/usr/include/lldpctl.h $(1)/usr/include/lldpctl.h
58 $(CP) $(PKG_INSTALL_DIR)/usr/include/lldp-const.h $(1)/usr/include/lldp-const.h
61 define Package/lldpd/install
62 $(INSTALL_DIR) $(1)/etc/init.d
63 $(INSTALL_DIR) $(1)/etc/lldpd.d
64 $(INSTALL_DIR) $(1)/etc/config
65 $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/sbin
66 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/lldp{cli,ctl,d} $(1)/usr/sbin/
67 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblldpctl.so* $(1)/usr/lib/
68 $(INSTALL_BIN) ./files/lldpd.init $(1)/etc/init.d/lldpd
69 $(INSTALL_CONF) ./files/lldpd.config $(1)/etc/config/lldpd
70 ifneq ($(CONFIG_LLDPD_WITH_CDP),y)
71 sed -i -e 's
/CONFIG_LLDPD_WITH_CDP
=y
/CONFIG_LLDPD_WITH_CDP
=n
/g
' $(1)/etc/init.d/lldpd
72 sed -i -e '/cdp
/d
' $(1)/etc/config/lldpd
74 ifneq ($(CONFIG_LLDPD_WITH_FDP),y)
75 sed -i -e 's
/CONFIG_LLDPD_WITH_FDP
=y
/CONFIG_LLDPD_WITH_FDP
=n
/g
' $(1)/etc/init.d/lldpd
76 sed -i -e '/fdp
/d
' $(1)/etc/config/lldpd
78 ifneq ($(CONFIG_LLDPD_WITH_EDP),y)
79 sed -i -e '/edp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
81 ifneq ($(CONFIG_LLDPD_WITH_SONMP),y)
82 sed -i -e 's
/CONFIG_LLDPD_WITH_SONMP
=y
/CONFIG_LLDPD_WITH_SONMP
=n
/g
' $(1)/etc/init.d/lldpd
83 sed -i -e '/sonmp
/d
' $(1)/etc/config/lldpd
85 ifneq ($(CONFIG_LLDPD_WITH_SNMP),y)
86 sed -i -e '/agentxsocket
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
88 ifneq ($(CONFIG_LLDPD_WITH_LLDPMED),y)
89 sed -i -e 's
/CONFIG_LLDPD_WITH_LLDPMED
=y
/CONFIG_LLDPD_WITH_LLDPMED
=n
/g
' $(1)/etc/init.d/lldpd
90 sed -i -e '/agentxsocket
/d
' $(1)/etc/config/lldpd
94 define Package/lldpd/conffiles
99 $(if $(CONFIG_LLDPD_WITH_PRIVSEP), \
100 --with-privsep-user=lldp \
101 --with-privsep-group=lldp \
102 --with-privsep-chroot=/var/run/lldp \
103 ,--disable-privsep) \
105 --with-embedded-libevent=no \
106 --disable-hardening \
108 --disable-doxygen-doc \
110 $(if $(CONFIG_LLDPD_WITH_CDP),,--disable-cdp) \
111 $(if $(CONFIG_LLDPD_WITH_FDP),,--disable-fdp) \
112 $(if $(CONFIG_LLDPD_WITH_EDP),,--disable-edp) \
113 $(if $(CONFIG_LLDPD_WITH_LLDPMED),,--disable-lldpmed) \
114 $(if $(CONFIG_LLDPD_WITH_DOT1),,--disable-dot1) \
115 $(if $(CONFIG_LLDPD_WITH_DOT3),,--disable-dot3) \
116 $(if $(CONFIG_LLDPD_WITH_CUSTOM),,--disable-custom) \
117 $(if $(CONFIG_LLDPD_WITH_SONMP),,--disable-sonmp) \
118 $(if $(CONFIG_LLDPD_WITH_JSON),--enable-json0,) \
119 $(if $(CONFIG_LLDPD_WITH_SNMP),--with-snmp,) \
120 $(if $(CONFIG_USE_GLIBC),,--without-libbsd)
122 TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
124 $(eval $(call BuildPackage,lldpd))