treewide: change email
[feed/packages.git] / net / ddns-scripts / Makefile
1 #
2 # Copyright (C) 2008-2018 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 #
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=ddns-scripts
10 PKG_VERSION:=2.8.2
11 PKG_RELEASE:=10
12
13 PKG_LICENSE:=GPL-2.0
14
15 include $(INCLUDE_DIR)/package.mk
16
17 define Package/ddns-scripts/Default
18 SECTION:=net
19 CATEGORY:=Network
20 SUBMENU:=IP Addresses and Names
21 PKGARCH:=all
22 endef
23
24
25 define Package/ddns-scripts
26 $(call Package/ddns-scripts/Default)
27 TITLE:=Dynamic DNS Client scripts (with IPv6 support)
28 DEPENDS:=+ddns-scripts-services
29 endef
30
31 define Package/ddns-scripts/description
32 Dynamic DNS Client scripts (with IPv6 support)
33 A highly configurable set of scripts for doing dynamic dns updates.
34 - IPv6 support
35 - DNS server support
36 - Glue Record support (require BIND host or KNOT host)
37 - DNS requests via TCP
38 - Proxy server support
39 - log file support
40 - support to run once
41 Version: $(PKG_VERSION)-$(PKG_RELEASE)
42 Info : https://openwrt.org/docs/guide-user/services/ddns/client
43 endef
44
45 define Package/ddns-scripts/conffiles
46 /etc/config/ddns
47 endef
48
49
50 define Package/ddns-scripts-services
51 $(call Package/ddns-scripts/Default)
52 TITLE:=Common ddns providers
53 endef
54
55 define Package/ddns-scripts-services/description
56 Dynamic DNS Client definitions for supported services
57 endef
58
59
60 define Package/ddns-scripts-cloudflare
61 $(call Package/ddns-scripts/Default)
62 TITLE:=Extension for cloudflare.com API v4
63 DEPENDS:=ddns-scripts +curl
64 endef
65
66 define Package/ddns-scripts-cloudflare/description
67 Dynamic DNS Client scripts extension for cloudflare.com API v4 (require curl)
68 endef
69
70
71 define Package/ddns-scripts-freedns
72 $(call Package/ddns-scripts/Default)
73 TITLE:=Extension for freedns.42.pl
74 DEPENDS:=ddns-scripts +curl
75 endef
76
77 define Package/ddns-scripts-freedns/description
78 Dynamic DNS Client scripts extension for "freedns.42.pl".
79 endef
80
81
82 define Package/ddns-scripts-godaddy
83 $(call Package/ddns-scripts/Default)
84 TITLE:=Extension for godaddy.com API v1
85 DEPENDS:=ddns-scripts +curl
86 endef
87
88 define Package/ddns-scripts-godaddy/description
89 Dynamic DNS Client scripts extension for "godaddy.com API v1".
90 endef
91
92
93 define Package/ddns-scripts-digitalocean
94 $(call Package/ddns-scripts/Default)
95 TITLE:=Extention for digitalocean.com API v2
96 DEPENDS:=ddns-scripts +curl
97 endef
98
99 define Package/ddns-scripts-digitalocean/description
100 Dynamic DNS Client scripts extension for "digitalocean.com API v2".
101 The script directly updates a DNS record using the DO API.
102 It requires:
103 "option dns_server" to be set to the server to be used by nsupdate.
104 "option domain" the dns domain to update the record for (eg. A-record: home.<example.com>)
105 "option username" the dns record name to update (eg. A-record: <home>.example.com)
106 "option param_opt" the id of the dns record to update (check using chrome inspector in the DO dns tab)
107 "option password" the api token generated in the DO panel
108 endef
109
110
111 define Package/ddns-scripts-noip
112 $(call Package/ddns-scripts/Default)
113 TITLE:=Extension for no-ip.com
114 DEPENDS:=ddns-scripts
115 endef
116
117 define Package/ddns-scripts-noip/description
118 Dynamic DNS Client scripts extension for "no-ip.com".
119 endef
120
121
122 define Package/ddns-scripts-nsupdate
123 $(call Package/ddns-scripts/Default)
124 TITLE:=Extension for using bind nsupdate.
125 DEPENDS:=ddns-scripts +bind-client
126 endef
127
128 define Package/ddns-scripts-nsupdate/description
129 Dynamic DNS Client scripts extension for direct updates using bind nsupdate
130 The script directly updates a PowerDNS (or maybe bind server) via nsupdate
131 from bind-client package.
132 It requires:
133 "option dns_server" to be set to the server to be used by nsupdate.
134 "option username" should be set to the key name and
135 "option password" to the base64 encoded shared secret.
136 endef
137
138
139 define Package/ddns-scripts-route53
140 $(call Package/ddns-scripts/Default)
141 TITLE:=Extension for route53 API v1
142 DEPENDS:=ddns-scripts +curl +openssl-util
143 endef
144
145 define Package/ddns-scripts-route53/description
146 Dynamic DNS Client scripts extension for Amazon AWS "route53 API v1".
147 Note: You must also install ca-certificate or ca-bundle.
148 It requires:
149 "option username" to be a valid AWS access key id
150 "option password" to be the matching AWS secret key id
151 "option domain" to contain the hosted zone ID
152 endef
153
154
155 define Package/ddns-scripts-cnkuai
156 $(call Package/ddns-scripts/Default)
157 TITLE:=CnKuai API
158 DEPENDS:=ddns-scripts +curl +giflib-utils
159 endef
160
161 define Package/ddns-scripts-cnkuai/description
162 Dynamic DNS Client scripts extension for "cnkuai.cn".
163 It requires:
164 "option username" to be a valid CnKuai control panel id
165 "option password" to be the matching CnKuai control panel password
166 "option domain" to contain the domain
167 endef
168
169
170 define Package/ddns-scripts-gandi
171 $(call Package/ddns-scripts/Default)
172 TITLE:=Gandi API
173 DEPENDS:=ddns-scripts +curl
174 endef
175
176 define Package/ddns-scripts-gandi/description
177 Dynamic DNS Client scripts extension for "gandi.net".
178 It requires:
179 "option username" to be a valid subdomain for gandi.net
180 "option password" to be a valid API key for ganid.net
181 endef
182
183
184 define Build/Configure
185 endef
186
187 define Build/Compile
188 endef
189
190
191 define Package/ddns-scripts/install
192 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
193 $(INSTALL_DATA) ./files/etc/hotplug.d/iface/ddns \
194 $(1)/etc/hotplug.d/iface/95-ddns
195
196 $(INSTALL_DIR) $(1)/etc/init.d
197 $(INSTALL_BIN) ./files/etc/init.d/ddns \
198 $(1)/etc/init.d/ddns
199
200 $(INSTALL_DIR) $(1)/etc/config
201 $(INSTALL_CONF) ./files/etc/config/ddns \
202 $(1)/etc/config/ddns
203
204 $(INSTALL_DIR) $(1)/usr/share/ddns
205 echo "$(PKG_VERSION)-$(PKG_RELEASE)" > $(1)/usr/share/ddns/version
206
207 $(INSTALL_DIR) $(1)/usr/lib/ddns
208 $(INSTALL_DATA) ./files/usr/lib/ddns/dynamic_dns_functions.sh \
209 $(1)/usr/lib/ddns
210 $(INSTALL_BIN) ./files/usr/lib/ddns/dynamic_dns_lucihelper.sh \
211 $(1)/usr/lib/ddns
212 $(INSTALL_BIN) ./files/usr/lib/ddns/dynamic_dns_updater.sh \
213 $(1)/usr/lib/ddns
214
215 $(INSTALL_DIR) $(1)/usr/bin
216 $(INSTALL_BIN) ./files/usr/bin/ddns.sh \
217 $(1)/usr/bin/ddns
218 endef
219
220 define Package/ddns-scripts/postinst
221 #!/bin/sh
222 if [ -z "$${IPKG_INSTROOT}" ]; then
223 /etc/init.d/ddns enabled
224 /etc/init.d/ddns start
225 fi
226 exit 0
227 endef
228
229 define Package/ddns-scripts/prerm
230 #!/bin/sh
231 if [ -n "$${IPKG_INSTROOT}" ]; then
232 /etc/init.d/ddns stop
233 /etc/init.d/ddns disable
234 fi
235 exit 0
236 endef
237
238
239 define Package/ddns-scripts-services/install
240 $(INSTALL_DIR) $(1)/usr/share/ddns/default
241 $(INSTALL_DATA) ./files/usr/share/ddns/default/* \
242 $(1)/usr/share/ddns/default
243
244 # Remove special services
245 rm $(1)/usr/share/ddns/default/cloudflare.com-v4.json
246 rm $(1)/usr/share/ddns/default/freedns.42.pl.json
247 rm $(1)/usr/share/ddns/default/godaddy.com-v1.json
248 rm $(1)/usr/share/ddns/default/digitalocean.com-v2.json
249 rm $(1)/usr/share/ddns/default/no-ip.com.json
250 rm $(1)/usr/share/ddns/default/bind-nsupdate.json
251 rm $(1)/usr/share/ddns/default/route53-v1.json
252 rm $(1)/usr/share/ddns/default/cnkuai.cn.json
253 rm $(1)/usr/share/ddns/default/gandi.net.json
254 endef
255
256
257 define Package/ddns-scripts-cloudflare/install
258 $(INSTALL_DIR) $(1)/usr/lib/ddns
259 $(INSTALL_BIN) ./files/usr/lib/ddns/update_cloudflare_com_v4.sh \
260 $(1)/usr/lib/ddns
261
262 $(INSTALL_DIR) $(1)/usr/share/ddns/default
263 $(INSTALL_DATA) ./files/usr/share/ddns/default/cloudflare.com-v4.json \
264 $(1)/usr/share/ddns/default/
265 endef
266
267 define Package/ddns-scripts-cloudflare/prerm
268 #!/bin/sh
269 if [ -z "$${IPKG_INSTROOT}" ]; then
270 /etc/init.d/ddns stop
271 fi
272 exit 0
273 endef
274
275
276 define Package/ddns-scripts-freedns/install
277 $(INSTALL_DIR) $(1)/usr/lib/ddns
278 $(INSTALL_BIN) ./files/usr/lib/ddns/update_freedns_42_pl.sh \
279 $(1)/usr/lib/ddns
280
281 $(INSTALL_DIR) $(1)/usr/share/ddns/default
282 $(INSTALL_DATA) ./files/usr/share/ddns/default/freedns.42.pl.json \
283 $(1)/usr/share/ddns/default
284 endef
285
286 define Package/ddns-scripts-freedns/prerm
287 #!/bin/sh
288 if [ -z "$${IPKG_INSTROOT}" ]; then
289 /etc/init.d/ddns stop
290 fi
291 exit 0
292 endef
293
294
295 define Package/ddns-scripts-godaddy/install
296 $(INSTALL_DIR) $(1)/usr/lib/ddns
297 $(INSTALL_BIN) ./files/usr/lib/ddns/update_godaddy_com_v1.sh \
298 $(1)/usr/lib/ddns
299
300 $(INSTALL_DIR) $(1)/usr/share/ddns/default
301 $(INSTALL_DATA) ./files/usr/share/ddns/default/godaddy.com-v1.json \
302 $(1)/usr/share/ddns/default
303 endef
304
305 define Package/ddns-scripts-godaddy/prerm
306 #!/bin/sh
307 if [ -z "$${IPKG_INSTROOT}" ]; then
308 /etc/init.d/ddns stop
309 fi
310 exit 0
311 endef
312
313
314 define Package/ddns-scripts-digitalocean/install
315 $(INSTALL_DIR) $(1)/usr/lib/ddns
316 $(INSTALL_BIN) ./files/usr/lib/ddns/update_digitalocean_com_v2.sh \
317 $(1)/usr/lib/ddns
318
319 $(INSTALL_DIR) $(1)/usr/share/ddns/default
320 $(INSTALL_DATA) ./files/usr/share/ddns/default/digitalocean.com-v2.json \
321 $(1)/usr/share/ddns/default
322 endef
323
324 define Package/ddns-scripts-digitalocean/prerm
325 #!/bin/sh
326 if [ -z "$${IPKG_INSTROOT}" ]; then
327 /etc/init.d/ddns stop
328 fi
329 exit 0
330 endef
331
332
333 define Package/ddns-scripts-noip/install
334 $(INSTALL_DIR) $(1)/usr/lib/ddns
335 $(INSTALL_BIN) ./files/usr/lib/ddns/update_no-ip_com.sh \
336 $(1)/usr/lib/ddns
337
338 $(INSTALL_DIR) $(1)/usr/share/ddns/default
339 $(INSTALL_DATA) ./files/usr/share/ddns/default/no-ip.com.json \
340 $(1)/usr/share/ddns/default
341 endef
342
343 define Package/ddns-scripts-noip/prerm
344 #!/bin/sh
345 if [ -z "$${IPKG_INSTROOT}" ]; then
346 /etc/init.d/ddns stop
347 fi
348 exit 0
349 endef
350
351
352 define Package/ddns-scripts-nsupdate/install
353 $(INSTALL_DIR) $(1)/usr/lib/ddns
354 $(INSTALL_BIN) ./files/usr/lib/ddns/update_nsupdate.sh \
355 $(1)/usr/lib/ddns
356
357 $(INSTALL_DIR) $(1)/usr/share/ddns/default
358 $(INSTALL_DATA) ./files/usr/share/ddns/default/bind-nsupdate.json \
359 $(1)/usr/share/ddns/default
360 endef
361
362 define Package/ddns-scripts-nsupdate/prerm
363 #!/bin/sh
364 if [ -z "$${IPKG_INSTROOT}" ]; then
365 /etc/init.d/ddns stop
366 fi
367 exit 0
368 endef
369
370
371 define Package/ddns-scripts-route53/install
372 $(INSTALL_DIR) $(1)/usr/lib/ddns
373 $(INSTALL_BIN) ./files/usr/lib/ddns/update_route53_v1.sh \
374 $(1)/usr/lib/ddns
375
376 $(INSTALL_DIR) $(1)/usr/share/ddns/default
377 $(INSTALL_DATA) ./files/usr/share/ddns/default/route53-v1.json \
378 $(1)/usr/share/ddns/default
379 endef
380
381 define Package/ddns-scripts-route53/prerm
382 #!/bin/sh
383 if [ -z "$${IPKG_INSTROOT}" ]; then
384 /etc/init.d/ddns stop
385 fi
386 exit 0
387 endef
388
389
390 define Package/ddns-scripts-cnkuai/install
391 $(INSTALL_DIR) $(1)/usr/lib/ddns
392 $(INSTALL_BIN) ./files/usr/lib/ddns/update_cnkuai_cn.sh \
393 $(1)/usr/lib/ddns
394
395 $(INSTALL_DIR) $(1)/usr/share/ddns/default
396 $(INSTALL_DATA) ./files/usr/share/ddns/default/cnkuai.cn.json \
397 $(1)/usr/share/ddns/default
398 endef
399
400 define Package/ddns-scripts-cnkuai/prerm
401 #!/bin/sh
402 if [ -z "$${IPKG_INSTROOT}" ]; then
403 /etc/init.d/ddns stop
404 fi
405 exit 0
406 endef
407
408
409 define Package/ddns-scripts-gandi/install
410 $(INSTALL_DIR) $(1)/usr/lib/ddns
411 $(INSTALL_BIN) ./files/usr/lib/ddns/update_gandi_net.sh \
412 $(1)/usr/lib/ddns
413
414 $(INSTALL_DIR) $(1)/usr/share/ddns/default
415 $(INSTALL_DATA) ./files/usr/share/ddns/default/gandi.net.json \
416 $(1)/usr/share/ddns/default
417 endef
418
419 define Package/ddns-scripts-gandi/prerm
420 #!/bin/sh
421 if [ -z "$${IPKG_INSTROOT}" ]; then
422 /etc/init.d/ddns stop
423 fi
424 exit 0
425 endef
426
427
428 $(eval $(call BuildPackage,ddns-scripts))
429 $(eval $(call BuildPackage,ddns-scripts-services))
430 $(eval $(call BuildPackage,ddns-scripts-cloudflare))
431 $(eval $(call BuildPackage,ddns-scripts-freedns))
432 $(eval $(call BuildPackage,ddns-scripts-godaddy))
433 $(eval $(call BuildPackage,ddns-scripts-digitalocean))
434 $(eval $(call BuildPackage,ddns-scripts-noip))
435 $(eval $(call BuildPackage,ddns-scripts-nsupdate))
436 $(eval $(call BuildPackage,ddns-scripts-route53))
437 $(eval $(call BuildPackage,ddns-scripts-cnkuai))
438 $(eval $(call BuildPackage,ddns-scripts-gandi))