[PATCH] Allow RPM building as non-root

Andrew Bartlett abartlet at pcug.org.au
Sun May 6 10:22:21 GMT 2001

The attached patch (re)fixes rpm-building as a non-root user.  

It also makes more of the work just redirect to the Makefile, as that is
more likaly to stay up-to-date.  As a consequence smbmount and friends
now lives in /usr/bin.  (RedHat does this as well, and probably for
exactly the same reason).

Tested: RPMv3 RPMv4

Andrew Bartlett
Andrew Bartlett
abartlet at pcug.org.au
-------------- next part --------------
Index: packaging/RedHat/samba2.spec.tmpl
RCS file: /cvsroot/samba/packaging/RedHat/samba2.spec.tmpl,v
retrieving revision
diff -u -r1.18.6.19 samba2.spec.tmpl
--- packaging/RedHat/samba2.spec.tmpl	18 Apr 2001 17:17:13 -0000
+++ packaging/RedHat/samba2.spec.tmpl	6 May 2001 10:04:21 -0000
@@ -185,38 +185,28 @@
 mkdir -p $RPM_BUILD_ROOT/var/spool/samba
 mkdir -p $RPM_BUILD_ROOT/lib
-# Install standard binary files
-for i in nmblookup smbclient smbpasswd smbstatus testparm testprns \
-      make_smbcodepage make_unicodemap make_printerdef rpcclient smbspool \
-      smbcacls smbcontrol
-install -m755 -s source/bin/$i $RPM_BUILD_ROOT%{prefix}/bin
 for i in mksmbpasswd.sh smbtar 
 install -m755 source/script/$i $RPM_BUILD_ROOT%{prefix}/bin
-# Install secure binary files
-for i in smbd nmbd swat smbmount smbumount smbmnt debug2html 
-install -m755 -s source/bin/$i $RPM_BUILD_ROOT%{prefix}/sbin
 # we need a symlink for mount to recognise the smb and smbfs filesystem types
-ln -sf %{prefix}/sbin/smbmount $RPM_BUILD_ROOT/sbin/mount.smbfs
-ln -sf %{prefix}/sbin/smbmount $RPM_BUILD_ROOT/sbin/mount.smb
+ln -sf %{prefix}/bin/smbmount $RPM_BUILD_ROOT/sbin/mount.smbfs
+ln -sf %{prefix}/bin/smbmount $RPM_BUILD_ROOT/sbin/mount.smb
 # This allows us to get away without duplicating code that 
 #  sombody else can maintain for us.  
 cd source
-make LIBDIR=$RPM_BUILD_ROOT/etc/samba \
+	LIBDIR=$RPM_BUILD_ROOT/etc/samba \
 	BINDIR=$RPM_BUILD_ROOT%{prefix}/bin \
 	SWATDIR=$RPM_BUILD_ROOT/usr/share/swat \
 	SAMBABOOK=$RPM_BUILD_ROOT/usr/share/swat/using_samba \
-	installman installcp installswat
+	installbin installman installcp installswat
 cd ..
 # Install codepage source files
@@ -403,28 +393,9 @@
 %attr(-,root,root) %{prefix}/sbin/smbd
 %attr(-,root,root) %{prefix}/sbin/nmbd
 %attr(-,root,root) %{prefix}/sbin/swat
-%attr(-,root,root) %{prefix}/sbin/smbmnt
-%attr(-,root,root) %{prefix}/sbin/smbmount
-%attr(-,root,root) %{prefix}/sbin/smbumount
 %attr(-,root,root) /sbin/mount.smbfs
 %attr(-,root,root) /sbin/mount.smb
-%attr(-,root,root) %{prefix}/bin/mksmbpasswd.sh
-%attr(-,root,root) %{prefix}/bin/smbclient
-%attr(-,root,root) %{prefix}/bin/smbspool
-%attr(-,root,root) %{prefix}/bin/rpcclient
-%attr(-,root,root) %{prefix}/bin/testparm
-%attr(-,root,root) %{prefix}/bin/testprns
-%attr(-,root,root) %{prefix}/bin/findsmb
-%attr(-,root,root) %{prefix}/bin/smbstatus
-%attr(-,root,root) %{prefix}/bin/nmblookup
-%attr(-,root,root) %{prefix}/bin/make_smbcodepage
-%attr(-,root,root) %{prefix}/bin/make_unicodemap
-%attr(-,root,root) %{prefix}/bin/make_printerdef
-%attr(-,root,root) %{prefix}/bin/smbpasswd
-%attr(-,root,root) %{prefix}/bin/smbtar
-%attr(-,root,root) %{prefix}/bin/smbprint
-%attr(-,root,root) %{prefix}/bin/smbcontrol
-%attr(-,root,root) %{prefix}/bin/smbcacls
+%attr(-,root,root) %{prefix}/bin/*
 %attr(755,root,root) /lib/libnss_wins.s*
 %attr(-,root,root) %{prefix}/share/swat/help/*
 %attr(-,root,root) %{prefix}/share/swat/images/*

More information about the samba-technical mailing list