1 include $(TOPDIR
)/rules.mk
4 # Version == major.minor.patch
5 # increase on new functionality (minor) or patches (patch)
8 # increase on changes of services files or tld_names.dat
12 PKG_MAINTAINER
:=Christian Schoenebeck
<christian.schoenebeck@gmail.com
>
14 include $(INCLUDE_DIR
)/package.mk
16 # no default dependencies
19 define Package
/$(PKG_NAME
)/Default
22 SUBMENU
:=IP Addresses and Names
26 ##### **********************************
27 define Package
/$(PKG_NAME
)
28 $(call Package
/$(PKG_NAME
)/Default
)
29 TITLE
:=Dynamic DNS Client scripts
(with IPv6 support
)
31 # shown in LuCI package description
32 define Package
/$(PKG_NAME
)/description
33 Dynamic DNS Client scripts
(with IPv6 support
) - Info
: http
://wiki.openwrt.org
/doc
/howto
/ddns.client
35 # shown in menuconfig <Help>
36 define Package
/$(PKG_NAME
)/config
38 A highly configurable set of scripts for doing dynamic dns updates.
40 - force communication to IPv4 or IPv6 only
42 - using BIND host if installed
43 - DNS requests via TCP
44 - Proxy server support
48 Version
: $(PKG_VERSION
)-$(PKG_RELEASE
)
49 Info
: http
://wiki.openwrt.org
/doc
/howto
/ddns.client
54 ##### **********************************
55 define Package
/$(PKG_NAME
)_cloudflare
56 $(call Package
/$(PKG_NAME
)/Default
)
57 TITLE
:=DDNS extension for CloudFlare
60 define Package
/$(PKG_NAME
)_cloudflare
/description
61 Dynamic DNS Client scripts extension for CloudFlare
64 ##### **********************************
65 define Package
/$(PKG_NAME
)_no-ip_com
66 $(call Package
/$(PKG_NAME
)/Default
)
67 TITLE
:=DDNS extension for No-IP.com
70 define Package
/$(PKG_NAME
)_no-ip_com
/description
71 Dynamic DNS Client scripts extension for No-IP.com
74 ##### **********************************
75 define Package
/$(PKG_NAME
)_nsupdate
76 $(call Package
/$(PKG_NAME
)/Default
)
77 TITLE
:=DDNS extension using Bind nsupdate
78 DEPENDS
:=$(PKG_NAME
) +bind-client
80 define Package
/$(PKG_NAME
)_nsupdate
/description
81 Dynamic DNS Client scripts extension for direct updates using Bind nsupdate
83 define Package
/$(PKG_NAME
)_nsupdate
/config
85 The script directly updates a PowerDNS
(or maybe bind server
) via nsupdate
86 from bind-client package. It requires
87 "option dns_server" to be set to the server to be used by nsupdate.
88 "option username" should be set to the key name and
89 "option password" to the base64 encoded shared secret.
93 ##### **********************************
94 define Build
/Configure
97 $(CP
) .
/files
$(PKG_BUILD_DIR
)
98 for FILE in
`find $(PKG_BUILD_DIR)/files -type f`; do \
100 -e
'/^#\s\|^#$$$$/d' \
101 -e
's/\s#\s.*$$$$//' \
104 -e
'/^\s*$$$$/d' $$$$FILE; \
108 define Package
/$(PKG_NAME
)/conffiles
112 ##### **********************************
113 define Package
/$(PKG_NAME
)/install
114 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/iface
115 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/ddns.hotplug
$(1)/etc
/hotplug.d
/iface
/95-ddns
116 $(INSTALL_DIR
) $(1)/etc
/init.d
117 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/ddns.init
$(1)/etc
/init.d
/ddns
118 $(INSTALL_DIR
) $(1)/etc
/config
119 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)/files
/ddns.config
$(1)/etc
/config
/ddns
121 $(INSTALL_DIR
) $(1)/usr
/lib
/ddns
122 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/files
/services
* $(1)/usr
/lib
/ddns
123 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/dynamic_
*.sh
$(1)/usr
/lib
/ddns
125 define Package
/$(PKG_NAME
)/postinst
127 # if run within buildroot exit
128 [ -n
"$${IPKG_INSTROOT}" ] && exit
0
130 # add new section "ddns" "global" if not exists
131 uci
-q
get ddns.global
> /dev
/null || uci
-q set ddns.global
='ddns'
132 uci
-q
get ddns.global.date_format
> /dev
/null || uci
-q set ddns.global.date_format
='%F %R'
133 uci
-q
get ddns.global.log_lines
> /dev
/null || uci
-q set ddns.global.log_lines
='250'
134 uci
-q
get ddns.global.allow_local_ip
> /dev
/null || uci
-q set ddns.global.allow_local_ip
='0'
137 # clear LuCI indexcache
138 rm -f
/tmp
/luci-indexcache
>/dev
/null
2>&1
142 define Package
/$(PKG_NAME
)/prerm
144 # if run within buildroot exit
145 [ -n
"$${IPKG_INSTROOT}" ] && exit
0
147 # stop running scripts
148 /etc
/init.d
/ddns disable
149 /etc
/init.d
/ddns stop
151 # clear LuCI indexcache
152 rm -f
/tmp
/luci-indexcache
>/dev
/null
2>&1
157 ##### **********************************
158 define Package
/$(PKG_NAME
)_cloudflare
/install
159 $(INSTALL_DIR
) $(1)/usr
/lib
/ddns
160 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/update_CloudFlare.sh
$(1)/usr
/lib
/ddns
161 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/files
/tld_names.dat
$(1)/usr
/lib
/ddns
163 define Package
/$(PKG_NAME
)_cloudflare
/postinst
165 echo
-e
'"CloudFlare"\t"update_CloudFlare.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
166 echo
-e
'"CloudFlare"\t"update_CloudFlare.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services_ipv6
168 define Package
/$(PKG_NAME
)_cloudflare
/prerm
170 /bin
/sed
-i
'/update_CloudFlare\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
171 /bin
/sed
-i
'/update_CloudFlare\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services_ipv6
174 ##### **********************************
175 define Package
/$(PKG_NAME
)_no-ip_com
/install
176 $(INSTALL_DIR
) $(1)/usr
/lib
/ddns
177 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/update_No-IP.com.sh
$(1)/usr
/lib
/ddns
179 define Package
/$(PKG_NAME
)_no-ip_com
/postinst
181 echo
-e
'"No-IP.com"\t"update_No-IP.com.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
182 echo
-e
'"NoIP.com"\t"update_No-IP.com.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
184 define Package
/$(PKG_NAME
)_no-ip_com
/prerm
186 /bin
/sed
-i
'/update_No-IP\.com\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
189 ##### **********************************
190 define Package
/$(PKG_NAME
)_nsupdate
/install
191 $(INSTALL_DIR
) $(1)/usr
/lib
/ddns
192 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/files
/update_nsupdate.sh
$(1)/usr
/lib
/ddns
194 define Package
/$(PKG_NAME
)_nsupdate
/postinst
196 echo
-e
'"Bind-nsupdate"\t"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
197 echo
-e
'"Bind-nsupdate"\t"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/usr
/lib
/ddns
/services_ipv6
199 define Package
/$(PKG_NAME
)_nsupdate
/prerm
201 /bin
/sed
-i
'/update_nsupdate\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services
202 /bin
/sed
-i
'/update_nsupdate\.sh/ d' $${IPKG_INSTROOT}/usr
/lib
/ddns
/services_ipv6
205 ##### **********************************
206 $(eval
$(call BuildPackage
,$(PKG_NAME
)))
207 $(eval
$(call BuildPackage
,$(PKG_NAME
)_cloudflare
))
208 $(eval
$(call BuildPackage
,$(PKG_NAME
)_no-ip_com
))
209 $(eval
$(call BuildPackage
,$(PKG_NAME
)_nsupdate
))