2 # Copyright (C) 2008-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
7 include $(TOPDIR
)/rules.mk
10 # Version == major.minor.patch
11 # increase on new functionality (minor) or patches (patch)
14 # increase on changes of services files or tld_names.dat
18 PKG_MAINTAINER
:=Christian Schoenebeck
<christian.schoenebeck@gmail.com
>
20 include $(INCLUDE_DIR
)/package.mk
22 # no default dependencies
25 define Package
/$(PKG_NAME
)/Default
28 SUBMENU
:=IP Addresses and Names
32 ##### **********************************
33 define Package
/$(PKG_NAME
)
34 $(call Package
/$(PKG_NAME
)/Default
)
35 TITLE
:=Dynamic DNS Client scripts
(with IPv6 support
)
37 # shown in LuCI package description
38 define Package
/$(PKG_NAME
)/description
39 Dynamic DNS Client scripts
(with IPv6 support
) - Info
: http
://wiki.openwrt.org
/doc
/howto
/ddns.client
41 # shown in menuconfig <Help>
42 define Package
/$(PKG_NAME
)/config
44 A highly configurable set of scripts for doing dynamic dns updates.
46 - force communication to IPv4 or IPv6 only
48 - using BIND host if installed
49 - DNS requests via TCP
50 - Proxy server support
54 Version
: $(PKG_VERSION
)-$(PKG_RELEASE
)
55 Info
: http
://wiki.openwrt.org
/doc
/howto
/ddns.client
60 ##### **********************************
61 define Package
/$(PKG_NAME
)_cloudflare
62 $(call Package
/$(PKG_NAME
)/Default
)
63 TITLE
:=DDNS extension for CloudFlare
66 define Package
/$(PKG_NAME
)_cloudflare
/description
67 Dynamic DNS Client scripts extension for CloudFlare
70 ##### **********************************
71 define Package
/$(PKG_NAME
)_no-ip_com
72 $(call Package
/$(PKG_NAME
)/Default
)
73 TITLE
:=DDNS extension for No-IP.com
76 define Package
/$(PKG_NAME
)_no-ip_com
/description
77 Dynamic DNS Client scripts extension for No-IP.com
80 ##### **********************************
81 define Package
/$(PKG_NAME
)_nsupdate
82 $(call Package
/$(PKG_NAME
)/Default
)
83 TITLE
:=DDNS extension using Bind nsupdate
84 DEPENDS
:=$(PKG_NAME
) +bind-client
86 define Package
/$(PKG_NAME
)_nsupdate
/description
87 Dynamic DNS Client scripts extension for direct updates using Bind nsupdate
89 define Package
/$(PKG_NAME
)_nsupdate
/config
91 The script directly updates a PowerDNS
(or maybe bind server
) via nsupdate
92 from bind-client package. It requires
93 "option dns_server" to be set to the server to be used by nsupdate.
94 "option username" should be set to the key name and
95 "option password" to the base64 encoded shared secret.
99 ##### **********************************
100 define Build
/Configure
103 $(CP
) .
/files
$(PKG_BUILD_DIR
)
104 for FILE in
`find $(PKG_BUILD_DIR)/files -type f`; do \
105 $(SED
) 's/^\s*#/#/' \
106 -e
'/^#\s\|^#$$$$/d' \
107 -e
's/\s#\s.*$$$$//' \
110 -e
'/^\s*$$$$/d' $$$$FILE; \
112 gzip
-f9
$(PKG_BUILD_DIR
)/files
/tld_names.dat
115 define Package
/$(PKG_NAME
)/conffiles
119 ##### **********************************
120 define Package
/$(PKG_NAME
)/install
121 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/iface
122 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/ddns.hotplug
$(1)/etc
/hotplug.d
/iface
/95-ddns
123 $(INSTALL_DIR
) $(1)/etc
/init.d
124 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/ddns.init
$(1)/etc
/init.d
/ddns
125 $(INSTALL_DIR
) $(1)/etc
/config
126 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)/files
/ddns.config
$(1)/etc
/config
/ddns
128 $(INSTALL_DIR
) $(1)/usr
/lib
/ddns
129 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/files
/services
* $(1)/usr
/lib
/ddns
130 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/dynamic_
*.sh
$(1)/usr
/lib
/ddns
132 define Package
/$(PKG_NAME
)/postinst
134 # if run within buildroot exit
135 [ -n
"$${IPKG_INSTROOT}" ] && exit
0
137 # add new section "ddns" "global" if not exists
138 uci
-q
get ddns.global
> /dev
/null || uci
-q set ddns.global
='ddns'
139 uci
-q
get ddns.global.date_format
> /dev
/null || uci
-q set ddns.global.date_format
='%F %R'
140 uci
-q
get ddns.global.log_lines
> /dev
/null || uci
-q set ddns.global.log_lines
='250'
141 uci
-q
get ddns.global.allow_local_ip
> /dev
/null || uci
-q set ddns.global.allow_local_ip
='0'
144 # clear LuCI indexcache
145 rm -f
/tmp
/luci-indexcache
>/dev
/null
2>&1
149 define Package
/$(PKG_NAME
)/prerm
151 # if run within buildroot exit
152 [ -n
"$${IPKG_INSTROOT}" ] && exit
0
154 # stop running scripts
155 /etc
/init.d
/ddns disable
156 /etc
/init.d
/ddns stop
158 # clear LuCI indexcache
159 rm -f
/tmp
/luci-indexcache
>/dev
/null
2>&1
164 ##### **********************************
165 define Package
/$(PKG_NAME
)_cloudflare
/install
166 $(INSTALL_DIR
) $(1)/usr
/lib
/ddns
167 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/update_CloudFlare.sh
$(1)/usr
/lib
/ddns
168 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/files
/tld_names.dat.gz
$(1)/usr
/lib
/ddns
170 define Package
/$(PKG_NAME
)_cloudflare
/postinst
172 echo
-e
'"CloudFlare"\t"update_CloudFlare.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
173 echo
-e
'"CloudFlare"\t"update_CloudFlare.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services_ipv6
175 define Package
/$(PKG_NAME
)_cloudflare
/prerm
177 /bin
/sed
-i
'/update_CloudFlare\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
178 /bin
/sed
-i
'/update_CloudFlare\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services_ipv6
181 ##### **********************************
182 define Package
/$(PKG_NAME
)_no-ip_com
/install
183 $(INSTALL_DIR
) $(1)/usr
/lib
/ddns
184 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/update_No-IP.com.sh
$(1)/usr
/lib
/ddns
186 define Package
/$(PKG_NAME
)_no-ip_com
/postinst
188 echo
-e
'"No-IP.com"\t"update_No-IP.com.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
189 echo
-e
'"NoIP.com"\t"update_No-IP.com.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
191 define Package
/$(PKG_NAME
)_no-ip_com
/prerm
193 /bin
/sed
-i
'/update_No-IP\.com\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
196 ##### **********************************
197 define Package
/$(PKG_NAME
)_nsupdate
/install
198 $(INSTALL_DIR
) $(1)/usr
/lib
/ddns
199 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/update_nsupdate.sh
$(1)/usr
/lib
/ddns
201 define Package
/$(PKG_NAME
)_nsupdate
/postinst
203 echo
-e
'"Bind-nsupdate"\t"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
204 echo
-e
'"Bind-nsupdate"\t"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services_ipv6
206 define Package
/$(PKG_NAME
)_nsupdate
/prerm
208 /bin
/sed
-i
'/update_nsupdate\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
209 /bin
/sed
-i
'/update_nsupdate\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services_ipv6
212 ##### **********************************
213 $(eval
$(call BuildPackage
,$(PKG_NAME
)))
214 $(eval
$(call BuildPackage
,$(PKG_NAME
)_cloudflare
))
215 $(eval
$(call BuildPackage
,$(PKG_NAME
)_no-ip_com
))
216 $(eval
$(call BuildPackage
,$(PKG_NAME
)_nsupdate
))