r11170: root free pass on eventlog open access check
[ira/wip.git] / packaging / RedHat / samba.spec.tmpl
index 1ada371d0d87ce851922403a24ef79a7d7599084..004f57cf5227fb9a75412c4dc5f0663dd70ae6dd 100644 (file)
@@ -16,7 +16,8 @@ Source998: filter-requires-samba_rh8.sh
 Source999: filter-requires-samba_rh9.sh
 
 Packager: Gerald Carter [Samba-Team] <jerry@samba.org>
-Requires: pam >= 0.72 kernel >= 2.2.1 glibc >= 2.1.2
+Requires: pam openldap krb5-libs cups
+BuildRequires: openldap-devel krb5-devel pam-devel cups-devel
 Prereq: chkconfig fileutils /sbin/ldconfig
 Provides: samba = %{version}
 Obsoletes: samba-common, samba-client, samba-swat
@@ -89,18 +90,21 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA" ./configure \
        --with-fhs \
        --with-quotas \
        --with-smbmount \
+       --enable-cups \
        --with-pam \
        --with-pam_smbpass \
        --with-syslog \
        --with-utmp \
        --with-sambabook=%{prefix}/share/swat/using_samba \
        --with-swatdir=%{prefix}/share/swat \
+       --with-shared-modules=idmap_rid \
        --with-libsmbclient 
 make -j${NUMCPU} proto
-make -j${NUMCPU} all nsswitch/libnss_wins.so 
+make -j${NUMCPU} all modules nsswitch/libnss_wins.so 
 make -j${NUMCPU} debug2html
 
 # Remove some permission bits to avoid to many dependencies
+cd ..
 find examples docs -type f | xargs -r chmod -x
 
 %install
@@ -111,7 +115,7 @@ mkdir -p $RPM_BUILD_ROOT/etc/samba
 mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,samba}
 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
 mkdir -p $RPM_BUILD_ROOT%{prefix}/{bin,sbin}
-mkdir -p $RPM_BUILD_ROOT%{prefix}/share/swat/{images,help,include,using_samba}
+mkdir -p $RPM_BUILD_ROOT%{prefix}/share/swat/{help,include,using_samba}
 mkdir -p $RPM_BUILD_ROOT%{prefix}/share/swat/using_samba/{figs,gifs}
 mkdir -p $RPM_BUILD_ROOTMANDIR_MACRO
 mkdir -p $RPM_BUILD_ROOT/var/lib/samba
@@ -122,9 +126,9 @@ mkdir -p $RPM_BUILD_ROOT%{prefix}/lib/samba/vfs
 mkdir -p $RPM_BUILD_ROOT%{prefix}/{lib,include}
 
 # Install standard binary files
-for i in nmblookup smbclient smbpasswd smbstatus testparm testprns \
+for i in nmblookup smbclient smbpasswd smbstatus testparm \
        rpcclient smbspool smbcacls smbcontrol wbinfo smbmnt net \
-       smbcacls pdbedit tdbbackup smbtree ntlm_auth smbcquotas
+       smbcacls pdbedit eventlogadm tdbbackup smbtree ntlm_auth smbcquotas
 do
        install -m755 source/bin/$i $RPM_BUILD_ROOT%{prefix}/bin
 done
@@ -160,6 +164,13 @@ make DESTDIR=$RPM_BUILD_ROOT \
        installman installswat installdat installmodules
 cd ..
 
+## don't duplicate the docs.  These are installed with SWAT
+rm -rf docs/htmldocs
+rm -rf docs/manpages
+( cd docs; ln -s %{prefix}/share/swat/help htmldocs )
+
+
+
 # Install the nsswitch wins library
 install -m755 source/nsswitch/libnss_wins.so $RPM_BUILD_ROOT/lib
 ( cd $RPM_BUILD_ROOT/lib; ln -sf libnss_wins.so libnss_wins.so.2 )
@@ -177,6 +188,11 @@ install -m 755 source/bin/libsmbclient.so $RPM_BUILD_ROOT%{prefix}/lib/
 install -m 755 source/bin/libsmbclient.a $RPM_BUILD_ROOT%{prefix}/lib/
 install -m 644 source/include/libsmbclient.h $RPM_BUILD_ROOT%{prefix}/include/
 
+# libmsrpc
+install -m 755 source/bin/libmsrpc.so $RPM_BUILD_ROOT%{prefix}/lib/
+install -m 755 source/bin/libmsrpc.a $RPM_BUILD_ROOT%{prefix}/lib/
+install -m 644 source/include/libmsrpc.h $RPM_BUILD_ROOT%{prefix}/include/
+
 # Install the miscellany
 install -m755 packaging/RedHat/smbprint $RPM_BUILD_ROOT%{prefix}/bin
 install -m755 packaging/RedHat/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb
@@ -193,6 +209,16 @@ echo 127.0.0.1 localhost > $RPM_BUILD_ROOT/etc/samba/lmhosts
 # Remove "*.old" files
 find $RPM_BUILD_ROOT -name "*.old" -exec rm -f {} \;
 
+##
+## Clean out man pages for tools not installed here
+##
+rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/editreg.1*
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/log2pcap.1*
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbsh.1*
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/smbget.1*
+rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/mount.cifs.8*
+
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -285,16 +311,13 @@ else
        rm -f /etc/samba/samba.xinetd
 fi
 
-# Install the correct version of the samba pam file, depending on pam version.
-# (always keep an existing PAM config file)
-if [ ! -f /lib/security/pam_stack.so ]; then 
-       if [ -f /lib/security/pam_stack.so ]; then
-               echo "Installing stack version of /etc/pam.d/samba..."
-               mv /etc/samba/samba.stack /etc/pam.d/samba
-       else
-               echo "Installing non-stack version of /etc/pam.d/samba..."
-               rm -f /etc/samba/samba.stack
-       fi
+# Install the correct version of the samba pam file
+if [ -f /lib/security/pam_stack.so ]; then
+       echo "Installing stack version of /etc/pam.d/samba..."
+       mv /etc/samba/samba.stack /etc/pam.d/samba
+else
+       echo "Installing non-stack version of /etc/pam.d/samba..."
+       rm -f /etc/samba/samba.stack
 fi
 
 ## call ldconfig to create the version symlink for libsmbclient.so
@@ -396,7 +419,6 @@ fi
 %{prefix}/bin/smbspool
 %{prefix}/bin/rpcclient
 %{prefix}/bin/testparm
-%{prefix}/bin/testprns
 %{prefix}/bin/findsmb
 %{prefix}/bin/smbstatus
 %{prefix}/bin/nmblookup
@@ -410,23 +432,26 @@ fi
 %{prefix}/bin/smbcquotas
 %{prefix}/bin/smbcacls
 %{prefix}/bin/pdbedit
+%{prefix}/bin/eventlogadm
 %{prefix}/bin/tdbbackup
 %{prefix}/bin/smbtree
 %attr(755,root,root) /lib/libnss_wins.s*
 %attr(755,root,root) %{prefix}/lib/samba/vfs/*.so
+%attr(755,root,root) %{prefix}/lib/samba/auth/*.so
 %attr(755,root,root) %{prefix}/lib/samba/charset/*.so
+%attr(755,root,root) %{prefix}/lib/samba/idmap/*.so
 #%attr(755,root,root) %{prefix}/lib/samba/pdb/*.so
 %attr(755,root,root) %{prefix}/lib/samba/*.dat
 %attr(755,root,root) %{prefix}/lib/samba/*.msg
 %{prefix}/include/libsmbclient.h
 %{prefix}/lib/libsmbclient.a
 %{prefix}/lib/libsmbclient.so
+%{prefix}/include/libmsrpc.h
+%{prefix}/lib/libmsrpc.a
+%{prefix}/lib/libmsrpc.so
 %{prefix}/share/swat/help/*
-%{prefix}/share/swat/images/*
 %{prefix}/share/swat/include/*.html
 %{prefix}/share/swat/lang/*/help/*
-%{prefix}/share/swat/lang/*/images/*
-%{prefix}/share/swat/lang/*/include/*.html
 %{prefix}/share/swat/using_samba/*
 %config(noreplace) /etc/samba/lmhosts
 %config(noreplace) /etc/samba/smb.conf