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
:=http
://media.luffy.cx
/files
/lldpd
16 PKG_MD5SUM
:=13e8be761753eac9a8e12128acba40b4
18 PKG_MAINTAINER
:=Jo-Philipp Wich
<jow@openwrt.org
>
24 TARGET_CFLAGS
+=--std
=c99
26 include $(INCLUDE_DIR
)/package.mk
31 SUBMENU
:=Routing and Redirection
32 TITLE
:=Link Layer Discovery Protocol daemon
33 URL
:=https
://github.com
/vincentbernat
/lldpd
/wiki
34 DEPENDS
:=+libevent2
+USE_GLIBC
:libbsd
+LLDPD_WITH_JSON
:libjson-c
35 USERID
:=lldp
=121:lldp
=129
39 define Package
/lldpd
/config
40 source
"$(SOURCE)/Config.in"
43 define Package
/lldpd
/description
44 LLDP
(Link Layer Discovery Protocol
) is an industry standard protocol designed
45 to supplant proprietary Link-Layer protocols such
as
46 Extreme
's EDP (Extreme Discovery Protocol) and
47 CDP (Cisco Discovery Protocol).
48 The goal of LLDP is to provide an inter-vendor compatible mechanism to deliver
49 Link-Layer notifications to adjacent network devices.
52 define Package/lldpd/install
53 $(INSTALL_DIR) $(1)/etc/init.d
54 $(INSTALL_DIR) $(1)/etc/lldpd.d
55 $(INSTALL_DIR) $(1)/etc/config
56 $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/sbin
57 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/lldp{cli,ctl,d} $(1)/usr/sbin/
58 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblldpctl.so* $(1)/usr/lib/
59 $(INSTALL_BIN) ./files/lldpd.init $(1)/etc/init.d/lldpd
60 $(INSTALL_DATA) ./files/lldpd.config $(1)/etc/config/lldpd
61 ifneq ($(CONFIG_LLDPD_WITH_CDP),y)
62 sed -i -e '/cdp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
64 ifneq ($(CONFIG_LLDPD_WITH_FDP),y)
65 sed -i -e '/fdp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
67 ifneq ($(CONFIG_LLDPD_WITH_EDP),y)
68 sed -i -e '/edp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
70 ifneq ($(CONFIG_LLDPD_WITH_SONMP),y)
71 sed -i -e '/sonmp
/d
' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
75 define Package/lldpd/conffiles
80 --with-privsep-user=lldp \
81 --with-privsep-group=lldp \
82 --with-privsep-chroot=/var/run/lldp \
84 --with-embedded-libevent=no \
85 $(if $(CONFIG_LLDPD_WITH_CDP),,--disable-cdp) \
86 $(if $(CONFIG_LLDPD_WITH_FDP),,--disable-fdp) \
87 $(if $(CONFIG_LLDPD_WITH_EDP),,--disable-edp) \
88 $(if $(CONFIG_LLDPD_WITH_LLDPMED),,--disable-lldpmed) \
89 $(if $(CONFIG_LLDPD_WITH_DOT1),,--disable-dot1) \
90 $(if $(CONFIG_LLDPD_WITH_DOT3),,--disable-dot3) \
91 $(if $(CONFIG_LLDPD_WITH_SONMP),,--disable-sonmp) \
92 $(if $(CONFIG_LLDPD_WITH_JSON),--with-json=json-c)
95 $(eval $(call BuildPackage,lldpd))