libgd: avoid recursive and redundant dependencies
[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:=26
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 gandi.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 define Package/ddns-scripts-one
241 $(call Package/ddns-scripts/Default)
242 TITLE:=Extension for one.com Control Panel
243 DEPENDS:=ddns-scripts +curl
244 endef
245
246 define Package/ddns-scrtips-one/description
247 Dynamic DNS Client scripts extension for "one.com".
248 It requires:
249 "option username" to be a valid Email for one.com Control Panel
250 "option password" to be the matching one.com Control Panel password
251 "option domain" to contain the domain / subdomain
252 endef
253
254
255 define Build/Configure
256 endef
257
258 define Build/Compile
259 endef
260
261
262 define Package/ddns-scripts/install
263 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
264 $(INSTALL_DATA) ./files/etc/hotplug.d/iface/ddns \
265 $(1)/etc/hotplug.d/iface/95-ddns
266
267 $(INSTALL_DIR) $(1)/etc/init.d
268 $(INSTALL_BIN) ./files/etc/init.d/ddns \
269 $(1)/etc/init.d/ddns
270
271 $(INSTALL_DIR) $(1)/etc/config
272 $(INSTALL_CONF) ./files/etc/config/ddns \
273 $(1)/etc/config/ddns
274
275 $(INSTALL_DIR) $(1)/usr/share/ddns
276 echo "$(PKG_VERSION)-$(PKG_RELEASE)" > $(1)/usr/share/ddns/version
277
278 $(INSTALL_DIR) $(1)/usr/lib/ddns
279 $(INSTALL_DATA) ./files/usr/lib/ddns/dynamic_dns_functions.sh \
280 $(1)/usr/lib/ddns
281 $(INSTALL_BIN) ./files/usr/lib/ddns/dynamic_dns_lucihelper.sh \
282 $(1)/usr/lib/ddns
283 $(INSTALL_BIN) ./files/usr/lib/ddns/dynamic_dns_updater.sh \
284 $(1)/usr/lib/ddns
285
286 $(INSTALL_DIR) $(1)/usr/bin
287 $(INSTALL_BIN) ./files/usr/bin/ddns.sh \
288 $(1)/usr/bin/ddns
289 endef
290
291 define Package/ddns-scripts/postinst
292 #!/bin/sh
293 if [ -z "$${IPKG_INSTROOT}" ]; then
294 /etc/init.d/ddns enabled
295 /etc/init.d/ddns start
296 fi
297 exit 0
298 endef
299
300 define Package/ddns-scripts/prerm
301 #!/bin/sh
302 if [ -n "$${IPKG_INSTROOT}" ]; then
303 /etc/init.d/ddns stop
304 /etc/init.d/ddns disable
305 fi
306 exit 0
307 endef
308
309
310 define Package/ddns-scripts-services/install
311 $(INSTALL_DIR) $(1)/usr/share/ddns/default
312 $(INSTALL_DATA) ./files/usr/share/ddns/default/* \
313 $(1)/usr/share/ddns/default
314
315 # Remove special services
316 rm $(1)/usr/share/ddns/default/cloudflare.com-v4.json
317 rm $(1)/usr/share/ddns/default/freedns.42.pl.json
318 rm $(1)/usr/share/ddns/default/godaddy.com-v1.json
319 rm $(1)/usr/share/ddns/default/digitalocean.com-v2.json
320 rm $(1)/usr/share/ddns/default/dnspod.cn.json
321 rm $(1)/usr/share/ddns/default/no-ip.com.json
322 rm $(1)/usr/share/ddns/default/bind-nsupdate.json
323 rm $(1)/usr/share/ddns/default/route53-v1.json
324 rm $(1)/usr/share/ddns/default/cnkuai.cn.json
325 rm $(1)/usr/share/ddns/default/gandi.net.json
326 rm $(1)/usr/share/ddns/default/pdns.json
327 rm $(1)/usr/share/ddns/default/transip.nl.json
328 rm $(1)/usr/share/ddns/default/ns1.com.json
329 rm $(1)/usr/share/ddns/default/one.com.json
330 endef
331
332
333 define Package/ddns-scripts-cloudflare/install
334 $(INSTALL_DIR) $(1)/usr/lib/ddns
335 $(INSTALL_BIN) ./files/usr/lib/ddns/update_cloudflare_com_v4.sh \
336 $(1)/usr/lib/ddns
337
338 $(INSTALL_DIR) $(1)/usr/share/ddns/default
339 $(INSTALL_DATA) ./files/usr/share/ddns/default/cloudflare.com-v4.json \
340 $(1)/usr/share/ddns/default/
341 endef
342
343 define Package/ddns-scripts-cloudflare/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-freedns/install
353 $(INSTALL_DIR) $(1)/usr/lib/ddns
354 $(INSTALL_BIN) ./files/usr/lib/ddns/update_freedns_42_pl.sh \
355 $(1)/usr/lib/ddns
356
357 $(INSTALL_DIR) $(1)/usr/share/ddns/default
358 $(INSTALL_DATA) ./files/usr/share/ddns/default/freedns.42.pl.json \
359 $(1)/usr/share/ddns/default
360 endef
361
362 define Package/ddns-scripts-freedns/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-godaddy/install
372 $(INSTALL_DIR) $(1)/usr/lib/ddns
373 $(INSTALL_BIN) ./files/usr/lib/ddns/update_godaddy_com_v1.sh \
374 $(1)/usr/lib/ddns
375
376 $(INSTALL_DIR) $(1)/usr/share/ddns/default
377 $(INSTALL_DATA) ./files/usr/share/ddns/default/godaddy.com-v1.json \
378 $(1)/usr/share/ddns/default
379 endef
380
381 define Package/ddns-scripts-godaddy/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-digitalocean/install
391 $(INSTALL_DIR) $(1)/usr/lib/ddns
392 $(INSTALL_BIN) ./files/usr/lib/ddns/update_digitalocean_com_v2.sh \
393 $(1)/usr/lib/ddns
394
395 $(INSTALL_DIR) $(1)/usr/share/ddns/default
396 $(INSTALL_DATA) ./files/usr/share/ddns/default/digitalocean.com-v2.json \
397 $(1)/usr/share/ddns/default
398 endef
399
400 define Package/ddns-scripts-digitalocean/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-dnspod/install
410 $(INSTALL_DIR) $(1)/usr/lib/ddns
411 $(INSTALL_BIN) ./files/usr/lib/ddns/update_dnspod_cn.sh \
412 $(1)/usr/lib/ddns
413
414 $(INSTALL_DIR) $(1)/usr/share/ddns/default
415 $(INSTALL_DATA) ./files/usr/share/ddns/default/dnspod.cn.json \
416 $(1)/usr/share/ddns/default/
417 endef
418
419 define Package/ddns-scripts-dnspod/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 define Package/ddns-scripts-noip/install
429 $(INSTALL_DIR) $(1)/usr/lib/ddns
430 $(INSTALL_BIN) ./files/usr/lib/ddns/update_no-ip_com.sh \
431 $(1)/usr/lib/ddns
432
433 $(INSTALL_DIR) $(1)/usr/share/ddns/default
434 $(INSTALL_DATA) ./files/usr/share/ddns/default/no-ip.com.json \
435 $(1)/usr/share/ddns/default
436 endef
437
438 define Package/ddns-scripts-noip/prerm
439 #!/bin/sh
440 if [ -z "$${IPKG_INSTROOT}" ]; then
441 /etc/init.d/ddns stop
442 fi
443 exit 0
444 endef
445
446
447 define Package/ddns-scripts-ns1/install
448 $(INSTALL_DIR) $(1)/usr/lib/ddns
449 $(INSTALL_BIN) ./files/usr/lib/ddns/update_ns1_com.sh \
450 $(1)/usr/lib/ddns
451
452 $(INSTALL_DIR) $(1)/usr/share/ddns/default
453 $(INSTALL_DATA) ./files/usr/share/ddns/default/ns1.com.json \
454 $(1)/usr/share/ddns/default
455 endef
456
457 define Package/ddns-scripts-ns1/prerm
458 #!/bin/sh
459 if [ -z "$${IPKG_INSTROOT}" ]; then
460 /etc/init.d/ddns stop
461 fi
462 exit 0
463 endef
464
465
466 define Package/ddns-scripts-nsupdate/install
467 $(INSTALL_DIR) $(1)/usr/lib/ddns
468 $(INSTALL_BIN) ./files/usr/lib/ddns/update_nsupdate.sh \
469 $(1)/usr/lib/ddns
470
471 $(INSTALL_DIR) $(1)/usr/share/ddns/default
472 $(INSTALL_DATA) ./files/usr/share/ddns/default/bind-nsupdate.json \
473 $(1)/usr/share/ddns/default
474 endef
475
476 define Package/ddns-scripts-nsupdate/prerm
477 #!/bin/sh
478 if [ -z "$${IPKG_INSTROOT}" ]; then
479 /etc/init.d/ddns stop
480 fi
481 exit 0
482 endef
483
484
485 define Package/ddns-scripts-route53/install
486 $(INSTALL_DIR) $(1)/usr/lib/ddns
487 $(INSTALL_BIN) ./files/usr/lib/ddns/update_route53_v1.sh \
488 $(1)/usr/lib/ddns
489
490 $(INSTALL_DIR) $(1)/usr/share/ddns/default
491 $(INSTALL_DATA) ./files/usr/share/ddns/default/route53-v1.json \
492 $(1)/usr/share/ddns/default
493 endef
494
495 define Package/ddns-scripts-route53/prerm
496 #!/bin/sh
497 if [ -z "$${IPKG_INSTROOT}" ]; then
498 /etc/init.d/ddns stop
499 fi
500 exit 0
501 endef
502
503
504 define Package/ddns-scripts-cnkuai/install
505 $(INSTALL_DIR) $(1)/usr/lib/ddns
506 $(INSTALL_BIN) ./files/usr/lib/ddns/update_cnkuai_cn.sh \
507 $(1)/usr/lib/ddns
508
509 $(INSTALL_DIR) $(1)/usr/share/ddns/default
510 $(INSTALL_DATA) ./files/usr/share/ddns/default/cnkuai.cn.json \
511 $(1)/usr/share/ddns/default
512 endef
513
514 define Package/ddns-scripts-cnkuai/prerm
515 #!/bin/sh
516 if [ -z "$${IPKG_INSTROOT}" ]; then
517 /etc/init.d/ddns stop
518 fi
519 exit 0
520 endef
521
522
523 define Package/ddns-scripts-gandi/install
524 $(INSTALL_DIR) $(1)/usr/lib/ddns
525 $(INSTALL_BIN) ./files/usr/lib/ddns/update_gandi_net.sh \
526 $(1)/usr/lib/ddns
527
528 $(INSTALL_DIR) $(1)/usr/share/ddns/default
529 $(INSTALL_DATA) ./files/usr/share/ddns/default/gandi.net.json \
530 $(1)/usr/share/ddns/default
531 endef
532
533 define Package/ddns-scripts-gandi/prerm
534 #!/bin/sh
535 if [ -z "$${IPKG_INSTROOT}" ]; then
536 /etc/init.d/ddns stop
537 fi
538 exit 0
539 endef
540
541
542 define Package/ddns-scripts-pdns/install
543 $(INSTALL_DIR) $(1)/usr/lib/ddns
544 $(INSTALL_BIN) ./files/usr/lib/ddns/update_pdns.sh \
545 $(1)/usr/lib/ddns
546
547 $(INSTALL_DIR) $(1)/usr/share/ddns/default
548 $(INSTALL_DATA) ./files/usr/share/ddns/default/pdns.json \
549 $(1)/usr/share/ddns/default
550 endef
551
552 define Package/ddns-scripts-pdns/prerm
553 #!/bin/sh
554 if [ -z "$${IPKG_INSTROOT}" ]; then
555 /etc/init.d/ddns stop
556 fi
557 exit 0
558 endef
559
560
561 define Package/ddns-scripts-transip/install
562 $(INSTALL_DIR) $(1)/usr/lib/ddns
563 $(INSTALL_BIN) ./files/usr/lib/ddns/update_transip_nl.sh \
564 $(1)/usr/lib/ddns
565
566 $(INSTALL_DIR) $(1)/usr/share/ddns/default
567 $(INSTALL_DATA) ./files/usr/share/ddns/default/transip.nl.json \
568 $(1)/usr/share/ddns/default
569 endef
570
571 define Package/ddns-scripts-transip/prerm
572 #!/bin/sh
573 if [ -z "$${IPKG_INSTROOT}" ]; then
574 /etc/init.d/ddns stop
575 fi
576 exit 0
577 endef
578
579
580 define Package/ddns-scripts-one/install
581 $(INSTALL_DIR) $(1)/usr/lib/ddns
582 $(INSTALL_BIN) ./files/usr/lib/ddns/update_one_com.sh \
583 $(1)/usr/lib/ddns
584
585 $(INSTALL_DIR) $(1)/usr/share/ddns/default
586 $(INSTALL_DATA) ./files/usr/share/ddns/default/one.com.json \
587 $(1)/usr/share/ddns/default
588 endef
589
590 define Package/ddns-scripts-one/prerm
591 #!/bin/sh
592 if [-z "${IPKG_INSTROOT}" ]; then
593 /etc/init.d/ddns stop
594 fi
595 exit 0
596 endef
597
598
599 $(eval $(call BuildPackage,ddns-scripts))
600 $(eval $(call BuildPackage,ddns-scripts-services))
601 $(eval $(call BuildPackage,ddns-scripts-cloudflare))
602 $(eval $(call BuildPackage,ddns-scripts-freedns))
603 $(eval $(call BuildPackage,ddns-scripts-godaddy))
604 $(eval $(call BuildPackage,ddns-scripts-digitalocean))
605 $(eval $(call BuildPackage,ddns-scripts-dnspod))
606 $(eval $(call BuildPackage,ddns-scripts-noip))
607 $(eval $(call BuildPackage,ddns-scripts-nsupdate))
608 $(eval $(call BuildPackage,ddns-scripts-route53))
609 $(eval $(call BuildPackage,ddns-scripts-cnkuai))
610 $(eval $(call BuildPackage,ddns-scripts-gandi))
611 $(eval $(call BuildPackage,ddns-scripts-pdns))
612 $(eval $(call BuildPackage,ddns-scripts-transip))
613 $(eval $(call BuildPackage,ddns-scripts-ns1))
614 $(eval $(call BuildPackage,ddns-scripts-one))