[postgresql] postgresql-setup is now in separate tarball

Pavel Raiskup praiskup at fedoraproject.org
Mon Sep 22 12:57:39 UTC 2014


commit c88f76d54084da5652d97f960b14e097f41c9be5
Author: Pavel Raiskup <praiskup at redhat.com>
Date:   Wed Jul 2 18:14:06 2014 +0200

    postgresql-setup is now in separate tarball
    
    .. together with other scripts and files.  This should make the
    development and testing of those files easier.  Also packaging
    should benefit from this change.
    
    Version: 9.3.5-6
    Resolves: #1145129

 .gitignore              |    1 +
 README.rpm-dist         |  357 -----------------------------------------------
 postgresql-check-db-dir |   57 --------
 postgresql-setup        |  268 -----------------------------------
 postgresql.service      |   63 ---------
 postgresql.spec         |  107 +++++++-------
 sources                 |    1 +
 7 files changed, 55 insertions(+), 799 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 1d2f5e5..29f1b53 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
 /postgresql-9.2.9.tar.bz2
 /postgresql-9.2.9.tar.bz2.sha256
 /postgresql-9.3.5-US.pdf
+/postgresql-setup-1.0.0.tar.gz
diff --git a/postgresql.spec b/postgresql.spec
index e658f44..e0634e8 100644
--- a/postgresql.spec
+++ b/postgresql.spec
@@ -67,7 +67,7 @@ Summary: PostgreSQL client programs
 Name: postgresql
 %global majorversion 9.3
 Version: 9.3.5
-Release: 5%{?dist}
+Release: 6%{?dist}
 
 # The PostgreSQL license is very similar to other MIT licenses, but the OSI
 # recognizes it as an independent license, so we do as well.
@@ -85,24 +85,26 @@ Url: http://www.postgresql.org/
 %global prevversion 9.2.9
 %global prevmajorversion 9.2
 
+%global setup_version 1.0.0
+
 Source0: ftp://ftp.postgresql.org/pub/source/v%{version}/postgresql-%{version}.tar.bz2
 # The PDF file is generated by generate-pdf.sh, which see for comments
 Source1: postgresql-%{version}-US.pdf
 # generate-pdf.sh is not used during RPM build, but include for documentation
 Source2: generate-pdf.sh
 Source3: ftp://ftp.postgresql.org/pub/source/v%{prevversion}/postgresql-%{prevversion}.tar.bz2
-Source4: postgresql-check-db-dir
-Source5: Makefile.regress
-Source6: pg_config.h
-Source7: ecpg_config.h
-Source8: README.rpm-dist
-Source9: postgresql-setup
-Source10: postgresql.service
-Source11: initdb.sh
-Source12: upgrade.sh
-Source13: postgresql.tmpfiles.d
-Source14: postgresql.pam
-Source15: postgresql-bashprofile
+Source4: Makefile.regress
+Source5: pg_config.h
+Source6: ecpg_config.h
+Source7: initdb.sh
+Source8: upgrade.sh
+Source9: postgresql.tmpfiles.d
+Source10: postgresql.pam
+Source11: postgresql-bashprofile
+
+# Temporary location of postgresql-setup.  Development git:
+# http://fedorapeople.org/cgit/praiskup/public_git/postgresql-setup.git/
+Source12: http://praiskup.fedorapeople.org/proj/postgresql-setup/postgresql-setup-%{setup_version}.tar.gz
 
 # Those here are just to enforce packagers check that the tarball was downloaded
 # correctly.  Also, this allows us check that packagers-only tarballs do not
@@ -346,7 +348,7 @@ benchmarks.
 
 %prep
 ( cd %_sourcedir; sha256sum -c %{SOURCE16}; sha256sum -c %{SOURCE17} )
-%setup -q
+%setup -q -a 12
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
@@ -377,25 +379,6 @@ cp -p config/config.sub postgresql-%{prevversion}/config/config.sub
 # remove .gitignore files to ensure none get into the RPMs (bug #642210)
 find . -type f -name .gitignore | xargs rm
 
-# prep the setup script, including insertion of some values it needs
-sed -e 's|^PGVERSION=.*$|PGVERSION=%{version}|' \
-	-e 's|^PGMAJORVERSION=.*$|PGMAJORVERSION=%{majorversion}|' \
-	-e 's|^PGENGINE=.*$|PGENGINE=%{_bindir}|' \
-	-e 's|^PREVMAJORVERSION=.*$|PREVMAJORVERSION=%{prevmajorversion}|' \
-	-e 's|^PREVPGENGINE=.*$|PREVPGENGINE=%{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin|' \
-	-e 's|^README_RPM_DIST=.*$|README_RPM_DIST=%{_pkgdocdir}/%(basename %{SOURCE8})|' \
-	<%{SOURCE9} >postgresql-setup
-touch -r %{SOURCE9} postgresql-setup
-chmod +x postgresql-setup
-help2man -N -m "Postgresql RPM-dist manual" ./postgresql-setup -o postgresql-setup.1
-
-# prep the startup check script, including insertion of some values it needs
-sed -e 's|^PGVERSION=.*$|PGVERSION=%{version}|' \
-	-e 's|^PREVMAJORVERSION=.*$|PREVMAJORVERSION=%{prevmajorversion}|' \
-	-e 's|^PGDOCDIR=.*$|PGDOCDIR=%{_pkgdocdir}|' \
-	<%{SOURCE4} >postgresql-check-db-dir
-touch -r %{SOURCE4} postgresql-check-db-dir
-
 %build
 
 # fail quickly and obviously if user tries to build as root
@@ -408,6 +391,24 @@ touch -r %{SOURCE4} postgresql-check-db-dir
 	fi
 %endif
 
+# Building postgresql-setup
+
+cd postgresql-setup-%{setup_version}
+
+export POSTGRES_BIN=%{_bindir}/postgres \
+       PG_CTL_BIN=%{_bindir}/pg_ctl \
+       PGVERSION=%{version} \
+       PGMAJORVERSION=%{majorversion} \
+       PGENGINE=%{_bindir} \
+       PREVMAJORVERSION=%{prevmajorversion} \
+       PREVPGENGINE=%{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin \
+       README_DIST=%{_pkgdocdir}/README.rpm-dist \
+       PKGCONFIG_DIR=%{_sysconfdir}/postgresql
+%configure
+
+make %{?_smp_mflags}
+cd ..
+
 # Fiddling with CFLAGS.
 
 CFLAGS="${CFLAGS:-%optflags}"
@@ -621,6 +622,10 @@ rm -f src/tutorial/GNUmakefile
 
 %install
 
+cd postgresql-setup-%{setup_version}
+make install DESTDIR=$RPM_BUILD_ROOT
+cd ..
+
 make DESTDIR=$RPM_BUILD_ROOT install-world
 
 %if %plpython3
@@ -646,11 +651,11 @@ install -D -m 644 macros.%{name} \
 case `uname -i` in
   i386 | x86_64 | ppc | ppc64 | s390 | s390x | sparc | sparc64 )
     mv $RPM_BUILD_ROOT/usr/include/pg_config.h $RPM_BUILD_ROOT/usr/include/pg_config_`uname -i`.h
-    install -m 644 %{SOURCE6} $RPM_BUILD_ROOT/usr/include/
+    install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/usr/include/
     mv $RPM_BUILD_ROOT/usr/include/pgsql/server/pg_config.h $RPM_BUILD_ROOT/usr/include/pgsql/server/pg_config_`uname -i`.h
-    install -m 644 %{SOURCE6} $RPM_BUILD_ROOT/usr/include/pgsql/server/
+    install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/usr/include/pgsql/server/
     mv $RPM_BUILD_ROOT/usr/include/ecpg_config.h $RPM_BUILD_ROOT/usr/include/ecpg_config_`uname -i`.h
-    install -m 644 %{SOURCE7} $RPM_BUILD_ROOT/usr/include/
+    install -m 644 %{SOURCE6} $RPM_BUILD_ROOT/usr/include/
     ;;
   *)
     ;;
@@ -659,21 +664,13 @@ esac
 install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial
 cp -p src/tutorial/* $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial
 
-install -m 755 postgresql-setup $RPM_BUILD_ROOT%{_bindir}/postgresql-setup
-install -p -m 644 postgresql-setup.1 $RPM_BUILD_ROOT%{_mandir}/man1
-
-install -m 755 postgresql-check-db-dir $RPM_BUILD_ROOT%{_bindir}/postgresql-check-db-dir
-
-install -d $RPM_BUILD_ROOT%{_unitdir}
-install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_unitdir}/postgresql.service
-
 install -d $RPM_BUILD_ROOT/usr/libexec/initscripts/legacy-actions/postgresql
-install -m 755 %{SOURCE11} $RPM_BUILD_ROOT/usr/libexec/initscripts/legacy-actions/postgresql/initdb
-install -m 755 %{SOURCE12} $RPM_BUILD_ROOT/usr/libexec/initscripts/legacy-actions/postgresql/upgrade
+install -m 755 %{SOURCE7} $RPM_BUILD_ROOT/usr/libexec/initscripts/legacy-actions/postgresql/initdb
+install -m 755 %{SOURCE8} $RPM_BUILD_ROOT/usr/libexec/initscripts/legacy-actions/postgresql/upgrade
 
 %if %pam
 install -d $RPM_BUILD_ROOT/etc/pam.d
-install -m 644 %{SOURCE14} $RPM_BUILD_ROOT/etc/pam.d/postgresql
+install -m 644 %{SOURCE10} $RPM_BUILD_ROOT/etc/pam.d/postgresql
 %endif
 
 # Create the directory for sockets.
@@ -681,7 +678,7 @@ install -d -m 755 $RPM_BUILD_ROOT/var/run/postgresql
 
 # ... and make a tmpfiles script to recreate it at reboot.
 mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir}
-install -m 0644 %{SOURCE13} $RPM_BUILD_ROOT%{_tmpfilesdir}/postgresql.conf
+install -m 0644 %{SOURCE9} $RPM_BUILD_ROOT%{_tmpfilesdir}/postgresql.conf
 
 # PGDATA needs removal of group and world permissions due to pg_pwd hole.
 install -d -m 700 $RPM_BUILD_ROOT/var/lib/pgsql/data
@@ -690,7 +687,7 @@ install -d -m 700 $RPM_BUILD_ROOT/var/lib/pgsql/data
 install -d -m 700 $RPM_BUILD_ROOT/var/lib/pgsql/backups
 
 # postgres' .bash_profile
-install -m 644 %{SOURCE15} $RPM_BUILD_ROOT/var/lib/pgsql/.bash_profile
+install -m 644 %{SOURCE11} $RPM_BUILD_ROOT/var/lib/pgsql/.bash_profile
 
 
 %if %upgrade
@@ -750,12 +747,10 @@ install -m 644 %{SOURCE15} $RPM_BUILD_ROOT/var/lib/pgsql/.bash_profile
 	rm -f GNUmakefile Makefile *.o
 	chmod 0755 pg_regress regress.so
 	popd
-	cp %{SOURCE5} $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/Makefile
+	cp %{SOURCE4} $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/Makefile
 	chmod 0644 $RPM_BUILD_ROOT%{_libdir}/pgsql/test/regress/Makefile
 %endif
 
-# Fix some more documentation
-cp %{SOURCE8} README.rpm-dist
 rm -rf doc/html # HACK! allow 'rpmbuild -bi --short-circuit'
 mv $RPM_BUILD_ROOT%{_docdir}/pgsql/html doc
 rm -rf $RPM_BUILD_ROOT%{_docdir}/pgsql
@@ -882,7 +877,6 @@ fi
 %files -f main.lst
 %doc doc/KNOWN_BUGS doc/MISSING_FEATURES doc/TODO
 %doc COPYRIGHT README HISTORY doc/bug.template
-%doc README.rpm-dist
 %{_bindir}/clusterdb
 %{_bindir}/createdb
 %{_bindir}/createlang
@@ -1046,6 +1040,7 @@ fi
 
 %files server -f server.lst
 %{_unitdir}/postgresql.service
+%{_unitdir}/postgresql at .service
 %dir /usr/libexec/initscripts/legacy-actions/postgresql
 /usr/libexec/initscripts/legacy-actions/postgresql/*
 %if %pam
@@ -1060,7 +1055,6 @@ fi
 %{_bindir}/postgres
 %{_bindir}/postmaster
 %{_bindir}/postgresql-setup
-%{_bindir}/postgresql-check-db-dir
 %{_mandir}/man1/initdb.*
 %{_mandir}/man1/pg_basebackup.*
 %{_mandir}/man1/pg_controldata.*
@@ -1096,6 +1090,8 @@ fi
 %{_datadir}/pgsql/information_schema.sql
 %{_datadir}/pgsql/snowball_create.sql
 %{_datadir}/pgsql/sql_features.txt
+%{_libexecdir}/postgresql-ctl
+%{_libexecdir}/postgresql-check-db-dir
 
 %files devel -f devel.lst
 /usr/include/*
@@ -1155,6 +1151,9 @@ fi
 %endif
 
 %changelog
+* Sun Sep 21 2014 Pavel Raiskup <praiskup at redhat.com> - 9.3.5-6
+- postgresql-setup & relatives are now in separate tarball
+
 * Wed Aug 27 2014 Jitka Plesnikova <jplesnik at redhat.com> - 9.3.5-5
 - Perl 5.20 rebuild
 
diff --git a/sources b/sources
index 56c0066..c4d5161 100644
--- a/sources
+++ b/sources
@@ -3,3 +3,4 @@
 38b0937c86d537d5044c599273066cfc  postgresql-9.2.9.tar.bz2
 08b4a99710e25d7004d058997cdb1ebc  postgresql-9.2.9.tar.bz2.sha256
 5d8361190dd064a655b21f112daa91ec  postgresql-9.3.5-US.pdf
+2e601b008c98b991c38a8d7443b13e76  postgresql-setup-1.0.0.tar.gz


More information about the scm-commits mailing list