summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Lane <tgl@fedoraproject.org>2010-01-26 18:29:52 +0000
committerTom Lane <tgl@fedoraproject.org>2010-01-26 18:29:52 +0000
commit1a80a96e7464a07f49a215052e48c3490bd99b30 (patch)
treeb7cf9c0fae3911de772fd894ffaed263615d28f1
parent962b39e67ea46a2b3588f87263ac2c65050412a7 (diff)
downloadpostgresql-setup-1a80a96e7464a07f49a215052e48c3490bd99b30.tar.gz
postgresql-setup-1a80a96e7464a07f49a215052e48c3490bd99b30.tar.xz
postgresql-setup-1a80a96e7464a07f49a215052e48c3490bd99b30.zip
Emit explicit error message if user tries to build RPM as rootpostgresql-8_4_2-6_fc13F-13-startF-13-split
-rwxr-xr-xpostgresql.spec16
1 files changed, 15 insertions, 1 deletions
diff --git a/postgresql.spec b/postgresql.spec
index 6112efc..032bb1b 100755
--- a/postgresql.spec
+++ b/postgresql.spec
@@ -53,7 +53,7 @@ Summary: PostgreSQL client programs
Name: postgresql
%global majorversion 8.4
Version: 8.4.2
-Release: 5%{?dist}
+Release: 6%{?dist}
# PostgreSQL calls their license simplified BSD, but the requirements are
# more similar to other MIT licenses.
License: MIT
@@ -287,6 +287,16 @@ cp -p %{SOURCE1} .
%build
+# fail quickly and obviously if user tries to build as root
+%if %runselftest
+ if [ x"`id -u`" = x0 ]; then
+ echo "postgresql's regression tests fail if run as root."
+ echo "If you really need to build the RPM as root, use"
+ echo "--define='runselftest 0' to skip the regression tests."
+ exit 1
+ fi
+%endif
+
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS
# Strip out -ffast-math from CFLAGS....
@@ -701,6 +711,10 @@ rm -rf $RPM_BUILD_ROOT
%endif
%changelog
+* Tue Jan 26 2010 Tom Lane <tgl@redhat.com> 8.4.2-6
+- Emit explicit error message if user tries to build RPM as root
+Related: #558921
+
* Wed Jan 20 2010 Tom Lane <tgl@redhat.com> 8.4.2-5
- Latest version of systemtap needs the probes.o file to be built again
Resolves: #557266