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.

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