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.

114 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:=2
  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. CONFLICTS:=miniupnpd-nftables
  37. DEPENDS+= \
  38. +IPV6:ip6tables \
  39. +IPV6:libip6tc \
  40. +iptables \
  41. +libip4tc \
  42. +libnetfilter-conntrack
  43. TITLE+= (iptables)
  44. VARIANT:=iptables
  45. endef
  46. define Package/miniupnpd-nftables
  47. $(call Package/miniupnpd/Default)
  48. DEPENDS+= \
  49. +libnftnl
  50. TITLE+= (nftables)
  51. VARIANT:=nftables
  52. endef
  53. define Package/miniupnpd/conffiles/Default
  54. /etc/config/upnpd
  55. endef
  56. Package/miniupnpd-iptables/conffiles = $(Package/miniupnpd/conffiles/Default)
  57. Package/miniupnpd-nftables/conffiles = $(Package/miniupnpd/conffiles/Default)
  58. define Build/Prepare
  59. $(call Build/Prepare/Default)
  60. echo "$(VERSION_NUMBER)" | tr '() ' '_' >$(PKG_BUILD_DIR)/os.openwrt
  61. endef
  62. CONFIGURE_ARGS = \
  63. $(if $(CONFIG_IPV6),--ipv6) \
  64. --igd2 \
  65. --leasefile \
  66. --portinuse \
  67. --firewall=$(BUILD_VARIANT) \
  68. --disable-fork
  69. TARGET_CFLAGS += $(FPIC)
  70. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  71. ifeq ($(BUILD_VARIANT),iptables)
  72. TARGET_CFLAGS += -flto
  73. endif
  74. define Package/miniupnpd/install/Default
  75. $(INSTALL_DIR) $(1)/usr/sbin
  76. $(INSTALL_DIR) $(1)/etc/init.d
  77. $(INSTALL_DIR) $(1)/etc/config
  78. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  79. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/miniupnpd $(1)/usr/sbin/miniupnpd
  80. $(INSTALL_BIN) ./files/miniupnpd.init $(1)/etc/init.d/miniupnpd
  81. $(INSTALL_CONF) ./files/upnpd.config $(1)/etc/config/upnpd
  82. $(INSTALL_DATA) ./files/miniupnpd.hotplug $(1)/etc/hotplug.d/iface/50-miniupnpd
  83. endef
  84. define Package/miniupnpd-iptables/install
  85. $(call Package/miniupnpd/install/Default,$1)
  86. $(INSTALL_DIR) $(1)/etc/uci-defaults
  87. $(INSTALL_DIR) $(1)/usr/share/miniupnpd
  88. $(INSTALL_BIN) ./files/miniupnpd.defaults.iptables $(1)/etc/uci-defaults/99-miniupnpd
  89. $(INSTALL_DATA) ./files/firewall3.include $(1)/usr/share/miniupnpd/firewall.include
  90. endef
  91. define Package/miniupnpd-nftables/install
  92. $(call Package/miniupnpd/install/Default,$1)
  93. endef
  94. $(eval $(call BuildPackage,miniupnpd-iptables))
  95. $(eval $(call BuildPackage,miniupnpd-nftables))