#!/bin/sh
+# Copyright (C) John H Terpstra and Erik Troan - 1997
+#
# First we move all our gear into place - a noble move!
RPMDIR=`rpm --showrc | awk '/^rpmdir/ { print $3}'`
SPECDIR=`rpm --showrc | awk '/^specdir/ { print $3}'`
rm -rf $RPM_BUILD_ROOT
%post
+if [ -d /etc/pam.d ]; then
+install -m 644 examples/redhat/samba.pamd $RPM_BUILD_ROOT/etc/pam.d/samba
+else
/sbin/pamconfig --add --service=samba --password=none --sesslist=none
+fi
if [ ! -f /var/log/samba ]; then
touch /var/log/samba
%postun
if [ "$1" = 0 ] ; then
- /sbin/pamconfig --remove --service=samba --password=none --sesslist=none
+ if [ -x /etc/pam.d/samba ]; then
+ rm -f /etc/pam.d/samba
+ else
+ if [ -x /etc/pam.conf ]; then
+ /sbin/pamconfig --remove --service=samba --password=none --sesslist=none
+ fi
+ fi
fi
%files
%attr(-,root,root) %config /etc/rc.d/rc6.d/K35smb
%attr(-,root,root) %config /etc/rc.d/rc2.d/K35smb
%attr(-,root,root) %config /etc/logrotate.d/samba
+if [ -x /etc/pam.d/samba ]; then
+ %attr(-,root,root) %config /etc/pam.d/samba
+fi
%attr(-,root,root) /usr/man/man1/smbstatus.1
%attr(-,root,root) /usr/man/man1/smbclient.1
%attr(-,root,root) /usr/man/man1/smbrun.1