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