Makefile 3.5 KB

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