lldpd: update URL
[openwrt/staging/nbd.git] / package / network / services / lldpd / Makefile
1 #
2 # Copyright (C) 2008-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=lldpd
11 PKG_VERSION:=1.0.17
12 PKG_RELEASE:=3
13
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
17
18 PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
19 PKG_LICENSE:=ISC
20 PKG_CPE_ID:=cpe:/a:lldpd_project:lldpd
21
22 PKG_FIXUP:=autoreconf
23 PKG_BUILD_PARALLEL:=1
24 PKG_BUILD_FLAGS:=lto
25 PKG_INSTALL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/lldpd
30 SECTION:=net
31 CATEGORY:=Network
32 SUBMENU:=Routing and Redirection
33 TITLE:=Link Layer Discovery Protocol daemon
34 URL:=https://lldpd.github.io/
35 DEPENDS:=+libcap +libevent2 +USE_GLIBC:libbsd +LLDPD_WITH_JSON:libjson-c +LLDPD_WITH_SNMP:libnetsnmp
36 USERID:=lldp=121:lldp=129
37 MENU:=1
38 endef
39
40 define Package/lldpd/config
41 source "$(SOURCE)/Config.in"
42 endef
43
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.
51 endef
52
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
59 endef
60
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
73 endif
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
77 endif
78 ifneq ($(CONFIG_LLDPD_WITH_EDP),y)
79 sed -i -e 's/CONFIG_LLDPD_WITH_EDP=y/CONFIG_LLDPD_WITH_EDP=n/g' $(1)/etc/init.d/lldpd
80 sed -i -e '/edp/d' $(1)/etc/config/lldpd
81 endif
82 ifneq ($(CONFIG_LLDPD_WITH_SONMP),y)
83 sed -i -e 's/CONFIG_LLDPD_WITH_SONMP=y/CONFIG_LLDPD_WITH_SONMP=n/g' $(1)/etc/init.d/lldpd
84 sed -i -e '/sonmp/d' $(1)/etc/config/lldpd
85 endif
86 ifneq ($(CONFIG_LLDPD_WITH_SNMP),y)
87 sed -i -e 's/CONFIG_LLDPD_WITH_SNMP=y/CONFIG_LLDPD_WITH_SNMP=n/g' $(1)/etc/init.d/lldpd
88 sed -i -e '/agentxsocket/d' $(1)/etc/config/lldpd
89 endif
90 ifneq ($(CONFIG_LLDPD_WITH_LLDPMED),y)
91 sed -i -e 's/CONFIG_LLDPD_WITH_LLDPMED=y/CONFIG_LLDPD_WITH_LLDPMED=n/g' $(1)/etc/init.d/lldpd
92 sed -i -e '/agentxsocket/d' $(1)/etc/config/lldpd
93 endif
94 endef
95
96 define Package/lldpd/conffiles
97 /etc/config/lldpd
98 endef
99
100 CONFIGURE_ARGS += \
101 $(if $(CONFIG_LLDPD_WITH_PRIVSEP), \
102 --with-privsep-user=lldp \
103 --with-privsep-group=lldp \
104 --with-privsep-chroot=/var/run/lldp \
105 ,--disable-privsep) \
106 --with-readline=no \
107 --with-embedded-libevent=no \
108 --disable-hardening \
109 --without-xml \
110 --disable-doxygen-doc \
111 --sysconfdir=/tmp \
112 $(if $(CONFIG_LLDPD_WITH_CDP),,--disable-cdp) \
113 $(if $(CONFIG_LLDPD_WITH_FDP),,--disable-fdp) \
114 $(if $(CONFIG_LLDPD_WITH_EDP),,--disable-edp) \
115 $(if $(CONFIG_LLDPD_WITH_LLDPMED),,--disable-lldpmed) \
116 $(if $(CONFIG_LLDPD_WITH_DOT1),,--disable-dot1) \
117 $(if $(CONFIG_LLDPD_WITH_DOT3),,--disable-dot3) \
118 $(if $(CONFIG_LLDPD_WITH_CUSTOM),,--disable-custom) \
119 $(if $(CONFIG_LLDPD_WITH_SONMP),,--disable-sonmp) \
120 $(if $(CONFIG_LLDPD_WITH_JSON),--enable-json0,) \
121 $(if $(CONFIG_LLDPD_WITH_SNMP),--with-snmp,) \
122 $(if $(CONFIG_USE_GLIBC),,--without-libbsd)
123
124 TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
125
126 $(eval $(call BuildPackage,lldpd))