Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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.7.15
  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_MD5SUM:=46f7ad97fc1d04084ab11b32fc0ed708
  14. PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
  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
  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. endef
  70. define Package/lldpd/conffiles
  71. /etc/config/lldpd
  72. endef
  73. CONFIGURE_ARGS += \
  74. $(if $(CONFIG_LLDPD_WITH_PRIVSEP), \
  75. --with-privsep-user=lldp \
  76. --with-privsep-group=lldp \
  77. --with-privsep-chroot=/var/run/lldp \
  78. ,--disable-privsep) \
  79. --with-readline=no \
  80. --with-embedded-libevent=no \
  81. --disable-hardening \
  82. --without-xml \
  83. $(if $(CONFIG_LLDPD_WITH_CDP),,--disable-cdp) \
  84. $(if $(CONFIG_LLDPD_WITH_FDP),,--disable-fdp) \
  85. $(if $(CONFIG_LLDPD_WITH_EDP),,--disable-edp) \
  86. $(if $(CONFIG_LLDPD_WITH_LLDPMED),,--disable-lldpmed) \
  87. $(if $(CONFIG_LLDPD_WITH_DOT1),,--disable-dot1) \
  88. $(if $(CONFIG_LLDPD_WITH_DOT3),,--disable-dot3) \
  89. $(if $(CONFIG_LLDPD_WITH_CUSTOM),,--disable-custom) \
  90. $(if $(CONFIG_LLDPD_WITH_SONMP),,--disable-sonmp) \
  91. $(if $(CONFIG_LLDPD_WITH_JSON),--with-json=json-c,--with-json=no)
  92. $(eval $(call BuildPackage,lldpd))