summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2015-02-25 16:09:53 +0100
committerPavel Raiskup <praiskup@redhat.com>2015-02-26 16:52:18 +0100
commit1f35a8e32e9287d84b0d46f48a94eca85b59836f (patch)
tree3660daed3d5cf2128ad9a34ad02c509b5649a76f /configure.ac
parent243dcab83ed93c3afd9867b3e5d014efdd0f840f (diff)
downloadpostgresql-setup-1f35a8e32e9287d84b0d46f48a94eca85b59836f.tar.gz
postgresql-setup-1f35a8e32e9287d84b0d46f48a94eca85b59836f.tar.xz
postgresql-setup-1f35a8e32e9287d84b0d46f48a94eca85b59836f.zip
configury: remove DISTSUFF variable completely
And add NAME_SERVICE, NAME_PACKAGE and NAME_BINARYBASE on its place. This allows packager fine-tune how the files are going to be generated. * Makefile.am: Better work with variables. * .gitignore: Ignore any (generated) service file. * configure.ac (DISTSUFF): Remove. (NAME_BIN_PFX, NAME_BIN_SFX, NAME_PKG_PFX, NAME_PKG_SFX) (NAME_SRV_PFX, NAME_SRV_SFX, NAME_SERVICE, NAME_PACKAGE) (NAME_BINARYBASE): New variables * doc/.gitignore: Ignore any man(1) page. * doc/Makefile.am (HELP2MAN_RUN): Fix the call to work also with various prefixes/suffixes. * README.rpm-dist.in: Use new variables. * legacy-sysv-script.in: Likewise. * postgresql-setup.in: Likewise. * m4/packaging.m4 (PGSETUP_SUBST_OPT): New macro, defines, substitutes and also fixes sed-rules.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac50
1 files changed, 43 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index d6476f6..ce34c15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,9 +9,6 @@ AC_CONFIG_FILES([Makefile doc/Makefile])
AC_CONFIG_MACRO_DIR([m4])
AM_SILENT_RULES([yes])
-AC_ARG_VAR([DISTSUFF], [Append string suffix to all binaries and package names])
-AC_SUBST([DISTSUFF])
-
# Initialize the test suite.
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_FILES([tests/Makefile])
@@ -45,7 +42,6 @@ AM_CONDITIONAL([WANT_SYSVINIT], [test "$WANT_SYSVINIT" -eq 1])
m4_define([sed_subst_var_pattern], [ -e 's|@$1[[@]]|\$($1)|g' \\])
SED_RULES="\\
sed_subst_var_pattern(bindir)
-sed_subst_var_pattern(DISTSUFF)
sed_subst_var_pattern(docdir)
sed_subst_var_pattern(libdir)
sed_subst_var_pattern(libexecdir)
@@ -70,8 +66,12 @@ sed_subst_var_pattern(systemdunitsdir)
sed_subst_var_pattern(userunitsdir)
sed_subst_var_pattern(TEST_GEN_FILES_LIST)
sed_subst_var_pattern(VERSION)
-sed_subst_var_pattern(UPGRADE_CONFIG_LIST)
- -e 's|@__FILE__[[@]]|\$@|g'"
+sed_subst_var_pattern(UPGRADE_CONFIG_LIST)"
+
+m4_define([add_sed_subst_var], [
+SED_RULES="$SED_RULES
+sed_subst_var_pattern($1)"
+])
SED_CALL="\$(SED) \$(SED_RULES)"
m4_pattern_allow(AM_V_GEN)
@@ -81,7 +81,6 @@ INSTANTIATE="\$(INSTANTIATE_CONV) && \$(SED_CALL) \$< > \$@ && chmod -w \$@"
INSTANTIATE_SCRIPT="\$(INSTANTIATE) && chmod +x \$@"
c_s='$(top_builddir)/config.status'
-AC_SUBST([SED_RULES])
AC_SUBST([SED_CALL])
AC_SUBST([INSTANTIATE])
AC_SUBST([INSTANTIATE_CONV])
@@ -207,6 +206,40 @@ PGSETUP_SUBST_REQ([PKGCONFIG_DIR], [where configuration should be stored])
PGSETUP_SUBST_REQ([POSTGRES_HOMEDIR], [full path to postgres home dir])
PGSETUP_SUBST_REQ([PGDATADIR], [full path to postgres data dir])
+PGSETUP_SUBST_OPT([NAME_SRV_PFX], [],
+ [service name prefix, like (PFX)postgresql.service])
+PGSETUP_SUBST_OPT([NAME_SRV_SFX], [],
+ [service name suffix, like postgresql(SFX).service ])
+PGSETUP_SUBST_OPT([NAME_BIN_SFX], [],
+ [binary name prefix, like (PFX)postgresql-setup])
+PGSETUP_SUBST_OPT([NAME_BIN_SFX], [],
+ [binary name suffix, like postgresql(SFX)-setup])
+PGSETUP_SUBST_OPT([NAME_PKG_PFX], [],
+ [package name prefix, like (PFX)postgresql.rpm])
+PGSETUP_SUBST_OPT([NAME_PKG_SFX], [],
+ [package name suffix, like postgresql(SFX).rpm])
+
+NAME_BINARYBASE="$NAME_BIN_PFX""postgresql$NAME_BIN_SFX"
+NAME_PACKAGE="$NAME_PKG_PFX""postgresql$NAME_PKG_SFX"
+NAME_SERVICE="$NAME_SRV_PFX""postgresql$NAME_SRV_SFX"
+
+AC_SUBST([NAME_BINARYBASE])
+AC_SUBST([NAME_PACKAGE])
+AC_SUBST([NAME_SERVICE])
+
+AC_SUBST([NAME_BINARYBASE])
+AC_SUBST([NAME_PACKAGE])
+AC_SUBST([NAME_SERVICE])
+
+add_sed_subst_var(NAME_SERVICE)
+add_sed_subst_var(NAME_PACKAGE)
+add_sed_subst_var(NAME_BINARYBASE)
+
+# As late as possible.
+SED_RULES="$SED_RULES
+ -e 's|@__FILE__[[@]]|\$@|g'"
+AC_SUBST([SED_RULES])
+
AC_OUTPUT
AC_MSG_NOTICE([Configured the folowing way:
@@ -215,4 +248,7 @@ AC_MSG_NOTICE([Configured the folowing way:
PGDATADIR: $PGDATADIR
Upgrade from: $PREVMAJORVERSION
PREV_POSTGRES_BIN: $PREV_POSTGRES_BIN
+ PostgreSQL service: $NAME_SERVICE
+ PostgreSQL package: $NAME_PACKAGE
+ PostgreSQL bin_pfx: $NAME_BINARYBASE
])