1
0

Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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.0.20170421
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_URL:=http://miniupnp.free.fr/files
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_HASH:=9677aeccadf73b4bf8bb9d832c32b5da8266b4d58eed888f3fd43d7656405643
  14. PKG_MAINTAINER:=Markus Stenberg <fingon@iki.fi>
  15. PKG_LICENSE:=BSD-3-Clause
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/miniupnpd
  18. SECTION:=net
  19. CATEGORY:=Network
  20. DEPENDS:=+iptables +libip4tc +IPV6:libip6tc +IPV6:ip6tables +libuuid
  21. TITLE:=Lightweight UPnP IGD, NAT-PMP & PCP daemon
  22. SUBMENU:=Firewall
  23. URL:=http://miniupnp.free.fr/
  24. endef
  25. define Package/miniupnpd/config
  26. config MINIUPNPD_IGDv2
  27. bool
  28. default y
  29. prompt "Enable IGDv2"
  30. endef
  31. define Package/miniupnpd/conffiles
  32. /etc/config/upnpd
  33. endef
  34. define Package/miniupnpd/postinst
  35. #!/bin/sh
  36. if [ -z "$$IPKG_INSTROOT" ]; then
  37. ( . /etc/uci-defaults/99-miniupnpd )
  38. rm -f /etc/uci-defaults/99-miniupnpd
  39. fi
  40. exit 0
  41. endef
  42. define Build/Prepare
  43. $(call Build/Prepare/Default)
  44. echo "OpenWrt" | tr \(\)\ _ >$(PKG_BUILD_DIR)/os.openwrt
  45. endef
  46. MAKE_FLAGS += \
  47. TARGET_OPENWRT=1 TEST=0 \
  48. LIBS="" \
  49. CC="$(TARGET_CC) -DIPTABLES_143 \
  50. -lip4tc $(if $(CONFIG_IPV6),-lip6tc) -luuid" \
  51. CONFIG_OPTIONS="--portinuse --leasefile \
  52. $(if $(CONFIG_IPV6),--ipv6) \
  53. $(if $(CONFIG_MINIUPNPD_IGDv2),--igd2)" \
  54. -f Makefile.linux \
  55. miniupnpd
  56. define Package/miniupnpd/install
  57. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/uci-defaults $(1)/etc/hotplug.d/iface $(1)/usr/share/miniupnpd
  58. $(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupnpd $(1)/usr/sbin/miniupnpd
  59. $(INSTALL_BIN) ./files/miniupnpd.init $(1)/etc/init.d/miniupnpd
  60. $(INSTALL_CONF) ./files/upnpd.config $(1)/etc/config/upnpd
  61. $(INSTALL_DATA) ./files/miniupnpd.hotplug $(1)/etc/hotplug.d/iface/50-miniupnpd
  62. $(INSTALL_DATA) ./files/miniupnpd.defaults $(1)/etc/uci-defaults/99-miniupnpd
  63. $(INSTALL_DATA) ./files/firewall.include $(1)/usr/share/miniupnpd/firewall.include
  64. endef
  65. $(eval $(call BuildPackage,miniupnpd))