You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.5 KiB

  1. #
  2. # Copyright (C) 2006-2014 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:=miniupnpd
  9. PKG_VERSION:=2.2.2
  10. PKG_RELEASE:=3
  11. PKG_SOURCE_URL:=https://miniupnp.tuxfamily.org/files
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_HASH:=4b01c403d01c6ab140c9e4e744c89cdb66cbe25145d7a0d4566cc3fdcc0240c3
  14. PKG_MAINTAINER:=
  15. PKG_LICENSE:=BSD-3-Clause
  16. PKG_LICENSE_FILES:=LICENSE
  17. PKG_CPE_ID:=cpe:/a:miniupnp_project:miniupnpd
  18. PKG_INSTALL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/version.mk
  22. define Package/miniupnpd/Default
  23. SECTION:=net
  24. CATEGORY:=Network
  25. DEPENDS:= \
  26. +IPV6:ip6tables \
  27. +IPV6:libip6tc \
  28. +iptables \
  29. +libcap-ng \
  30. +libip4tc \
  31. +libmnl \
  32. +libnetfilter-conntrack \
  33. +libuuid
  34. TITLE:=Lightweight UPnP IGD, NAT-PMP & PCP daemon
  35. SUBMENU:=Firewall
  36. URL:=https://miniupnp.tuxfamily.org/
  37. endef
  38. define Package/miniupnpd
  39. $(call Package/miniupnpd/Default)
  40. TITLE+= (IGDv2)
  41. CONFLICTS:=miniupnpd-igdv1
  42. VARIANT:=igdv2
  43. endef
  44. define Package/miniupnpd-igdv1
  45. $(call Package/miniupnpd/Default)
  46. TITLE+= (IGDv1)
  47. PROVIDES:=miniupnpd
  48. VARIANT:=igdv1
  49. endef
  50. define Package/miniupnpd/conffiles
  51. /etc/config/upnpd
  52. endef
  53. Package/miniupnpd-igdv1/conffiles = $(Package/miniupnpd/conffiles)
  54. define Build/Prepare
  55. $(call Build/Prepare/Default)
  56. echo "$(VERSION_NUMBER)" | tr '() ' '_' >$(PKG_BUILD_DIR)/os.openwrt
  57. endef
  58. CONFIGURE_ARGS = \
  59. $(if $(CONFIG_IPV6),--ipv6) \
  60. --leasefile \
  61. --portinuse \
  62. --firewall=iptables \
  63. --disable-fork
  64. ifeq ($(BUILD_VARIANT),igdv2)
  65. CONFIGURE_ARGS += --igd2
  66. endif
  67. TARGET_CFLAGS += $(FPIC) -flto
  68. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  69. define Package/miniupnpd/install
  70. $(INSTALL_DIR) $(1)/usr/sbin
  71. $(INSTALL_DIR) $(1)/etc/init.d
  72. $(INSTALL_DIR) $(1)/etc/config
  73. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  74. $(INSTALL_DIR) $(1)/etc/uci-defaults
  75. $(INSTALL_DIR) $(1)/usr/share/miniupnpd
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/miniupnpd $(1)/usr/sbin/miniupnpd
  77. $(INSTALL_BIN) ./files/miniupnpd.init $(1)/etc/init.d/miniupnpd
  78. $(INSTALL_CONF) ./files/upnpd.config $(1)/etc/config/upnpd
  79. $(INSTALL_DATA) ./files/miniupnpd.hotplug $(1)/etc/hotplug.d/iface/50-miniupnpd
  80. $(INSTALL_BIN) ./files/miniupnpd.defaults $(1)/etc/uci-defaults/99-miniupnpd
  81. $(INSTALL_DATA) ./files/firewall.include $(1)/usr/share/miniupnpd/firewall.include
  82. endef
  83. Package/miniupnpd-igdv1/install = $(Package/miniupnpd/install)
  84. $(eval $(call BuildPackage,miniupnpd))
  85. $(eval $(call BuildPackage,miniupnpd-igdv1))