summaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-07-01 13:41:43 +0200
committerPavel Raiskup <praiskup@redhat.com>2014-07-01 13:44:30 +0200
commit7b1bb4fd5a05b9c35ae23734f12b2a92fe5f0a57 (patch)
treebe4ca41ca8c8c169440fd5e4b474ff420867a791 /Makefile.am
parent6472bbf1c6d2ad140a7502a7788ed6c4a9193a7d (diff)
downloadpostgresql-setup-7b1bb4fd5a05b9c35ae23734f12b2a92fe5f0a57.tar.gz
postgresql-setup-7b1bb4fd5a05b9c35ae23734f12b2a92fe5f0a57.tar.xz
postgresql-setup-7b1bb4fd5a05b9c35ae23734f12b2a92fe5f0a57.zip
postgresql-check-db-dir generated also
Also generate files using sed as is suggested by autoconf manual (and the autoconf project does so internally).
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am44
1 files changed, 35 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am
index d09ee3d..ddd8b78 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,34 +2,60 @@ SUBDIRS = . doc
bin_SCRIPTS = postgresql$(DISTSUFF)-setup
-libexec_SCRIPTS = postgresql$(DISTSUFF)-ctl
+libexec_SCRIPTS = postgresql$(DISTSUFF)-ctl \
+ postgresql$(DISTSUFF)-check-db-dir
pkgsysconfdir = $(PKGCONFIG_DIR)
pkgsysconf_DATA = conf/postgresql$(DISTSUFF)
systemdunitsdir = $(prefix)/lib/systemd/system
-systemdunits_DATA = postgresql$(DISTSUFF).service
+nodist_systemdunits_DATA = postgresql$(DISTSUFF).service
nodist_pgdoc_DATA = README.rpm-dist
-c_s_gen = $(AM_V_GEN)cmd="$(top_srcdir)/config.status --file=$@:$<" ; \
- if $(AM_V_P); then $$cmd; else $$cmd &>/dev/null; fi
+# Encouraged by autoconf documentation itself. When we use config.status
+# directly, e.g. libexecdir may result into '${exec_prefix}/libexec' -- but we
+# need fully expanded strings there.
+edit = $(SED) \
+ -e 's|@DISTSUFF[@]|$(DISTSUFF)|g' \
+ -e 's|@INITDB_LOG[@]|$(INITDB_LOG)|g' \
+ -e 's|@libexecdir[@]|$(libexecdir)|g' \
+ -e 's|@PGDATADIR[@]|$(PGDATADIR)|g' \
+ -e 's|@pgdocdir[@]|$(pgdocdir)|g' \
+ -e 's|@PGENGINE[@]|$(PGENGINE)|g' \
+ -e 's|@PGMAJORVERSION[@]|$(PGMAJORVERSION)|g' \
+ -e 's|@PGVERSION[@]|$(PGVERSION)|g' \
+ -e 's|@PKGCONFIG_DIR[@]|$(PKGCONFIG_DIR)|g' \
+ -e 's|@PREVMAJORVERSION[@]|$(PREVMAJORVERSION)|g' \
+ -e 's|@PREVPGENGINE[@]|$(PREVPGENGINE)|g' \
+ -e 's|@README_DIST[@]|$(README_DIST)|g' \
+ -e 's|@SU[@]|$(SU)|g' \
+ -e 's|@UPGRADE_LOG[@]|$(UPGRADE_LOG)|g' \
+ -e 's|@VERSION[@]|$(VERSION)|g' \
+ $< > $@
+
+c_s = $(top_srcdir)/config.status
+
+c_s_gen = $(AM_V_GEN)$(edit)
c_s_script_gen = $(c_s_gen) && chmod +x $@
-postgresql$(DISTSUFF)-ctl: postgresql-ctl.in
+postgresql$(DISTSUFF)-ctl: postgresql-ctl.in $(c_s)
+ $(c_s_script_gen)
+
+postgresql$(DISTSUFF)-setup: postgresql-setup.in $(c_s)
$(c_s_script_gen)
-postgresql$(DISTSUFF)-setup: postgresql-setup.in
+postgresql$(DISTSUFF)-check-db-dir: postgresql-check-db-dir.in $(c_s)
$(c_s_script_gen)
-conf/postgresql$(DISTSUFF): conf/postgresql.in
+conf/postgresql$(DISTSUFF): conf/postgresql.in $(c_s)
$(c_s_gen)
-postgresql$(DISTSUFF).service: postgresql.service.in
+postgresql$(DISTSUFF).service: postgresql.service.in $(c_s)
$(c_s_gen)
-README.rpm-dist: README.rpm-dist.in
+README.rpm-dist: README.rpm-dist.in $(c_s)
$(c_s_gen)
EXTRA_DIST = *.in conf/*.in