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 '/cdp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
73 ifneq ($(CONFIG_LLDPD_WITH_FDP),y)
74 sed -i -e '/fdp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
76 ifneq ($(CONFIG_LLDPD_WITH_EDP),y)
77 sed -i -e '/edp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
79 ifneq ($(CONFIG_LLDPD_WITH_SONMP),y)
80 sed -i -e '/sonmp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
82 ifneq ($(CONFIG_LLDPD_WITH_SNMP),y)
83 sed -i -e '/agentxsocket
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
85 ifneq ($(CONFIG_LLDPD_WITH_LLDPMED),y)
86 sed -i -e 's
/CONFIG_LLDPD_WITH_LLDPMED
=y
/CONFIG_LLDPD_WITH_LLDPMED
=n
/g
' $(1)/etc/init.d/lldpd
87 sed -i -e '/agentxsocket
/d
' $(1)/etc/config/lldpd
91 define Package/lldpd/conffiles
96 $(if $(CONFIG_LLDPD_WITH_PRIVSEP), \
97 --with-privsep-user=lldp \
98 --with-privsep-group=lldp \
99 --with-privsep-chroot=/var/run/lldp \
100 ,--disable-privsep) \
102 --with-embedded-libevent=no \
103 --disable-hardening \
105 --disable-doxygen-doc \
107 $(if $(CONFIG_LLDPD_WITH_CDP),,--disable-cdp) \
108 $(if $(CONFIG_LLDPD_WITH_FDP),,--disable-fdp) \
109 $(if $(CONFIG_LLDPD_WITH_EDP),,--disable-edp) \
110 $(if $(CONFIG_LLDPD_WITH_LLDPMED),,--disable-lldpmed) \
111 $(if $(CONFIG_LLDPD_WITH_DOT1),,--disable-dot1) \
112 $(if $(CONFIG_LLDPD_WITH_DOT3),,--disable-dot3) \
113 $(if $(CONFIG_LLDPD_WITH_CUSTOM),,--disable-custom) \
114 $(if $(CONFIG_LLDPD_WITH_SONMP),,--disable-sonmp) \
115 $(if $(CONFIG_LLDPD_WITH_JSON),--enable-json0,) \
116 $(if $(CONFIG_LLDPD_WITH_SNMP),--with-snmp,) \
117 $(if $(CONFIG_USE_GLIBC),,--without-libbsd)
119 TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
121 $(eval $(call BuildPackage,lldpd))