summaryrefslogtreecommitdiffstats
path: root/packaging/RHEL
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-02-08 14:18:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:09:58 -0500
commit034877ca335c64f6e2a08155c5856e03448397e1 (patch)
tree249a381be006fa6939c8a3567681f094978bef96 /packaging/RHEL
parentd5c5c856ae924fc4523e5fa4b9a790249e32b3ae (diff)
downloadsamba-034877ca335c64f6e2a08155c5856e03448397e1.tar.gz
samba-034877ca335c64f6e2a08155c5856e03448397e1.tar.xz
samba-034877ca335c64f6e2a08155c5856e03448397e1.zip
r13392: check gcc version before trying 'make pch'. remove some historical actions
(This used to be commit e0c4e5cfded7d22e37aab7c14d3c0fa4263e7983)
Diffstat (limited to 'packaging/RHEL')
-rw-r--r--packaging/RHEL/samba.spec.tmpl44
1 files changed, 17 insertions, 27 deletions
diff --git a/packaging/RHEL/samba.spec.tmpl b/packaging/RHEL/samba.spec.tmpl
index 6800c90b606..fe3551994d1 100644
--- a/packaging/RHEL/samba.spec.tmpl
+++ b/packaging/RHEL/samba.spec.tmpl
@@ -152,7 +152,18 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
make showlayout
-make CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" proto pch
+make CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" proto
+
+## check for gcc 3.4 or later
+CC_VERSION=`${CC} --version | head -1 | awk '{print $3}'`
+CC_MAJOR=`echo ${CC_VERSION} | cut -d. -f 1`
+CC_MINOR=`echo ${CC_VERSION} | cut -d. -f 2`
+if [ ${CC_MAJOR} -ge 3 ]; then
+ if [ ${CC_MAJOR} -gt 3 -o ${CC_MINOR} -ge 4 ]; then
+ make pch
+ fi
+fi
+
make CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" %{?_smp_mflags} \
all modules pam_smbpass
@@ -276,9 +287,7 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man5/vfstest.1*
rm -rf $RPM_BUILD_ROOT
%post
-/sbin/chkconfig --add smb
-
-## deal with an upgrade from a broken 3.0.21a.1 RPM
+## deal with an upgrade from a broken 3.0.21b RPM
if [ "$1" -eq "2" ]; then
if [ -d /var/cache/samba ]; then
for file in `ls /var/cache/samba/*tdb`; do
@@ -296,6 +305,7 @@ fi
%preun
if [ $1 = 0 ] ; then
/sbin/chkconfig --del smb
+ /sbin/chkconfig --del winbind
# rm -rf /var/log/samba/* /var/lib/samba/*
/sbin/service smb stop >/dev/null 2>&1
fi
@@ -303,7 +313,7 @@ exit 0
%postun
if [ "$1" -ge "1" ]; then
- %{initdir}/smb condrestart >/dev/null 2>&1
+ %{initdir}/smb restart >/dev/null 2>&1
fi
@@ -314,30 +324,10 @@ if [ ! "`grep ^\s**swat /etc/services`" ]; then
fi
%post common
-/sbin/chkconfig --add winbind
/sbin/ldconfig
-%preun common
-if [ $1 = 0 ] ; then
- /sbin/chkconfig --del winbind
- /sbin/service winbind stop >/dev/null 2>&1
-fi
-exit 0
-
-%postun common -p /sbin/ldconfig
-
-%triggerpostun -- samba < 1.9.18p7
-if [ $1 != 0 ]; then
- /sbin/chkconfig --add smb
-fi
-
-%triggerpostun -- samba < 2.0.5a-3
-if [ $1 != 0 ]; then
- [ ! -d /var/lock/samba ] && mkdir -m 0755 /var/lock/samba
- [ ! -d /var/spool/samba ] && mkdir -m 1777 /var/spool/samba
- chmod 644 /etc/services
- [ -f /etc/inetd.conf ] && chmod 644 /etc/inetd.conf
-fi
+%postun common
+/sbin/ldconfig
#######################################################################
## Files section ##