[postgresql] spec: move script generation to proper place
Pavel Raiskup
praiskup at fedoraproject.org
Mon Jan 20 08:50:02 UTC 2014
commit 44cd816532a7bb51f9bd957793b851f5a593ea6c
Author: Pavel Raiskup <praiskup at redhat.com>
Date: Thu Jan 9 19:05:15 2014 +0100
spec: move script generation to proper place
Generate postgresql-setup and postgresql-check-db-dir in %prep
rather then in %install. It is (a) better place and (b) it speeds
up its testing ('rpmbuild -bp *.spec' is able to generate them).
Version: 9.3.2-4
postgresql.spec | 30 +++++++++++++++++-------------
1 files changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/postgresql.spec b/postgresql.spec
index e1e21e7..6f4c83c 100644
--- a/postgresql.spec
+++ b/postgresql.spec
@@ -359,6 +359,22 @@ 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|^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
+
+# 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
@@ -617,21 +633,8 @@ esac
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial
cp -p src/tutorial/* $RPM_BUILD_ROOT%{_libdir}/pgsql/tutorial
-# prep the setup script, including insertion of some values it needs
-sed -e 's|^PGVERSION=.*$|PGVERSION=%{version}|' \
- -e 's|^PGENGINE=.*$|PGENGINE=%{_bindir}|' \
- -e 's|^PREVMAJORVERSION=.*$|PREVMAJORVERSION=%{prevmajorversion}|' \
- -e 's|^PREVPGENGINE=.*$|PREVPGENGINE=%{_libdir}/pgsql/postgresql-%{prevmajorversion}/bin|' \
- <%{SOURCE9} >postgresql-setup
-touch -r %{SOURCE9} postgresql-setup
install -m 755 postgresql-setup $RPM_BUILD_ROOT%{_bindir}/postgresql-setup
-# 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
install -m 755 postgresql-check-db-dir $RPM_BUILD_ROOT%{_bindir}/postgresql-check-db-dir
install -d $RPM_BUILD_ROOT%{_unitdir}
@@ -1127,6 +1130,7 @@ fi
- postgresql-setup(upgrade): don't stop old server when it can not be started
- postgresql-setup(initdb, upgrade): add $PGSETUP_INITDB_OPTIONS
- postgresql-setup: do not pretend 'sh' compatibility
+- move script generation to proper place
* Fri Jan 10 2014 Pavel Raiskup <praiskup at redhat.com> - 9.3.2-3
- build with -O3 on ppc64 (private #1051075)
More information about the scm-commits
mailing list