From 686fd42bb557ca6eb2ed1f2670a56b0438b8b55c Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 16 Sep 2020 14:49:26 +0200 Subject: [PATCH] ddns-scripts: cleanup Makefile Signed-off-by: Florian Eckert --- net/ddns-scripts/Makefile | 232 +++++++++++++++++++++----------------- 1 file changed, 129 insertions(+), 103 deletions(-) diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile index 50ab010eff..a61d905a9f 100755 --- a/net/ddns-scripts/Makefile +++ b/net/ddns-scripts/Makefile @@ -7,164 +7,158 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ddns-scripts -# Version == major.minor.patch -# increase on new functionality (minor) or patches (patch) PKG_VERSION:=2.7.8 -# Release == build -# increase on changes of services files or tld_names.dat PKG_RELEASE:=24 PKG_LICENSE:=GPL-2.0 -PKG_MAINTAINER:= include $(INCLUDE_DIR)/package.mk -# no default dependencies -PKG_DEFAULT_DEPENDS= - define Package/ddns-scripts/Default - SECTION:=net - CATEGORY:=Network - SUBMENU:=IP Addresses and Names - PKGARCH:=all + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + PKGARCH:=all endef -###### ************************************************************************* + define Package/ddns-scripts - $(call Package/ddns-scripts/Default) - TITLE:=Dynamic DNS Client scripts (with IPv6 support) + $(call Package/ddns-scripts/Default) + TITLE:=Dynamic DNS Client scripts (with IPv6 support) endef -# shown in LuCI package description + define Package/ddns-scripts/description - Dynamic DNS Client scripts (with IPv6 support) - Info: https://openwrt.org/docs/guide-user/services/ddns/client -endef -# shown in menuconfig -define Package/ddns-scripts/config - help - A highly configurable set of scripts for doing dynamic dns updates. - - IPv6 support - - DNS server support - - Glue Record support (require BIND host or KNOT host) - - DNS requests via TCP - - Proxy server support - - log file support - - support to run once - Version: $(PKG_VERSION)-$(PKG_RELEASE) - Info : https://openwrt.org/docs/guide-user/services/ddns/client + Dynamic DNS Client scripts (with IPv6 support) + A highly configurable set of scripts for doing dynamic dns updates. + - IPv6 support + - DNS server support + - Glue Record support (require BIND host or KNOT host) + - DNS requests via TCP + - Proxy server support + - log file support + - support to run once + Version: $(PKG_VERSION)-$(PKG_RELEASE) + Info : https://openwrt.org/docs/guide-user/services/ddns/client endef -###### ************************************************************************* +define Package/ddns-scripts/conffiles +/etc/config/ddns +endef + + define Package/ddns-scripts_cloudflare.com-v4 - $(call Package/ddns-scripts/Default) - TITLE:=CloudFlare.com API v4 (requires cURL) - DEPENDS:=ddns-scripts +curl + $(call Package/ddns-scripts/Default) + TITLE:=CloudFlare.com API v4 (requires cURL) + DEPENDS:=ddns-scripts +curl endef + define Package/ddns-scripts_cloudflare.com-v4/description - Dynamic DNS Client scripts extension for CloudFlare.com API-v4 (require/install cURL) + Dynamic DNS Client scripts extension for CloudFlare.com API-v4 (require/install cURL) endef -###### ************************************************************************* + define Package/ddns-scripts_freedns_42_pl - $(call Package/ddns-scripts/Default) - TITLE:=DDNS extension for FreeDNS.42.pl (requires cURL) - DEPENDS:=ddns-scripts +curl + $(call Package/ddns-scripts/Default) + TITLE:=DDNS extension for FreeDNS.42.pl (requires cURL) + DEPENDS:=ddns-scripts +curl endef + define Package/ddns-scripts_freedns_42_pl/description - Dynamic DNS Client scripts extension for freedns.42.pl + Dynamic DNS Client scripts extension for freedns.42.pl endef -###### ************************************************************************* + define Package/ddns-scripts_godaddy.com-v1 - $(call Package/ddns-scripts/Default) - TITLE:=GoDaddy.com (require cURL) - DEPENDS:=ddns-scripts +curl + $(call Package/ddns-scripts/Default) + TITLE:=GoDaddy.com (require cURL) + DEPENDS:=ddns-scripts +curl endef + define Package/ddns-scripts_godaddy.com-v1/description - Dynamic DNS Client scripts extension for GoDaddy.com (require/install cURL) + Dynamic DNS Client scripts extension for GoDaddy.com (require/install cURL) endef -###### ************************************************************************* + define Package/ddns-scripts_digitalocean.com-v2 - $(call Package/ddns-scripts/Default) - TITLE:=digitalocean.com (require cURL) - DEPENDS:=ddns-scripts +curl + $(call Package/ddns-scripts/Default) + TITLE:=digitalocean.com (require cURL) + DEPENDS:=ddns-scripts +curl endef + define Package/ddns-scripts_digitalocean.com-v2/description - Dynamic DNS Client scripts extension for digitalocean.com (require/install cURL) + Dynamic DNS Client scripts extension for digitalocean.com (require/install cURL) + The script directly updates a DNS record using the DO API. It requires + "option dns_server" to be set to the server to be used by nsupdate. + "option domain" the dns domain to update the record for (eg. A-record: home.) + "option username" the dns record name to update (eg. A-record: .example.com) + "option param_opt" the id of the dns record to update (check using chrome inspector in the DO dns tab) + "option password" the api token generated in the DO panel endef -define Package/ddns-scripts_digitalocean.com-v2/config - help - The script directly updates a DNS record using the DO API. It requires - "option dns_server" to be set to the server to be used by nsupdate. - "option domain" the dns domain to update the record for (eg. A-record: home.) - "option username" the dns record name to update (eg. A-record: .example.com) - "option param_opt" the id of the dns record to update (check using chrome inspector in the DO dns tab) - "option password" the api token generated in the DO panel -endef -###### ************************************************************************* define Package/ddns-scripts_no-ip_com - $(call Package/ddns-scripts/Default) - TITLE:=DDNS extension for No-IP.com - DEPENDS:=ddns-scripts + $(call Package/ddns-scripts/Default) + TITLE:=DDNS extension for No-IP.com + DEPENDS:=ddns-scripts endef + define Package/ddns-scripts_no-ip_com/description - Dynamic DNS Client scripts extension for No-IP.com + Dynamic DNS Client scripts extension for No-IP.com endef -###### ************************************************************************* + define Package/ddns-scripts_nsupdate - $(call Package/ddns-scripts/Default) - TITLE:=DDNS extension using Bind nsupdate - DEPENDS:=ddns-scripts +bind-client + $(call Package/ddns-scripts/Default) + TITLE:=DDNS extension using Bind nsupdate + DEPENDS:=ddns-scripts +bind-client endef + define Package/ddns-scripts_nsupdate/description - Dynamic DNS Client scripts extension for direct updates using Bind nsupdate + Dynamic DNS Client scripts extension for direct updates using Bind nsupdate + The script directly updates a PowerDNS (or maybe bind server) via nsupdate + from bind-client package. + It requires: + "option dns_server" to be set to the server to be used by nsupdate. + "option username" should be set to the key name and + "option password" to the base64 encoded shared secret. endef -define Package/ddns-scripts_nsupdate/config - help - The script directly updates a PowerDNS (or maybe bind server) via nsupdate - from bind-client package. It requires - "option dns_server" to be set to the server to be used by nsupdate. - "option username" should be set to the key name and - "option password" to the base64 encoded shared secret. -endef -###### ************************************************************************* define Package/ddns-scripts_route53-v1 - $(call Package/ddns-scripts/Default) - TITLE:=Amazon AWS Route 53 API v1 - DEPENDS:=ddns-scripts +curl +openssl-util + $(call Package/ddns-scripts/Default) + TITLE:=Amazon AWS Route 53 API v1 + DEPENDS:=ddns-scripts +curl +openssl-util endef + define Package/ddns-scripts_route53-v1/description - Dynamic DNS Client scripts extension for Amazon AWS Route53. Note: You - must also install ca-certificate or ca-bundle. - It requires: - "option username" to be a valid AWS access key id - "option password" to be the matching AWS secret key id - "option domain" to contain the hosted zone ID + Dynamic DNS Client scripts extension for Amazon AWS Route53. Note: You + must also install ca-certificate or ca-bundle. + It requires: + "option username" to be a valid AWS access key id + "option password" to be the matching AWS secret key id + "option domain" to contain the hosted zone ID endef -###### ************************************************************************* + define Package/ddns-scripts_cnkuai_cn - $(call Package/ddns-scripts/Default) - TITLE:=CnKuai API - DEPENDS:=ddns-scripts +curl +giflib-utils + $(call Package/ddns-scripts/Default) + TITLE:=CnKuai API + DEPENDS:=ddns-scripts +curl +giflib-utils endef + define Package/ddns-scripts_cnkuai_cn/description - Dynamic DNS Client scripts extension for CnKuai.Note: You - must also install giflib-utils. - It requires: - "option username" to be a valid CnKuai control panel id - "option password" to be the matching CnKuai control panel password - "option domain" to contain the domain + Dynamic DNS Client scripts extension for CnKuai.Note: You + must also install giflib-utils. + It requires: + "option username" to be a valid CnKuai control panel id + "option password" to be the matching CnKuai control panel password + "option domain" to contain the domain endef -###### ************************************************************************* + define Build/Configure endef + define Build/Compile $(CP) ./files $(PKG_BUILD_DIR) # ensure that VERSION inside dynamic_dns_functions.sh reflect PKG_VERSION of Makefile @@ -180,9 +174,6 @@ define Build/Compile done endef -define Package/ddns-scripts/conffiles -/etc/config/ddns -endef ###### ************************************************************************* define Package/ddns-scripts/preinst @@ -191,6 +182,7 @@ define Package/ddns-scripts/preinst [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 exit 0 # suppress errors endef + define Package/ddns-scripts/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns @@ -208,6 +200,7 @@ define Package/ddns-scripts/install $(INSTALL_DIR) $(1)/usr/lib/ddns $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dynamic_dns_*.sh $(1)/usr/lib/ddns endef + define Package/ddns-scripts/postinst #!/bin/sh # if NOT run buildroot and PKG_UPGRADE then (re)start service if enabled @@ -220,6 +213,7 @@ define Package/ddns-scripts/postinst } exit 0 # suppress errors endef + define Package/ddns-scripts/prerm #!/bin/sh # if run within buildroot exit @@ -232,6 +226,7 @@ define Package/ddns-scripts/prerm exit 0 # suppress errors endef + ###### ************************************************************************* define Package/ddns-scripts_cloudflare.com-v4/preinst #!/bin/sh @@ -239,6 +234,7 @@ define Package/ddns-scripts_cloudflare.com-v4/preinst [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 exit 0 # suppress errors endef + define Package/ddns-scripts_cloudflare.com-v4/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_cloudflare.com-v4 @@ -251,6 +247,7 @@ define Package/ddns-scripts_cloudflare.com-v4/install $(INSTALL_DATA) ./files/usr/share/ddns/services/cloudflare.com-v4.json \ $(1)/usr/share/ddns/services/ endef + define Package/ddns-scripts_cloudflare.com-v4/postinst #!/bin/sh # on real system restart service if enabled @@ -263,6 +260,7 @@ define Package/ddns-scripts_cloudflare.com-v4/postinst } exit 0 # suppress errors endef + define Package/ddns-scripts_cloudflare.com-v4/prerm #!/bin/sh # if NOT run buildroot then stop service @@ -270,6 +268,7 @@ define Package/ddns-scripts_cloudflare.com-v4/prerm exit 0 # suppress errors endef + ###### ************************************************************************* define Package/ddns-scripts_freedns_42_pl/preinst #!/bin/sh @@ -277,6 +276,7 @@ define Package/ddns-scripts_freedns_42_pl/preinst [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 exit 0 # suppress errors endef + define Package/ddns-scripts_freedns_42_pl/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_freedns_42_pl @@ -289,6 +289,7 @@ define Package/ddns-scripts_freedns_42_pl/install $(INSTALL_DATA) ./files/usr/share/ddns/services/freedns.42.pl.json \ $(1)/usr/share/ddns/services endef + define Package/ddns-scripts_freedns_42_pl/postinst #!/bin/sh # on real system restart service if enabled @@ -301,6 +302,7 @@ define Package/ddns-scripts_freedns_42_pl/postinst } exit 0 # suppress errors endef + define Package/ddns-scripts_freedns_42_pl/prerm #!/bin/sh # if NOT run buildroot then stop service @@ -308,6 +310,7 @@ define Package/ddns-scripts_freedns_42_pl/prerm exit 0 # suppress errors endef + ###### ************************************************************************* define Package/ddns-scripts_godaddy.com-v1/preinst #!/bin/sh @@ -315,6 +318,7 @@ define Package/ddns-scripts_godaddy.com-v1/preinst [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 exit 0 # suppress errors endef + define Package/ddns-scripts_godaddy.com-v1/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_godaddy.com-v1 @@ -327,6 +331,7 @@ define Package/ddns-scripts_godaddy.com-v1/install $(INSTALL_DATA) ./files/usr/share/ddns/services/godaddy.com-v1.json \ $(1)/usr/share/ddns/services endef + define Package/ddns-scripts_godaddy.com-v1/postinst #!/bin/sh # on real system restart service if enabled @@ -339,6 +344,7 @@ define Package/ddns-scripts_godaddy.com-v1/postinst } exit 0 # suppress errors endef + define Package/ddns-scripts_godaddy.com-v1/prerm #!/bin/sh # if NOT run buildroot then stop service @@ -346,6 +352,7 @@ define Package/ddns-scripts_godaddy.com-v1/prerm exit 0 # suppress errors endef + ###### ************************************************************************* define Package/ddns-scripts_digitalocean.com-v2/preinst #!/bin/sh @@ -353,6 +360,7 @@ define Package/ddns-scripts_digitalocean.com-v2/preinst [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 exit 0 # suppress errors endef + define Package/ddns-scripts_digitalocean.com-v2/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_digtalocean.com-v2 @@ -365,6 +373,7 @@ define Package/ddns-scripts_digitalocean.com-v2/install $(INSTALL_DATA) ./files/usr/share/ddns/services/digitalocean.com-v2.json \ $(1)/usr/share/ddns/services endef + define Package/ddns-scripts_digitalocean.com-v2/postinst #!/bin/sh # on real system restart service if enabled @@ -377,6 +386,7 @@ define Package/ddns-scripts_digitalocean.com-v2/postinst } exit 0 # suppress errors endef + define Package/ddns-scripts_digitalocean.com-v2/prerm #!/bin/sh # if NOT run buildroot then stop service @@ -384,6 +394,7 @@ define Package/ddns-scripts_digitalocean.com-v2/prerm exit 0 # suppress errors endef + ###### ************************************************************************* define Package/ddns-scripts_no-ip_com/preinst #!/bin/sh @@ -391,6 +402,7 @@ define Package/ddns-scripts_no-ip_com/preinst [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 exit 0 # suppress errors endef + define Package/ddns-scripts_no-ip_com/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_no-ip_com @@ -403,6 +415,7 @@ define Package/ddns-scripts_no-ip_com/install $(INSTALL_DATA) ./files/usr/share/ddns/services/no-ip.com.json \ $(1)/usr/share/ddns/services endef + define Package/ddns-scripts_no-ip_com/postinst #!/bin/sh # on real system restart service if enabled @@ -415,6 +428,7 @@ define Package/ddns-scripts_no-ip_com/postinst } exit 0 # suppress errors endef + define Package/ddns-scripts_no-ip_com/prerm #!/bin/sh # if NOT run buildroot then stop service @@ -422,6 +436,7 @@ define Package/ddns-scripts_no-ip_com/prerm exit 0 # suppress errors endef + ###### ************************************************************************* define Package/ddns-scripts_nsupdate/preinst #!/bin/sh @@ -429,6 +444,7 @@ define Package/ddns-scripts_nsupdate/preinst [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 exit 0 # suppress errors endef + define Package/ddns-scripts_nsupdate/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_nsupdate @@ -441,6 +457,7 @@ define Package/ddns-scripts_nsupdate/install $(INSTALL_DATA) ./files/usr/share/ddns/services/bind-nsupdate.json \ $(1)/usr/share/ddns/services endef + define Package/ddns-scripts_nsupdate/postinst #!/bin/sh # on real system restart service if enabled @@ -453,6 +470,7 @@ define Package/ddns-scripts_nsupdate/postinst } exit 0 # suppress errors endef + define Package/ddns-scripts_nsupdate/prerm #!/bin/sh # if NOT run buildroot then stop service @@ -460,6 +478,7 @@ define Package/ddns-scripts_nsupdate/prerm exit 0 # suppress errors endef + ###### ************************************************************************* define Package/ddns-scripts_route53-v1/preinst #!/bin/sh @@ -467,6 +486,7 @@ define Package/ddns-scripts_route53-v1/preinst [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 exit 0 # suppress errors endef + define Package/ddns-scripts_route53-v1/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_route53-v1 @@ -479,6 +499,7 @@ define Package/ddns-scripts_route53-v1/install $(INSTALL_DATA) ./files/usr/share/ddns/services/route53-v1.json \ $(1)/usr/share/ddns/services endef + define Package/ddns-scripts_route53-v1/postinst #!/bin/sh # on real system restart service if enabled @@ -491,6 +512,7 @@ define Package/ddns-scripts_route53-v1/postinst } exit 0 # suppress errors endef + define Package/ddns-scripts_route53-v1/prerm #!/bin/sh # if NOT run buildroot then stop service @@ -498,6 +520,7 @@ define Package/ddns-scripts_route53-v1/prerm exit 0 # suppress errors endef + ###### ************************************************************************* define Package/ddns-scripts_cnkuai_cn/preinst #!/bin/sh @@ -505,6 +528,7 @@ define Package/ddns-scripts_cnkuai_cn/preinst [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 exit 0 # suppress errors endef + define Package/ddns-scripts_cnkuai_cn/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns_cnkuai_cn @@ -517,6 +541,7 @@ define Package/ddns-scripts_cnkuai_cn/install $(INSTALL_DATA) ./files/usr/share/ddns/services/cnkuai.cn.json \ $(1)/usr/share/ddns/services endef + define Package/ddns-scripts_cnkuai_cn/postinst #!/bin/sh # on real system restart service if enabled @@ -529,6 +554,7 @@ define Package/ddns-scripts_cnkuai_cn/postinst } exit 0 # suppress errors endef + define Package/ddns-scripts_cnkuai_cn/prerm #!/bin/sh # if NOT run buildroot then stop service @@ -536,7 +562,7 @@ define Package/ddns-scripts_cnkuai_cn/prerm exit 0 # suppress errors endef -###### ************************************************************************* + $(eval $(call BuildPackage,ddns-scripts)) $(eval $(call BuildPackage,ddns-scripts_cloudflare.com-v4)) $(eval $(call BuildPackage,ddns-scripts_freedns_42_pl)) -- 2.30.2