Finally I got it working as I want it to.
Dependencies and the condrestart tricks should avoid that things go wrong. Guenther, please check if you see any big problem, as soon as you ack I will push it into rawhide, then we can go on with adding the winbindd/offline stuff we discussed today. Simo.
This commit is contained in:
parent
4697679b80
commit
23b112d13d
108
samba.spec
108
samba.spec
@ -46,10 +46,10 @@ Patch112: samba-3.0.15pre2-bug106483.patch
|
|||||||
#Patch113: samba-3.0.21-warnings.patch
|
#Patch113: samba-3.0.21-warnings.patch
|
||||||
Patch114: samba-3.0.24-msdfs-root-no.patch
|
Patch114: samba-3.0.24-msdfs-root-no.patch
|
||||||
Patch115: samba-3.0.24-vista-patchset.patch
|
Patch115: samba-3.0.24-vista-patchset.patch
|
||||||
Patch116: samba-3.0.24-fhs-compliance.patch
|
|
||||||
|
|
||||||
Requires(pre): /usr/sbin/groupadd
|
Requires(pre): /usr/sbin/groupadd
|
||||||
Requires: pam >= 0:0.64 %{auth} samba-common = %{epoch}:%{version}-%{release}
|
Requires(pre): samba-common = %{epoch}:%{version}-%{release}
|
||||||
|
Requires: pam >= 0:0.64 %{auth}
|
||||||
Requires: logrotate >= 0:3.4 initscripts >= 0:5.54-1
|
Requires: logrotate >= 0:3.4 initscripts >= 0:5.54-1
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||||||
Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall
|
Prereq: /sbin/chkconfig /bin/mktemp /usr/bin/killall
|
||||||
@ -158,7 +158,6 @@ cp %{SOURCE8} packaging/Fedora/winbind.init
|
|||||||
#%patch113 -p1 -b .warnings
|
#%patch113 -p1 -b .warnings
|
||||||
%patch114 -p1 -b .dfsroot
|
%patch114 -p1 -b .dfsroot
|
||||||
%patch115 -p1 -b .vista
|
%patch115 -p1 -b .vista
|
||||||
%patch116 -p1 -b .fhs
|
|
||||||
|
|
||||||
# crap
|
# crap
|
||||||
rm -f examples/VFS/.cvsignore
|
rm -f examples/VFS/.cvsignore
|
||||||
@ -192,7 +191,7 @@ CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -DLDAP_DEPRECATED" %configure \
|
|||||||
--with-utmp \
|
--with-utmp \
|
||||||
--with-vfs \
|
--with-vfs \
|
||||||
--without-smbwrapper \
|
--without-smbwrapper \
|
||||||
--with-lockdir=/var/cache/samba \
|
--with-lockdir=/var/lib/samba \
|
||||||
--with-piddir=/var/run \
|
--with-piddir=/var/run \
|
||||||
--with-mandir=%{_mandir} \
|
--with-mandir=%{_mandir} \
|
||||||
--with-privatedir=%{_sysconfdir}/samba \
|
--with-privatedir=%{_sysconfdir}/samba \
|
||||||
@ -228,7 +227,6 @@ mkdir -p $RPM_BUILD_ROOT/usr/{sbin,bin}
|
|||||||
mkdir -p $RPM_BUILD_ROOT/%{_initrddir}
|
mkdir -p $RPM_BUILD_ROOT/%{_initrddir}
|
||||||
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/{pam.d,logrotate.d}
|
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/{pam.d,logrotate.d}
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/{log,spool}/samba
|
mkdir -p $RPM_BUILD_ROOT/var/{log,spool}/samba
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/cache/samba
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/lib/samba
|
mkdir -p $RPM_BUILD_ROOT/var/lib/samba
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
|
mkdir -p $RPM_BUILD_ROOT/var/lib/samba/winbindd_privileged
|
||||||
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/swat/using_samba
|
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/swat/using_samba
|
||||||
@ -242,7 +240,7 @@ cd source
|
|||||||
BASEDIR=$RPM_BUILD_ROOT%{_prefix} \
|
BASEDIR=$RPM_BUILD_ROOT%{_prefix} \
|
||||||
SBINDIR=$RPM_BUILD_ROOT%{_sbindir} \
|
SBINDIR=$RPM_BUILD_ROOT%{_sbindir} \
|
||||||
DATADIR=$RPM_BUILD_ROOT%{_datadir} \
|
DATADIR=$RPM_BUILD_ROOT%{_datadir} \
|
||||||
LOCKDIR=$RPM_BUILD_ROOT/var/cache/samba \
|
LOCKDIR=$RPM_BUILD_ROOT/var/lib/samba \
|
||||||
PRIVATEDIR=$RPM_BUILD_ROOT%{_sysconfdir}/samba \
|
PRIVATEDIR=$RPM_BUILD_ROOT%{_sysconfdir}/samba \
|
||||||
LIBDIR=$RPM_BUILD_ROOT%{_libdir}/samba \
|
LIBDIR=$RPM_BUILD_ROOT%{_libdir}/samba \
|
||||||
CONFIGDIR=$RPM_BUILD_ROOT%{_sysconfdir}/samba \
|
CONFIGDIR=$RPM_BUILD_ROOT%{_sysconfdir}/samba \
|
||||||
@ -323,26 +321,25 @@ rm -f $RPM_BUILD_ROOT%{_sbindir}/{u,}mount.cifs
|
|||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%pre
|
#%pre
|
||||||
|
|
||||||
%post
|
%post
|
||||||
|
|
||||||
%preun
|
|
||||||
if [ $1 = 0 ] ; then
|
|
||||||
/sbin/chkconfig --del smb
|
|
||||||
rm -rf /var/log/samba/* /var/cache/samba/*
|
|
||||||
/sbin/service smb stop >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
%postun
|
|
||||||
if [ "$1" -ge "1" ]; then
|
if [ "$1" -ge "1" ]; then
|
||||||
%{_initrddir}/smb condrestart >/dev/null 2>&1
|
%{_initrddir}/smb condrestart >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
%preun
|
||||||
|
if [ $1 = 0 ] ; then
|
||||||
|
#rm -rf /var/log/samba/* /var/lib/samba/*
|
||||||
|
%{_initrddir}/smb stop >/dev/null 2>&1
|
||||||
|
/sbin/chkconfig --del smb
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
#%postun
|
||||||
|
|
||||||
%pre common
|
%pre common
|
||||||
/usr/sbin/groupadd -g 88 wbpriv || true
|
/usr/sbin/groupadd -g 88 wbpriv >/dev/null 2>&1 || true
|
||||||
|
|
||||||
%post common
|
%post common
|
||||||
/sbin/chkconfig --add winbind
|
/sbin/chkconfig --add winbind
|
||||||
@ -362,52 +359,63 @@ exit 0
|
|||||||
# are running, here as well, or we will mess up
|
# are running, here as well, or we will mess up
|
||||||
# shared (between winbindd and smbd/nmbd) tdbs
|
# shared (between winbindd and smbd/nmbd) tdbs
|
||||||
|
|
||||||
WINBINDD_RUNNING=0
|
|
||||||
SMBD_RUNNING=0
|
|
||||||
OLDPATH="/var/cache/samba"
|
OLDPATH="/var/cache/samba"
|
||||||
NEWPATH="/var/lib/samba"
|
NEWPATH="/var/lib/samba"
|
||||||
TDBLIST="account_policy.tdb brlock.tdb group_mapping.tdb ntdrivers.tdb ntprinters.tdb registry.tdb share_info.tdb winbindd_idmap.tdb wins.tdb"
|
|
||||||
DIRLIST="eventlog printing perfcount"
|
eval ls $OLDPATH/*.tdb >/dev/null 2>&1
|
||||||
|
if [ $? = 0 ]; then
|
||||||
|
|
||||||
|
#Stop daemons before we move the files around
|
||||||
|
|
||||||
#this is what condrestart checks as well
|
#this is what condrestart checks as well
|
||||||
if [ -f /var/lock/subsys/smb ]; then
|
|
||||||
SMBD_RUNNING=1
|
|
||||||
%{_initrddir}/smb stop >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
if [ -f /var/lock/subsys/winbindd ]; then
|
if [ -f /var/lock/subsys/winbindd ]; then
|
||||||
WINBINDD_RUNNING=1
|
%{_initrddir}/winbind stop >/dev/null 2>&1
|
||||||
%{_initrddir}/winbindd stop >/dev/null 2>&1
|
# Use a dirty trick to fool condrestart later
|
||||||
|
touch /var/lock/subsys/winbindd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for f in $TDBLIST; do
|
if [ -f /var/lock/subsys/smb ]; then
|
||||||
if [ -f $OLDPATH/$f ]; then
|
%{_initrddir}/smb stop >/dev/null 2>&1
|
||||||
mv -u $OLDPATH/$f $NEWPATH/$f
|
# We need to stop smbd here as we are moving also smbd owned files
|
||||||
|
# but we can't restart it until the new server is installed.
|
||||||
|
# Use a dirty trick to fool condrestart later
|
||||||
|
touch /var/lock/subsys/smb
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
for d in $DIRLIST; do
|
|
||||||
if [ -d $OLDPATH/$d ]; then
|
|
||||||
mv -u $OLDPATH/$d $NEWPATH/$d
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ $SMBD_RUNNING = 1 ]; then
|
eval ls $NEWPATH/*.tdb >/dev/null 2>&1
|
||||||
%{_initrddir}/smb start >/dev/null 2>&1
|
if [ $? = 0 ]; then
|
||||||
|
#something strange here, lets backup this stuff and avoid just wiping it
|
||||||
|
|
||||||
|
mkdir $NEWPATH.pkgbkp
|
||||||
|
mv -f $NEWPATH/*.tdb $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
||||||
|
mv -f $NEWPATH/*.dat $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
||||||
|
mv -f $NEWPATH/perfmon $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
||||||
|
mv -f $NEWPATH/printing $NEWPATH.pkgbkp/ >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
if [ $WINBINDD_RUNNING = 1 ]; then
|
|
||||||
%{_initrddir}/winbind start >/dev/null 2>&1
|
mv -f $OLDPATH/*.tdb $NEWPATH/ >/dev/null 2>&1
|
||||||
|
mv -f $OLDPATH/*.dat $NEWPATH/ >/dev/null 2>&1
|
||||||
|
mv -f $OLDPATH/perfmon $NEWPATH/ >/dev/null 2>&1
|
||||||
|
mv -f $OLDPATH/printing $NEWPATH/ >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" -ge "1" ]; then
|
||||||
|
%{_initrddir}/winbind condrestart >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%preun common
|
%preun common
|
||||||
if [ $1 = 0 ] ; then
|
if [ $1 = 0 ] ; then
|
||||||
|
%{_initrddir}/winbind stop >/dev/null 2>&1
|
||||||
/sbin/chkconfig --del winbind
|
/sbin/chkconfig --del winbind
|
||||||
/sbin/service winbind stop >/dev/null 2>&1
|
rm -rf /var/log/samba/* /var/lib/samba/*
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%postun common
|
%postun common
|
||||||
if [ "$1" -ge "1" ]; then
|
# moved in post
|
||||||
%{_initrddir}/winbind condrestart >/dev/null 2>&1
|
#if [ "$1" -ge "1" ]; then
|
||||||
fi
|
# %{_initrddir}/winbind condrestart >/dev/null 2>&1
|
||||||
|
#fi
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
|
|
||||||
%files
|
%files
|
||||||
@ -437,7 +445,6 @@ fi
|
|||||||
%{_libdir}/samba/vfs
|
%{_libdir}/samba/vfs
|
||||||
%{_libdir}/samba/idmap
|
%{_libdir}/samba/idmap
|
||||||
%{_libdir}/samba/auth
|
%{_libdir}/samba/auth
|
||||||
%dir /var/cache/samba
|
|
||||||
%attr(1777,root,root) %dir /var/spool/samba
|
%attr(1777,root,root) %dir /var/spool/samba
|
||||||
|
|
||||||
%files swat
|
%files swat
|
||||||
@ -500,7 +507,6 @@ fi
|
|||||||
%{_bindir}/profiles
|
%{_bindir}/profiles
|
||||||
%{_bindir}/smbcquotas
|
%{_bindir}/smbcquotas
|
||||||
%{_sbindir}/winbindd
|
%{_sbindir}/winbindd
|
||||||
%dir /var/cache/samba
|
|
||||||
%dir /var/lib/samba
|
%dir /var/lib/samba
|
||||||
%dir /var/run/winbindd
|
%dir /var/run/winbindd
|
||||||
%attr(750,root,wbpriv) %dir /var/lib/samba/winbindd_privileged
|
%attr(750,root,wbpriv) %dir /var/lib/samba/winbindd_privileged
|
||||||
@ -544,9 +550,9 @@ fi
|
|||||||
%{_libdir}/libsmbclient.a
|
%{_libdir}/libsmbclient.a
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Mar 12 2007 Simo Sorce <ssorce@redhat.com> 3.0.24-3.fc7
|
* Thu Mar 15 2007 Simo Sorce <ssorce@redhat.com> 3.0.24-3.fc7
|
||||||
- Directories reorg, persistent files must go to /var/lib, not
|
- Directories reorg, tdb files must go to /var/lib, not
|
||||||
to /var/cache
|
to /var/cache, add migration script in %post common
|
||||||
- Split out devel and doc packages
|
- Split out devel and doc packages
|
||||||
- Remove libmsrpc.[h|so] for now as they are not really usable
|
- Remove libmsrpc.[h|so] for now as they are not really usable
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user