Merge pull request #17432 from r4sas/i2pd-2.40.0
[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:=21
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-dnspod
112 $(call Package/ddns-scripts/Default)
113 TITLE:=Extension for dnspod.cn API
114 DEPENDS:=ddns-scripts +curl
115 endef
116
117 define Package/ddns-scripts-dnspod/description
118 Dynamic DNS Client scripts extension for dnspod.cn API (require curl)
119 endef
120
121
122 define Package/ddns-scripts-noip
123 $(call Package/ddns-scripts/Default)
124 TITLE:=Extension for no-ip.com
125 DEPENDS:=ddns-scripts
126 endef
127
128 define Package/ddns-scripts-noip/description
129 Dynamic DNS Client scripts extension for "no-ip.com".
130 endef
131
132 define Package/ddns-scripts-ns1
133 $(call Package/ddns-scripts/Default)
134 TITLE:=NS1 API
135 DEPENDS:=ddns-scripts +curl
136 endef
137
138 define Package/ddns-scripts-ns1/description
139 Dynamic DNS Client scripts extension for "ns1.com".
140 It requires:
141 "option username" to be a valid zone for ns1.com
142 "option password" to be a valid API key for ns1.com
143 endef
144
145
146 define Package/ddns-scripts-nsupdate
147 $(call Package/ddns-scripts/Default)
148 TITLE:=Extension for using bind nsupdate.
149 DEPENDS:=ddns-scripts +bind-client
150 endef
151
152 define Package/ddns-scripts-nsupdate/description
153 Dynamic DNS Client scripts extension for direct updates using bind nsupdate
154 The script directly updates a PowerDNS (or maybe bind server) via nsupdate
155 from bind-client package.
156 It requires:
157 "option dns_server" to be set to the server to be used by nsupdate.
158 "option username" should be set to the key name and
159 "option password" to the base64 encoded shared secret.
160 endef
161
162
163 define Package/ddns-scripts-route53
164 $(call Package/ddns-scripts/Default)
165 TITLE:=Extension for route53 API v1
166 DEPENDS:=ddns-scripts +curl +openssl-util
167 endef
168
169 define Package/ddns-scripts-route53/description
170 Dynamic DNS Client scripts extension for Amazon AWS "route53 API v1".
171 Note: You must also install ca-certificate or ca-bundle.
172 It requires:
173 "option username" to be a valid AWS access key id
174 "option password" to be the matching AWS secret key id
175 "option domain" to contain the hosted zone ID
176 endef
177
178
179 define Package/ddns-scripts-cnkuai
180 $(call Package/ddns-scripts/Default)
181 TITLE:=CnKuai API
182 DEPENDS:=ddns-scripts +curl +giflib-utils
183 endef
184
185 define Package/ddns-scripts-cnkuai/description
186 Dynamic DNS Client scripts extension for "cnkuai.cn".
187 It requires:
188 "option username" to be a valid CnKuai control panel id
189 "option password" to be the matching CnKuai control panel password
190 "option domain" to contain the domain
191 endef
192
193
194 define Package/ddns-scripts-gandi
195 $(call Package/ddns-scripts/Default)
196 TITLE:=Gandi API
197 DEPENDS:=ddns-scripts +curl
198 endef
199
200 define Package/ddns-scripts-gandi/description
201 Dynamic DNS Client scripts extension for "gandi.net".
202 It requires:
203 "option username" to be a valid subdomain for gandi.net
204 "option password" to be a valid API key for ganid.net
205 endef
206
207
208 define Package/ddns-scripts-pdns
209 $(call Package/ddns-scripts/Default)
210 TITLE:=PowerDNS API
211 DEPENDS:=ddns-scripts +curl
212 endef
213
214 define Package/ddns-scripts-pdns/description
215 Dynamic DNS Client scripts extension for "PowerDNS" via API.
216 It requires:
217 "option param_opt(Optional Parameter)" to be a valid root URL for the PowerDNS webserver
218 "option username" to be a valid subdomain for the PowerDNS domain
219 "option password" to be a valid API key for the PowerDNS webserver
220 endef
221
222
223 define Package/ddns-scripts-transip
224 $(call Package/ddns-scripts/Default)
225 TITLE:=Extension for TransIP API
226 DEPENDS:=ddns-scripts +curl +openssl-util +!BUSYBOX_CONFIG_MKTEMP:coreutils-mktemp
227 endef
228
229 define Package/ddns-scripts-transip/description
230 Dynamic DNS Client scripts extension for "transip.nl".
231 Note: You must also install ca-certificate or ca-bundle.
232 It requires:
233 "option username" to be a valid username for transip.nl
234 "option password" to be a valid matching private key
235 "option domain" to contain the base domain
236 "option param_enc" to contain the name of the DNS record to update
237 "option param_opt" to contain the TTL of the DNS record to update
238 endef
239
240
241 define Build/Configure
242 endef
243
244 define Build/Compile
245 endef
246
247
248 define Package/ddns-scripts/install
249 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
250 $(INSTALL_DATA) ./files/etc/hotplug.d/iface/ddns \
251 $(1)/etc/hotplug.d/iface/95-ddns
252
253 $(INSTALL_DIR) $(1)/etc/init.d
254 $(INSTALL_BIN) ./files/etc/init.d/ddns \
255 $(1)/etc/init.d/ddns
256
257 $(INSTALL_DIR) $(1)/etc/config
258 $(INSTALL_CONF) ./files/etc/config/ddns \
259 $(1)/etc/config/ddns
260
261 $(INSTALL_DIR) $(1)/usr/share/ddns
262 echo "$(PKG_VERSION)-$(PKG_RELEASE)" > $(1)/usr/share/ddns/version
263
264 $(INSTALL_DIR) $(1)/usr/lib/ddns
265 $(INSTALL_DATA) ./files/usr/lib/ddns/dynamic_dns_functions.sh \
266 $(1)/usr/lib/ddns
267 $(INSTALL_BIN) ./files/usr/lib/ddns/dynamic_dns_lucihelper.sh \
268 $(1)/usr/lib/ddns
269 $(INSTALL_BIN) ./files/usr/lib/ddns/dynamic_dns_updater.sh \
270 $(1)/usr/lib/ddns
271
272 $(INSTALL_DIR) $(1)/usr/bin
273 $(INSTALL_BIN) ./files/usr/bin/ddns.sh \
274 $(1)/usr/bin/ddns
275 endef
276
277 define Package/ddns-scripts/postinst
278 #!/bin/sh
279 if [ -z "$${IPKG_INSTROOT}" ]; then
280 /etc/init.d/ddns enabled
281 /etc/init.d/ddns start
282 fi
283 exit 0
284 endef
285
286 define Package/ddns-scripts/prerm
287 #!/bin/sh
288 if [ -n "$${IPKG_INSTROOT}" ]; then
289 /etc/init.d/ddns stop
290 /etc/init.d/ddns disable
291 fi
292 exit 0
293 endef
294
295
296 define Package/ddns-scripts-services/install
297 $(INSTALL_DIR) $(1)/usr/share/ddns/default
298 $(INSTALL_DATA) ./files/usr/share/ddns/default/* \
299 $(1)/usr/share/ddns/default
300
301 # Remove special services
302 rm $(1)/usr/share/ddns/default/cloudflare.com-v4.json
303 rm $(1)/usr/share/ddns/default/freedns.42.pl.json
304 rm $(1)/usr/share/ddns/default/godaddy.com-v1.json
305 rm $(1)/usr/share/ddns/default/digitalocean.com-v2.json
306 rm $(1)/usr/share/ddns/default/dnspod.cn.json
307 rm $(1)/usr/share/ddns/default/no-ip.com.json
308 rm $(1)/usr/share/ddns/default/bind-nsupdate.json
309 rm $(1)/usr/share/ddns/default/route53-v1.json
310 rm $(1)/usr/share/ddns/default/cnkuai.cn.json
311 rm $(1)/usr/share/ddns/default/gandi.net.json
312 rm $(1)/usr/share/ddns/default/pdns.json
313 rm $(1)/usr/share/ddns/default/transip.nl.json
314 rm $(1)/usr/share/ddns/default/ns1.com.json
315 endef
316
317
318 define Package/ddns-scripts-cloudflare/install
319 $(INSTALL_DIR) $(1)/usr/lib/ddns
320 $(INSTALL_BIN) ./files/usr/lib/ddns/update_cloudflare_com_v4.sh \
321 $(1)/usr/lib/ddns
322
323 $(INSTALL_DIR) $(1)/usr/share/ddns/default
324 $(INSTALL_DATA) ./files/usr/share/ddns/default/cloudflare.com-v4.json \
325 $(1)/usr/share/ddns/default/
326 endef
327
328 define Package/ddns-scripts-cloudflare/prerm
329 #!/bin/sh
330 if [ -z "$${IPKG_INSTROOT}" ]; then
331 /etc/init.d/ddns stop
332 fi
333 exit 0
334 endef
335
336
337 define Package/ddns-scripts-freedns/install
338 $(INSTALL_DIR) $(1)/usr/lib/ddns
339 $(INSTALL_BIN) ./files/usr/lib/ddns/update_freedns_42_pl.sh \
340 $(1)/usr/lib/ddns
341
342 $(INSTALL_DIR) $(1)/usr/share/ddns/default
343 $(INSTALL_DATA) ./files/usr/share/ddns/default/freedns.42.pl.json \
344 $(1)/usr/share/ddns/default
345 endef
346
347 define Package/ddns-scripts-freedns/prerm
348 #!/bin/sh
349 if [ -z "$${IPKG_INSTROOT}" ]; then
350 /etc/init.d/ddns stop
351 fi
352 exit 0
353 endef
354
355
356 define Package/ddns-scripts-godaddy/install
357 $(INSTALL_DIR) $(1)/usr/lib/ddns
358 $(INSTALL_BIN) ./files/usr/lib/ddns/update_godaddy_com_v1.sh \
359 $(1)/usr/lib/ddns
360
361 $(INSTALL_DIR) $(1)/usr/share/ddns/default
362 $(INSTALL_DATA) ./files/usr/share/ddns/default/godaddy.com-v1.json \
363 $(1)/usr/share/ddns/default
364 endef
365
366 define Package/ddns-scripts-godaddy/prerm
367 #!/bin/sh
368 if [ -z "$${IPKG_INSTROOT}" ]; then
369 /etc/init.d/ddns stop
370 fi
371 exit 0
372 endef
373
374
375 define Package/ddns-scripts-digitalocean/install
376 $(INSTALL_DIR) $(1)/usr/lib/ddns
377 $(INSTALL_BIN) ./files/usr/lib/ddns/update_digitalocean_com_v2.sh \
378 $(1)/usr/lib/ddns
379
380 $(INSTALL_DIR) $(1)/usr/share/ddns/default
381 $(INSTALL_DATA) ./files/usr/share/ddns/default/digitalocean.com-v2.json \
382 $(1)/usr/share/ddns/default
383 endef
384
385 define Package/ddns-scripts-digitalocean/prerm
386 #!/bin/sh
387 if [ -z "$${IPKG_INSTROOT}" ]; then
388 /etc/init.d/ddns stop
389 fi
390 exit 0
391 endef
392
393
394 define Package/ddns-scripts-dnspod/install
395 $(INSTALL_DIR) $(1)/usr/lib/ddns
396 $(INSTALL_BIN) ./files/usr/lib/ddns/update_dnspod_cn.sh \
397 $(1)/usr/lib/ddns
398
399 $(INSTALL_DIR) $(1)/usr/share/ddns/default
400 $(INSTALL_DATA) ./files/usr/share/ddns/default/dnspod.cn.json \
401 $(1)/usr/share/ddns/default/
402 endef
403
404 define Package/ddns-scripts-dnspod/prerm
405 #!/bin/sh
406 if [ -z "$${IPKG_INSTROOT}" ]; then
407 /etc/init.d/ddns stop
408 fi
409 exit 0
410 endef
411
412
413 define Package/ddns-scripts-noip/install
414 $(INSTALL_DIR) $(1)/usr/lib/ddns
415 $(INSTALL_BIN) ./files/usr/lib/ddns/update_no-ip_com.sh \
416 $(1)/usr/lib/ddns
417
418 $(INSTALL_DIR) $(1)/usr/share/ddns/default
419 $(INSTALL_DATA) ./files/usr/share/ddns/default/no-ip.com.json \
420 $(1)/usr/share/ddns/default
421 endef
422
423 define Package/ddns-scripts-noip/prerm
424 #!/bin/sh
425 if [ -z "$${IPKG_INSTROOT}" ]; then
426 /etc/init.d/ddns stop
427 fi
428 exit 0
429 endef
430
431
432 define Package/ddns-scripts-ns1/install
433 $(INSTALL_DIR) $(1)/usr/lib/ddns
434 $(INSTALL_BIN) ./files/usr/lib/ddns/update_ns1_com.sh \
435 $(1)/usr/lib/ddns
436
437 $(INSTALL_DIR) $(1)/usr/share/ddns/default
438 $(INSTALL_DATA) ./files/usr/share/ddns/default/ns1.com.json \
439 $(1)/usr/share/ddns/default
440 endef
441
442 define Package/ddns-scripts-ns1/prerm
443 #!/bin/sh
444 if [ -z "$${IPKG_INSTROOT}" ]; then
445 /etc/init.d/ddns stop
446 fi
447 exit 0
448 endef
449
450
451 define Package/ddns-scripts-nsupdate/install
452 $(INSTALL_DIR) $(1)/usr/lib/ddns
453 $(INSTALL_BIN) ./files/usr/lib/ddns/update_nsupdate.sh \
454 $(1)/usr/lib/ddns
455
456 $(INSTALL_DIR) $(1)/usr/share/ddns/default
457 $(INSTALL_DATA) ./files/usr/share/ddns/default/bind-nsupdate.json \
458 $(1)/usr/share/ddns/default
459 endef
460
461 define Package/ddns-scripts-nsupdate/prerm
462 #!/bin/sh
463 if [ -z "$${IPKG_INSTROOT}" ]; then
464 /etc/init.d/ddns stop
465 fi
466 exit 0
467 endef
468
469
470 define Package/ddns-scripts-route53/install
471 $(INSTALL_DIR) $(1)/usr/lib/ddns
472 $(INSTALL_BIN) ./files/usr/lib/ddns/update_route53_v1.sh \
473 $(1)/usr/lib/ddns
474
475 $(INSTALL_DIR) $(1)/usr/share/ddns/default
476 $(INSTALL_DATA) ./files/usr/share/ddns/default/route53-v1.json \
477 $(1)/usr/share/ddns/default
478 endef
479
480 define Package/ddns-scripts-route53/prerm
481 #!/bin/sh
482 if [ -z "$${IPKG_INSTROOT}" ]; then
483 /etc/init.d/ddns stop
484 fi
485 exit 0
486 endef
487
488
489 define Package/ddns-scripts-cnkuai/install
490 $(INSTALL_DIR) $(1)/usr/lib/ddns
491 $(INSTALL_BIN) ./files/usr/lib/ddns/update_cnkuai_cn.sh \
492 $(1)/usr/lib/ddns
493
494 $(INSTALL_DIR) $(1)/usr/share/ddns/default
495 $(INSTALL_DATA) ./files/usr/share/ddns/default/cnkuai.cn.json \
496 $(1)/usr/share/ddns/default
497 endef
498
499 define Package/ddns-scripts-cnkuai/prerm
500 #!/bin/sh
501 if [ -z "$${IPKG_INSTROOT}" ]; then
502 /etc/init.d/ddns stop
503 fi
504 exit 0
505 endef
506
507
508 define Package/ddns-scripts-gandi/install
509 $(INSTALL_DIR) $(1)/usr/lib/ddns
510 $(INSTALL_BIN) ./files/usr/lib/ddns/update_gandi_net.sh \
511 $(1)/usr/lib/ddns
512
513 $(INSTALL_DIR) $(1)/usr/share/ddns/default
514 $(INSTALL_DATA) ./files/usr/share/ddns/default/gandi.net.json \
515 $(1)/usr/share/ddns/default
516 endef
517
518 define Package/ddns-scripts-gandi/prerm
519 #!/bin/sh
520 if [ -z "$${IPKG_INSTROOT}" ]; then
521 /etc/init.d/ddns stop
522 fi
523 exit 0
524 endef
525
526
527 define Package/ddns-scripts-pdns/install
528 $(INSTALL_DIR) $(1)/usr/lib/ddns
529 $(INSTALL_BIN) ./files/usr/lib/ddns/update_pdns.sh \
530 $(1)/usr/lib/ddns
531
532 $(INSTALL_DIR) $(1)/usr/share/ddns/default
533 $(INSTALL_DATA) ./files/usr/share/ddns/default/pdns.json \
534 $(1)/usr/share/ddns/default
535 endef
536
537 define Package/ddns-scripts-pdns/prerm
538 #!/bin/sh
539 if [ -z "$${IPKG_INSTROOT}" ]; then
540 /etc/init.d/ddns stop
541 fi
542 exit 0
543 endef
544
545
546 define Package/ddns-scripts-transip/install
547 $(INSTALL_DIR) $(1)/usr/lib/ddns
548 $(INSTALL_BIN) ./files/usr/lib/ddns/update_transip_nl.sh \
549 $(1)/usr/lib/ddns
550
551 $(INSTALL_DIR) $(1)/usr/share/ddns/default
552 $(INSTALL_DATA) ./files/usr/share/ddns/default/transip.nl.json \
553 $(1)/usr/share/ddns/default
554 endef
555
556 define Package/ddns-scripts-transip/prerm
557 #!/bin/sh
558 if [ -z "$${IPKG_INSTROOT}" ]; then
559 /etc/init.d/ddns stop
560 fi
561 exit 0
562 endef
563
564
565 $(eval $(call BuildPackage,ddns-scripts))
566 $(eval $(call BuildPackage,ddns-scripts-services))
567 $(eval $(call BuildPackage,ddns-scripts-cloudflare))
568 $(eval $(call BuildPackage,ddns-scripts-freedns))
569 $(eval $(call BuildPackage,ddns-scripts-godaddy))
570 $(eval $(call BuildPackage,ddns-scripts-digitalocean))
571 $(eval $(call BuildPackage,ddns-scripts-dnspod))
572 $(eval $(call BuildPackage,ddns-scripts-noip))
573 $(eval $(call BuildPackage,ddns-scripts-nsupdate))
574 $(eval $(call BuildPackage,ddns-scripts-route53))
575 $(eval $(call BuildPackage,ddns-scripts-cnkuai))
576 $(eval $(call BuildPackage,ddns-scripts-gandi))
577 $(eval $(call BuildPackage,ddns-scripts-pdns))
578 $(eval $(call BuildPackage,ddns-scripts-transip))
579 $(eval $(call BuildPackage,ddns-scripts-ns1))