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