Makefile 3.7 KB

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