Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=lldpd
  9. PKG_VERSION:=1.0.17
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://github.com/lldpd/lldpd/releases/download/$(PKG_VERSION)/
  13. PKG_HASH:=89ae691a4917ac9e0ec3b8b2c1e634cc402d43b804f98850c73bd1c7df380882
  14. PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
  15. PKG_LICENSE:=ISC
  16. PKG_CPE_ID:=cpe:/a:lldpd_project:lldpd
  17. PKG_FIXUP:=autoreconf
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_BUILD_FLAGS:=lto
  20. PKG_INSTALL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/lldpd
  23. SECTION:=net
  24. CATEGORY:=Network
  25. SUBMENU:=Routing and Redirection
  26. TITLE:=Link Layer Discovery Protocol daemon
  27. URL:=https://vincentbernat.github.io/lldpd/
  28. DEPENDS:=+libcap +libevent2 +USE_GLIBC:libbsd +LLDPD_WITH_JSON:libjson-c +LLDPD_WITH_SNMP:libnetsnmp
  29. USERID:=lldp=121:lldp=129
  30. MENU:=1
  31. endef
  32. define Package/lldpd/config
  33. source "$(SOURCE)/Config.in"
  34. endef
  35. define Package/lldpd/description
  36. LLDP (Link Layer Discovery Protocol) is an industry standard protocol designed
  37. to supplant proprietary Link-Layer protocols such as
  38. Extreme's EDP (Extreme Discovery Protocol) and
  39. CDP (Cisco Discovery Protocol).
  40. The goal of LLDP is to provide an inter-vendor compatible mechanism to deliver
  41. Link-Layer notifications to adjacent network devices.
  42. endef
  43. define Build/InstallDev
  44. $(INSTALL_DIR) $(1)/usr/lib
  45. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblldpctl.so* $(1)/usr/lib/
  46. $(INSTALL_DIR) $(1)/usr/include
  47. $(CP) $(PKG_INSTALL_DIR)/usr/include/lldpctl.h $(1)/usr/include/lldpctl.h
  48. $(CP) $(PKG_INSTALL_DIR)/usr/include/lldp-const.h $(1)/usr/include/lldp-const.h
  49. endef
  50. define Package/lldpd/install
  51. $(INSTALL_DIR) $(1)/etc/init.d
  52. $(INSTALL_DIR) $(1)/etc/lldpd.d
  53. $(INSTALL_DIR) $(1)/etc/config
  54. $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/sbin
  55. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/lldp{cli,ctl,d} $(1)/usr/sbin/
  56. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblldpctl.so* $(1)/usr/lib/
  57. $(INSTALL_BIN) ./files/lldpd.init $(1)/etc/init.d/lldpd
  58. $(INSTALL_CONF) ./files/lldpd.config $(1)/etc/config/lldpd
  59. ifneq ($(CONFIG_LLDPD_WITH_CDP),y)
  60. sed -i -e '/cdp/d' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
  61. endif
  62. ifneq ($(CONFIG_LLDPD_WITH_FDP),y)
  63. sed -i -e '/fdp/d' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
  64. endif
  65. ifneq ($(CONFIG_LLDPD_WITH_EDP),y)
  66. sed -i -e '/edp/d' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
  67. endif
  68. ifneq ($(CONFIG_LLDPD_WITH_SONMP),y)
  69. sed -i -e '/sonmp/d' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
  70. endif
  71. ifneq ($(CONFIG_LLDPD_WITH_SNMP),y)
  72. sed -i -e '/agentxsocket/d' $(1)/etc/init.d/lldpd $(1)/etc/config/lldpd
  73. endif
  74. endef
  75. define Package/lldpd/conffiles
  76. /etc/config/lldpd
  77. endef
  78. CONFIGURE_ARGS += \
  79. $(if $(CONFIG_LLDPD_WITH_PRIVSEP), \
  80. --with-privsep-user=lldp \
  81. --with-privsep-group=lldp \
  82. --with-privsep-chroot=/var/run/lldp \
  83. ,--disable-privsep) \
  84. --with-readline=no \
  85. --with-embedded-libevent=no \
  86. --disable-hardening \
  87. --without-xml \
  88. --disable-doxygen-doc \
  89. --sysconfdir=/tmp \
  90. $(if $(CONFIG_LLDPD_WITH_CDP),,--disable-cdp) \
  91. $(if $(CONFIG_LLDPD_WITH_FDP),,--disable-fdp) \
  92. $(if $(CONFIG_LLDPD_WITH_EDP),,--disable-edp) \
  93. $(if $(CONFIG_LLDPD_WITH_LLDPMED),,--disable-lldpmed) \
  94. $(if $(CONFIG_LLDPD_WITH_DOT1),,--disable-dot1) \
  95. $(if $(CONFIG_LLDPD_WITH_DOT3),,--disable-dot3) \
  96. $(if $(CONFIG_LLDPD_WITH_CUSTOM),,--disable-custom) \
  97. $(if $(CONFIG_LLDPD_WITH_SONMP),,--disable-sonmp) \
  98. $(if $(CONFIG_LLDPD_WITH_JSON),--enable-json0,) \
  99. $(if $(CONFIG_LLDPD_WITH_SNMP),--with-snmp,) \
  100. $(if $(CONFIG_USE_GLIBC),,--without-libbsd)
  101. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  102. $(eval $(call BuildPackage,lldpd))