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
://media.luffy.cx
/files
/lldpd
16 PKG_HASH
:=450b622aac7ae1758f1ef82f3b7b94ec47f2ff33abfb0e6ac82555b9ee55f151
18 PKG_MAINTAINER
:=Stijn Tintel
<stijn@linux-ipv6.be
>
24 include $(INCLUDE_DIR
)/package.mk
29 SUBMENU
:=Routing and Redirection
30 TITLE
:=Link Layer Discovery Protocol daemon
31 URL
:=https
://vincentbernat.github.io
/lldpd
/
32 DEPENDS
:=+libevent2
+USE_GLIBC
:libbsd
+LLDPD_WITH_JSON
:libjson-c
+LLDPD_WITH_SNMP
:libnetsnmp
33 USERID
:=lldp
=121:lldp
=129
37 define Package
/lldpd
/config
38 source
"$(SOURCE)/Config.in"
41 define Package
/lldpd
/description
42 LLDP
(Link Layer Discovery Protocol
) is an industry standard protocol designed
43 to supplant proprietary Link-Layer protocols such
as
44 Extreme
's EDP (Extreme Discovery Protocol) and
45 CDP (Cisco Discovery Protocol).
46 The goal of LLDP is to provide an inter-vendor compatible mechanism to deliver
47 Link-Layer notifications to adjacent network devices.
50 define Build/InstallDev
51 $(INSTALL_DIR) $(1)/usr/lib
52 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblldpctl.so* $(1)/usr/lib/
53 $(INSTALL_DIR) $(1)/usr/include
54 $(CP) $(PKG_INSTALL_DIR)/usr/include/lldpctl.h $(1)/usr/include/lldpctl.h
55 $(CP) $(PKG_INSTALL_DIR)/usr/include/lldp-const.h $(1)/usr/include/lldp-const.h
58 define Package/lldpd/install
59 $(INSTALL_DIR) $(1)/etc/init.d
60 $(INSTALL_DIR) $(1)/etc/lldpd.d
61 $(INSTALL_DIR) $(1)/etc/config
62 $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/sbin
63 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/lldp{cli,ctl,d} $(1)/usr/sbin/
64 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblldpctl.so* $(1)/usr/lib/
65 $(INSTALL_BIN) ./files/lldpd.init $(1)/etc/init.d/lldpd
66 $(INSTALL_CONF) ./files/lldpd.config $(1)/etc/config/lldpd
67 ifneq ($(CONFIG_LLDPD_WITH_CDP),y)
68 sed -i -e '/cdp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
70 ifneq ($(CONFIG_LLDPD_WITH_FDP),y)
71 sed -i -e '/fdp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
73 ifneq ($(CONFIG_LLDPD_WITH_EDP),y)
74 sed -i -e '/edp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
76 ifneq ($(CONFIG_LLDPD_WITH_SONMP),y)
77 sed -i -e '/sonmp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
79 ifneq ($(CONFIG_LLDPD_WITH_SNMP),y)
80 sed -i -e '/agentxsocket
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
84 define Package/lldpd/conffiles
89 $(if $(CONFIG_LLDPD_WITH_PRIVSEP), \
90 --with-privsep-user=lldp \
91 --with-privsep-group=lldp \
92 --with-privsep-chroot=/var/run/lldp \
95 --with-embedded-libevent=no \
99 $(if $(CONFIG_LLDPD_WITH_CDP),,--disable-cdp) \
100 $(if $(CONFIG_LLDPD_WITH_FDP),,--disable-fdp) \
101 $(if $(CONFIG_LLDPD_WITH_EDP),,--disable-edp) \
102 $(if $(CONFIG_LLDPD_WITH_LLDPMED),,--disable-lldpmed) \
103 $(if $(CONFIG_LLDPD_WITH_DOT1),,--disable-dot1) \
104 $(if $(CONFIG_LLDPD_WITH_DOT3),,--disable-dot3) \
105 $(if $(CONFIG_LLDPD_WITH_CUSTOM),,--disable-custom) \
106 $(if $(CONFIG_LLDPD_WITH_SONMP),,--disable-sonmp) \
107 $(if $(CONFIG_LLDPD_WITH_JSON),--with-json=json-c,--with-json=no) \
108 $(if $(CONFIG_LLDPD_WITH_SNMP),--with-snmp,)
111 $(eval $(call BuildPackage,lldpd))