diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2014-10-02 17:42:36 +0200 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2014-10-02 17:42:36 +0200 |
commit | 33481db83bb5f6f7d1017e17a00cd0012a06f117 (patch) | |
tree | abcd8c201d69fac29edd8305a2c40cb44a7c4fef | |
parent | 0ba4ab7cbbd4e78cbc728ef205b98622244afbfb (diff) | |
download | postgresql-setup-33481db83bb5f6f7d1017e17a00cd0012a06f117.tar.gz postgresql-setup-33481db83bb5f6f7d1017e17a00cd0012a06f117.tar.xz postgresql-setup-33481db83bb5f6f7d1017e17a00cd0012a06f117.zip |
buildsystem: better handle distro-README
Avoid detecting README.rpm-dist as we generate this file and we
know the best where the file is.
* configure.ac: Avoid detecting README path. Also substitute new
variable README_DIST_BASENAME.
* Makefile.am: Use the new $(README_DIST_BASENAME).
* postgres-check-db-dir.in: Use README_DIST instead of PGDOCDIR.
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | configure.ac | 16 | ||||
-rw-r--r-- | postgresql-check-db-dir.in | 10 |
3 files changed, 14 insertions, 18 deletions
diff --git a/Makefile.am b/Makefile.am index b15086b..8aeac27 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ userunitsdir = /etc/systemd/system systemdunitsdir = $(prefix)/lib/systemd/system nodist_systemdunits_DATA = postgresql$(DISTSUFF).service postgresql$(DISTSUFF)@.service -nodist_pgdoc_DATA = README.rpm-dist +nodist_doc_DATA = $(README_DIST_BASENAME) noinst_DATA = $(TEST_GEN_FILES_LIST) @@ -39,14 +39,14 @@ postgresql$(DISTSUFF).service: postgresql.service.in $(c_s) -e 's|@PGDATA_ENVIRONMENT[@]|Environment=PGDATA=$(PGDATADIR)|' \ $< > $@ -README.rpm-dist: README.rpm-dist.in $(c_s) +$(README_DIST_BASENAME): $(README_DIST_BASENAME).in $(c_s) $(INSTANTIATE) EXTRA_DIST = $(srcdir)/*.in GENERATED_FILES = $(bin_SCRIPTS) \ $(libexec_SCRIPTS) \ - $(nodist_pgdoc_DATA) \ + $(nodist_doc_DATA) \ $(pkgsysconf_DATA) \ $(nodist_systemdunits_DATA) diff --git a/configure.ac b/configure.ac index bcffc2a..a4d0c0f 100644 --- a/configure.ac +++ b/configure.ac @@ -142,14 +142,6 @@ if test -z "$PREVPGENGINE"; then PREVPGENGINE=`AS_DIRNAME($PREV_POSTGRES_BIN)` fi -# Detect where distribution-like README is -case "$pgsetup_cv_os_family" in -redhat) - test -z "$README_DIST" && - README_DIST=`rpm -ql postgresql | grep README | grep dist` - ;; -esac - if test -z "$PKGCONFIG_DIR" -a "$pgsetup_cv_os_family" = redhat; then PKGCONFIG_DIR=/etc/postgresql fi @@ -164,15 +156,20 @@ fi pgdocdir="\${datarootdir}/doc/\${pkgname}" pgcontribdocdir="\${datarootdir}/doc/\${pkgname}-contrib" + +README_DIST_BASENAME=README.rpm-dist +README_DIST="\${docdir}/$README_DIST_BASENAME" + AC_SUBST([pgdocdir]) AC_SUBST([pgcontribdocdir]) +AC_SUBST([README_DIST]) +AC_SUBST([README_DIST_BASENAME]) PGSETUP_SUBST_REQ([PGVERSION], [full PG version]) PGSETUP_SUBST_REQ([PGMAJORVERSION], [major PG version]) PGSETUP_SUBST_REQ([PGENGINE], [directory where PG server resides]) PGSETUP_SUBST_REQ([PREVMAJORVERSION], [PG major version to upgrade _from_]) PGSETUP_SUBST_REQ([PREVPGENGINE], [directory where old PG server resides]) -PGSETUP_SUBST_REQ([README_DIST], [README file for distribution]) 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]) @@ -185,5 +182,4 @@ AC_MSG_NOTICE([Configured the folowing way: PGDATADIR: $PGDATADIR Upgrade from: $PREVMAJORVERSION PREV_POSTGRES_BIN: $PREV_POSTGRES_BIN - README_DIST: $README_DIST ]) diff --git a/postgresql-check-db-dir.in b/postgresql-check-db-dir.in index e579edf..f8adc2d 100644 --- a/postgresql-check-db-dir.in +++ b/postgresql-check-db-dir.in @@ -45,8 +45,8 @@ PGMAJORVERSION=@PGMAJORVERSION@ # Previous major version, e.g., 8.4, for upgrades PREVMAJORVERSION=@PREVMAJORVERSION@ -# Directory containing the postgresql package's documentation -PGDOCDIR=@pgdocdir@ +# Distribution README file +README_DIST=@README_DIST@ # Check for the PGDATA structure if [ -f "$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base" ] @@ -59,19 +59,19 @@ then then echo $"An old version of the database format was found." echo $"Use \"postgresql-setup --upgrade\" to upgrade to version $PGMAJORVERSION." - echo $"See $PGDOCDIR/README.rpm-dist for more information." + echo $"See $README_DIST for more information." exit 1 else echo $"An old version of the database format was found." echo $"You need to dump and reload before using PostgreSQL $PGMAJORVERSION." - echo $"See $PGDOCDIR/README.rpm-dist for more information." + echo $"See $README_DIST for more information." exit 1 fi else # No existing PGDATA! Warn the user to initdb it. echo $"\"$PGDATA\" is missing or empty." echo $"Use \"postgresql-setup --initdb\" to initialize the database cluster." - echo $"See $PGDOCDIR/README.rpm-dist for more information." + echo $"See $README_DIST for more information." exit 1 fi |