Emit explicit error message if user tries to build RPM as root

This commit is contained in:
Tom Lane 2010-01-26 18:34:23 +00:00 committed by Michal Schorm
parent 9fe034f968
commit 56e52fefef

View File

@ -1,6 +1,6 @@
Name: mysql
Version: 5.1.42
Release: 5%{?dist}
Release: 6%{?dist}
Summary: MySQL client programs and shared libraries
Group: Applications/Databases
URL: http://www.mysql.com
@ -189,6 +189,17 @@ autoconf
autoheader
%build
# fail quickly and obviously if user tries to build as root
%if %runselftest
if [ x"`id -u`" = x0 ]; then
echo "mysql'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="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
# MySQL 4.1.10 definitely doesn't work under strict aliasing; also,
# gcc 4.1 breaks MySQL 5.0.16 without -fwrapv
@ -655,6 +666,10 @@ fi
%{_mandir}/man1/mysql_client_test.1*
%changelog
* Tue Jan 26 2010 Tom Lane <tgl@redhat.com> 5.1.42-6
- Emit explicit error message if user tries to build RPM as root
Related: #558915
* Wed Jan 20 2010 Tom Lane <tgl@redhat.com> 5.1.42-5
- Correct Source0: tag and comment to reflect how to get the tarball