2 # Copyright (C) 2008-2016 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
53 Version
: $(PKG_VERSION
)-$(PKG_RELEASE
)
54 Info
: http
://wiki.openwrt.org
/doc
/howto
/ddns.client
58 ##### **********************************
59 define Package
/$(PKG_NAME
)_cloudflare
60 $(call Package
/$(PKG_NAME
)/Default
)
61 TITLE
:=DDNS extension for CloudFlare.com
64 define Package
/$(PKG_NAME
)_cloudflare
/description
65 Dynamic DNS Client scripts extension for CloudFlare.com
68 ##### **********************************
69 define Package
/$(PKG_NAME
)_no-ip_com
70 $(call Package
/$(PKG_NAME
)/Default
)
71 TITLE
:=DDNS extension for No-IP.com
74 define Package
/$(PKG_NAME
)_no-ip_com
/description
75 Dynamic DNS Client scripts extension for No-IP.com
78 ##### **********************************
79 define Package
/$(PKG_NAME
)_nsupdate
80 $(call Package
/$(PKG_NAME
)/Default
)
81 TITLE
:=DDNS extension using Bind nsupdate
82 DEPENDS
:=$(PKG_NAME
) +bind-client
84 define Package
/$(PKG_NAME
)_nsupdate
/description
85 Dynamic DNS Client scripts extension for direct updates using Bind nsupdate
87 define Package
/$(PKG_NAME
)_nsupdate
/config
89 The script directly updates a PowerDNS
(or maybe bind server
) via nsupdate
90 from bind-client package. It requires
91 "option dns_server" to be set to the server to be used by nsupdate.
92 "option username" should be set to the key name and
93 "option password" to the base64 encoded shared secret.
97 ##### **********************************
98 define Build
/Configure
101 $(CP
) .
/files
$(PKG_BUILD_DIR
)
102 for FILE in
`find $(PKG_BUILD_DIR)/files -type f`; do \
103 $(SED
) 's/^\s*#/#/' \
104 -e
'/^#\s\|^#$$$$/d' \
105 -e
's/\s#\s.*$$$$//' \
108 -e
'/^\s*$$$$/d' $$$$FILE; \
110 gzip
-f9
$(PKG_BUILD_DIR
)/files
/tld_names.dat
113 define Package
/$(PKG_NAME
)/conffiles
117 ##### **********************************
118 define Package
/$(PKG_NAME
)/install
119 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/iface
120 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/ddns.hotplug
$(1)/etc
/hotplug.d
/iface
/95-ddns
121 $(INSTALL_DIR
) $(1)/etc
/init.d
122 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/ddns.init
$(1)/etc
/init.d
/ddns
123 $(INSTALL_DIR
) $(1)/etc
/config
124 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)/files
/ddns.config
$(1)/etc
/config
/ddns
126 $(INSTALL_DIR
) $(1)/usr
/lib
/ddns
127 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/files
/services
* $(1)/usr
/lib
/ddns
128 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/dynamic_
*.sh
$(1)/usr
/lib
/ddns
130 define Package
/$(PKG_NAME
)/postinst
132 # if run within buildroot exit
133 [ -n
"$${IPKG_INSTROOT}" ] && exit
0
135 # add new section "ddns" "global" if not exists
136 uci
-q
get ddns.global
> /dev
/null || uci
-q set ddns.global
='ddns'
137 uci
-q
get ddns.global.date_format
> /dev
/null || uci
-q set ddns.global.date_format
='%F %R'
138 uci
-q
get ddns.global.log_lines
> /dev
/null || uci
-q set ddns.global.log_lines
='250'
139 uci
-q
get ddns.global.allow_local_ip
> /dev
/null || uci
-q set ddns.global.allow_local_ip
='0'
142 # clear LuCI indexcache
143 rm -f
/tmp
/luci-indexcache
>/dev
/null
2>&1
147 define Package
/$(PKG_NAME
)/prerm
149 # if run within buildroot exit
150 [ -n
"$${IPKG_INSTROOT}" ] && exit
0
152 # stop running scripts
153 /etc
/init.d
/ddns disable
154 /etc
/init.d
/ddns stop
156 # clear LuCI indexcache
157 rm -f
/tmp
/luci-indexcache
>/dev
/null
2>&1
162 ##### **********************************
163 define Package
/$(PKG_NAME
)_cloudflare
/install
164 $(INSTALL_DIR
) $(1)/usr
/lib
/ddns
165 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/update_cloudflare_com.sh
$(1)/usr
/lib
/ddns
166 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/files
/tld_names.dat.gz
$(1)/usr
/lib
/ddns
168 define Package
/$(PKG_NAME
)_cloudflare
/postinst
170 echo
-e
'"cloudflare.com"\t"update_cloudflare_com.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
171 echo
-e
'"cloudflare.com"\t"update_cloudflare_com.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services_ipv6
172 /bin
/sed
-i
'/service_name/s/CloudFlare/cloudflare\.com/g' $${IPKG_INSTROOT}/etc
/config
/ddns
174 define Package
/$(PKG_NAME
)_cloudflare
/prerm
176 /bin
/sed
-i
'/update_cloudflare_com\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
177 /bin
/sed
-i
'/update_cloudflare_com\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services_ipv6
180 ##### **********************************
181 define Package
/$(PKG_NAME
)_no-ip_com
/install
182 $(INSTALL_DIR
) $(1)/usr
/lib
/ddns
183 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/update_no-ip_com.sh
$(1)/usr
/lib
/ddns
185 define Package
/$(PKG_NAME
)_no-ip_com
/postinst
187 echo
-e
'"no-ip.com"\t"update_no-ip_com.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
188 /bin
/sed
-i
'/service_name/s/NoIP\.com/no-ip\.com/g' $${IPKG_INSTROOT}/etc
/config
/ddns
189 /bin
/sed
-i
'/service_name/s/No-IP\.com/no-ip\.com/g' $${IPKG_INSTROOT}/etc
/config
/ddns
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
205 /bin
/sed
-i
'/service_name/s/Bind-nsupdate/bind-nsupdate/g' $${IPKG_INSTROOT}/etc
/config
/ddns
207 define Package
/$(PKG_NAME
)_nsupdate
/prerm
209 /bin
/sed
-i
'/update_nsupdate\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
210 /bin
/sed
-i
'/update_nsupdate\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services_ipv6
213 ##### **********************************
214 $(eval
$(call BuildPackage
,$(PKG_NAME
)))
215 $(eval
$(call BuildPackage
,$(PKG_NAME
)_cloudflare
))
216 $(eval
$(call BuildPackage
,$(PKG_NAME
)_no-ip_com
))
217 $(eval
$(call BuildPackage
,$(PKG_NAME
)_nsupdate
))