]> git.ipfire.org Git - ddns.git/commitdiff
Automatically generate paths in the ddns script.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Jun 2014 22:27:58 +0000 (00:27 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Jun 2014 22:27:58 +0000 (00:27 +0200)
.gitignore
Makefile.am
configure.ac
ddns.in [moved from ddns with 97% similarity]

index dbbef86841d6bbe9114623611161372f7af73cd4..17f56bd5d83ac7c683d034ad20cd9ec956b5a302 100644 (file)
@@ -1,5 +1,6 @@
 /Makefile
 /build-aux
+/ddns
 /missing
 /src/ddns/__version__.py
 /tmp
index 66c6a15cde62c5550f7113cc84a22cb2aa570df0..bfa5a61793f888c4b23694400e22fcb94052a316 100644 (file)
@@ -51,7 +51,13 @@ dist_doc_DATA = \
 
 # ------------------------------------------------------------------------------
 
-dist_bin_SCRIPTS = \
+bin_SCRIPTS = \
+       ddns
+
+EXTRA_DIST += \
+       ddns.in
+
+CLEANFILES += \
        ddns
 
 dist_configs_DATA = \
@@ -66,3 +72,18 @@ ddns_PYTHON = \
        src/ddns/system.py
 
 ddnsdir = $(pythondir)/ddns
+
+# ------------------------------------------------------------------------------
+
+substitutions = \
+       '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
+       '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
+       '|configsdir=$(configsdir)|'
+
+SED_PROCESS = \
+       $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+       $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
+               < $< > $@
+
+ddns: ddns.in Makefile
+       $(SED_PROCESS)
index fae19f04630ef2c49322a0b983fb3137f97ce483..de89e65fe1d06d8982065bf836f6270a4cc3176c 100644 (file)
@@ -49,6 +49,7 @@ AC_SUBST(GETTEXT_PACKAGE)
 
 AC_PROG_LN_S
 AC_PROG_MKDIR_P
+AC_PROG_SED
 
 # Python
 AM_PATH_PYTHON([2.7])
diff --git a/ddns b/ddns.in
similarity index 97%
rename from ddns
rename to ddns.in
index 66f0e04aa654c16115ad8b6ea198040e23f79a86..8e96858505a951b8e4e0665ec8cd32e7ed0156c4 100644 (file)
--- a/ddns
+++ b/ddns.in
@@ -22,6 +22,6 @@
 import ddns
 
 d = ddns.DDNSCore(debug=1)
-d.load_configuration("/etc/ddns.conf")
+d.load_configuration("@configsdir@/ddns.conf")
 
 d.updateall()