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.

96 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.1
  10. PKG_RELEASE:=2
  11. PKG_SOURCE_URL:=https://miniupnp.tuxfamily.org/files
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_HASH:=f158dc73b718ca72da69e25ef23c57c3a10a0d7e7d1b4b9b57d5690823040ec2
  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:=+iptables +libip4tc +IPV6:libip6tc +IPV6:ip6tables +libuuid +libcap-ng
  26. TITLE:=Lightweight UPnP IGD, NAT-PMP & PCP daemon
  27. SUBMENU:=Firewall
  28. URL:=https://miniupnp.tuxfamily.org/
  29. endef
  30. define Package/miniupnpd
  31. $(call Package/miniupnpd/Default)
  32. TITLE+= (IGDv2)
  33. CONFLICTS:=miniupnpd-igdv1
  34. VARIANT:=igdv2
  35. endef
  36. define Package/miniupnpd-igdv1
  37. $(call Package/miniupnpd/Default)
  38. TITLE+= (IGDv1)
  39. PROVIDES:=miniupnpd
  40. VARIANT:=igdv1
  41. endef
  42. define Package/miniupnpd/conffiles
  43. /etc/config/upnpd
  44. endef
  45. Package/miniupnpd-igdv1/conffiles = $(Package/miniupnpd/conffiles)
  46. define Build/Prepare
  47. $(call Build/Prepare/Default)
  48. echo "$(VERSION_NUMBER)" | tr '() ' '_' >$(PKG_BUILD_DIR)/os.openwrt
  49. endef
  50. CONFIGURE_ARGS = \
  51. $(if $(CONFIG_IPV6),--ipv6) \
  52. --leasefile \
  53. --portinuse \
  54. --firewall=iptables \
  55. --disable-fork
  56. ifeq ($(BUILD_VARIANT),igdv2)
  57. CONFIGURE_ARGS += --igd2
  58. endif
  59. TARGET_CFLAGS += $(FPIC) -flto
  60. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  61. define Package/miniupnpd/install
  62. $(INSTALL_DIR) $(1)/usr/sbin
  63. $(INSTALL_DIR) $(1)/etc/init.d
  64. $(INSTALL_DIR) $(1)/etc/config
  65. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  66. $(INSTALL_DIR) $(1)/etc/uci-defaults
  67. $(INSTALL_DIR) $(1)/usr/share/miniupnpd
  68. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/miniupnpd $(1)/usr/sbin/miniupnpd
  69. $(INSTALL_BIN) ./files/miniupnpd.init $(1)/etc/init.d/miniupnpd
  70. $(INSTALL_CONF) ./files/upnpd.config $(1)/etc/config/upnpd
  71. $(INSTALL_DATA) ./files/miniupnpd.hotplug $(1)/etc/hotplug.d/iface/50-miniupnpd
  72. $(INSTALL_BIN) ./files/miniupnpd.defaults $(1)/etc/uci-defaults/99-miniupnpd
  73. $(INSTALL_DATA) ./files/firewall.include $(1)/usr/share/miniupnpd/firewall.include
  74. endef
  75. Package/miniupnpd-igdv1/install = $(Package/miniupnpd/install)
  76. $(eval $(call BuildPackage,miniupnpd))
  77. $(eval $(call BuildPackage,miniupnpd-igdv1))