No Description

Makefile 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. #
  2. # Copyright (C) 2008-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. #
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=ddns-scripts
  8. # Version == major.minor.patch
  9. # increase on new functionality (minor) or patches (patch)
  10. PKG_VERSION:=2.4.2
  11. # Release == build
  12. # increase on changes of services files or tld_names.dat
  13. PKG_RELEASE:=1
  14. PKG_LICENSE:=GPL-2.0
  15. PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
  16. include $(INCLUDE_DIR)/package.mk
  17. # no default dependencies
  18. PKG_DEFAULT_DEPENDS=
  19. define Package/$(PKG_NAME)/Default
  20. SECTION:=net
  21. CATEGORY:=Network
  22. SUBMENU:=IP Addresses and Names
  23. PKGARCH:=all
  24. endef
  25. ##### **********************************
  26. define Package/$(PKG_NAME)
  27. $(call Package/$(PKG_NAME)/Default)
  28. TITLE:=Dynamic DNS Client scripts (with IPv6 support)
  29. endef
  30. # shown in LuCI package description
  31. define Package/$(PKG_NAME)/description
  32. Dynamic DNS Client scripts (with IPv6 support) - Info: http://wiki.openwrt.org/doc/howto/ddns.client
  33. endef
  34. # shown in menuconfig <Help>
  35. define Package/$(PKG_NAME)/config
  36. help
  37. A highly configurable set of scripts for doing dynamic dns updates.
  38. - IPv6 support
  39. - force communication to IPv4 or IPv6 only
  40. - DNS server support
  41. - using BIND host if installed
  42. - DNS requests via TCP
  43. - Proxy server support
  44. - log file support
  45. - support to run once
  46. .
  47. Version: $(PKG_VERSION)-$(PKG_RELEASE)
  48. Info : http://wiki.openwrt.org/doc/howto/ddns.client
  49. .
  50. $(PKG_MAINTAINER)
  51. endef
  52. ##### **********************************
  53. define Package/$(PKG_NAME)_cloudflare
  54. $(call Package/$(PKG_NAME)/Default)
  55. TITLE:=DDNS extension for CloudFlare
  56. DEPENDS:=$(PKG_NAME)
  57. endef
  58. define Package/$(PKG_NAME)_cloudflare/description
  59. Dynamic DNS Client scripts extension for CloudFlare
  60. endef
  61. ##### **********************************
  62. define Package/$(PKG_NAME)_no-ip_com
  63. $(call Package/$(PKG_NAME)/Default)
  64. TITLE:=DDNS extension for No-IP.com
  65. DEPENDS:=$(PKG_NAME)
  66. endef
  67. define Package/$(PKG_NAME)_no-ip_com/description
  68. Dynamic DNS Client scripts extension for No-IP.com
  69. endef
  70. ##### **********************************
  71. define Package/$(PKG_NAME)_nsupdate
  72. $(call Package/$(PKG_NAME)/Default)
  73. TITLE:=DDNS extension using Bind nsupdate
  74. DEPENDS:=$(PKG_NAME) +bind-client
  75. endef
  76. define Package/$(PKG_NAME)_nsupdate/description
  77. Dynamic DNS Client scripts extension for direct updates using Bind nsupdate
  78. endef
  79. define Package/$(PKG_NAME)_nsupdate/config
  80. help
  81. The script directly updates a PowerDNS (or maybe bind server) via nsupdate
  82. from bind-client package. It requires
  83. "option dns_server" to be set to the server to be used by nsupdate.
  84. "option username" should be set to the key name and
  85. "option password" to the base64 encoded shared secret.
  86. endef
  87. ##### **********************************
  88. define Build/Configure
  89. endef
  90. define Build/Compile
  91. $(CP) ./files $(PKG_BUILD_DIR)
  92. for FILE in `find $(PKG_BUILD_DIR)/files -type f`; do \
  93. $(SED) 's/^\s*#/#/' \
  94. -e '/^#\s\|^#$$$$/d' \
  95. -e 's/\s#\s.*$$$$//' \
  96. -e 's/\s*$$$$//' \
  97. -e '/^\/\/\s/d' \
  98. -e '/^\s*$$$$/d' $$$$FILE; \
  99. done
  100. gzip -f9 $(PKG_BUILD_DIR)/files/tld_names.dat
  101. endef
  102. define Package/$(PKG_NAME)/conffiles
  103. /etc/config/ddns
  104. endef
  105. ##### **********************************
  106. define Package/$(PKG_NAME)/install
  107. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  108. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.hotplug $(1)/etc/hotplug.d/iface/95-ddns
  109. $(INSTALL_DIR) $(1)/etc/init.d
  110. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.init $(1)/etc/init.d/ddns
  111. $(INSTALL_DIR) $(1)/etc/config
  112. $(INSTALL_CONF) $(PKG_BUILD_DIR)/files/ddns.config $(1)/etc/config/ddns
  113. $(INSTALL_DIR) $(1)/usr/lib/ddns
  114. $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/services* $(1)/usr/lib/ddns
  115. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dynamic_*.sh $(1)/usr/lib/ddns
  116. endef
  117. define Package/$(PKG_NAME)/postinst
  118. #!/bin/sh
  119. # if run within buildroot exit
  120. [ -n "$${IPKG_INSTROOT}" ] && exit 0
  121. # add new section "ddns" "global" if not exists
  122. uci -q get ddns.global > /dev/null || uci -q set ddns.global='ddns'
  123. uci -q get ddns.global.date_format > /dev/null || uci -q set ddns.global.date_format='%F %R'
  124. uci -q get ddns.global.log_lines > /dev/null || uci -q set ddns.global.log_lines='250'
  125. uci -q get ddns.global.allow_local_ip > /dev/null || uci -q set ddns.global.allow_local_ip='0'
  126. uci -q commit ddns
  127. # clear LuCI indexcache
  128. rm -f /tmp/luci-indexcache >/dev/null 2>&1
  129. exit 0
  130. endef
  131. define Package/$(PKG_NAME)/prerm
  132. #!/bin/sh
  133. # if run within buildroot exit
  134. [ -n "$${IPKG_INSTROOT}" ] && exit 0
  135. # stop running scripts
  136. /etc/init.d/ddns disable
  137. /etc/init.d/ddns stop
  138. # clear LuCI indexcache
  139. rm -f /tmp/luci-indexcache >/dev/null 2>&1
  140. exit 0
  141. endef
  142. ##### **********************************
  143. define Package/$(PKG_NAME)_cloudflare/install
  144. $(INSTALL_DIR) $(1)/usr/lib/ddns
  145. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_CloudFlare.sh $(1)/usr/lib/ddns
  146. $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/tld_names.dat.gz $(1)/usr/lib/ddns
  147. endef
  148. define Package/$(PKG_NAME)_cloudflare/postinst
  149. #!/bin/sh
  150. echo -e '"CloudFlare"\t"update_CloudFlare.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services
  151. echo -e '"CloudFlare"\t"update_CloudFlare.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services_ipv6
  152. endef
  153. define Package/$(PKG_NAME)_cloudflare/prerm
  154. #!/bin/sh
  155. /bin/sed -i '/update_CloudFlare\.sh/ d' $${IPKG_INSTROOT}/usr/lib/ddns/services
  156. /bin/sed -i '/update_CloudFlare\.sh/ d' $${IPKG_INSTROOT}/usr/lib/ddns/services_ipv6
  157. endef
  158. ##### **********************************
  159. define Package/$(PKG_NAME)_no-ip_com/install
  160. $(INSTALL_DIR) $(1)/usr/lib/ddns
  161. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_No-IP.com.sh $(1)/usr/lib/ddns
  162. endef
  163. define Package/$(PKG_NAME)_no-ip_com/postinst
  164. #!/bin/sh
  165. echo -e '"No-IP.com"\t"update_No-IP.com.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services
  166. echo -e '"NoIP.com"\t"update_No-IP.com.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services
  167. endef
  168. define Package/$(PKG_NAME)_no-ip_com/prerm
  169. #!/bin/sh
  170. /bin/sed -i '/update_No-IP\.com\.sh/ d' $${IPKG_INSTROOT}/usr/lib/ddns/services
  171. endef
  172. ##### **********************************
  173. define Package/$(PKG_NAME)_nsupdate/install
  174. $(INSTALL_DIR) $(1)/usr/lib/ddns
  175. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_nsupdate.sh $(1)/usr/lib/ddns
  176. endef
  177. define Package/$(PKG_NAME)_nsupdate/postinst
  178. #!/bin/sh
  179. echo -e '"Bind-nsupdate"\t"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services
  180. echo -e '"Bind-nsupdate"\t"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services_ipv6
  181. endef
  182. define Package/$(PKG_NAME)_nsupdate/prerm
  183. #!/bin/sh
  184. /bin/sed -i '/update_nsupdate\.sh/ d' $${IPKG_INSTROOT}/usr/lib/ddns/services
  185. /bin/sed -i '/update_nsupdate\.sh/ d' $${IPKG_INSTROOT}/usr/lib/ddns/services_ipv6
  186. endef
  187. ##### **********************************
  188. $(eval $(call BuildPackage,$(PKG_NAME)))
  189. $(eval $(call BuildPackage,$(PKG_NAME)_cloudflare))
  190. $(eval $(call BuildPackage,$(PKG_NAME)_no-ip_com))
  191. $(eval $(call BuildPackage,$(PKG_NAME)_nsupdate))