r6947: Removal of testprns from package spec.
[garming/samba-autobuild/.git] / packaging / Solaris / makepkg.sh
index 7f8c4b6d7171fba612bb5a2144d70cde4eb44321..10ffa1a30727b535760e0a0bc4a1997a386d2c22 100644 (file)
@@ -9,7 +9,7 @@
 INSTALL_BASE=/opt/samba
 
 SBINPROGS="smbd nmbd winbindd swat"
-BINPROGS="findsmb nmblookup pdbedit rpcclient smbclient smbcquotas smbspool smbtar tdbbackup testparm wbinfo net ntlm_auth profiles smbcacls smbcontrol smbpasswd smbstatus smbtree tdbdump testprns"
+BINPROGS="findsmb nmblookup pdbedit rpcclient smbclient smbcquotas smbspool smbtar tdbbackup testparm wbinfo net ntlm_auth profiles smbcacls smbcontrol smbpasswd smbstatus smbtree tdbdump"
 MSGFILES="de.msg en.msg fr.msg it.msg ja.msg nl.msg pl.msg tr.msg"
 VFSLIBS="audit.so default_quota.so extd_audit.so full_audit.so readonly.so shadow_copy.so cap.so expand_msdfs.so fake_perms.so netatalk.so recycle.so"
 DATFILES="lowcase.dat upcase.dat valid.dat"
@@ -48,13 +48,17 @@ add_dynamic_entries()
        echo f none lib/libsmbclient.so 0755 root other
        echo f none include/libsmbclient.h 0644 root other
 
-       echo "#\n# smbwrapper\n#"
-       echo f none lib/smbwrapper.so 0755 root other
-       echo f none bin/smbsh 0755 root other
+       if [ -f lib/smbwrapper.so -a -f bin/smbsh ]; then
+               echo "#\n# smbwrapper\n#"
+               echo f none lib/smbwrapper.so 0755 root other
+               echo f none bin/smbsh 0755 root other
+       fi
 
-       echo "#\n# nss_winbind.so\n#"
+       echo "#\n# nss_winbind.so and nss_wins.so\n#"
        echo f none /lib/nss_winbind.so.1=lib/nss_winbind.so.1 0755 root other
+       echo f none /lib/nss_wins.so.1=lib/nss_wins.so.1 0755 root other
        # echo s none /lib/nss_winbind.so.1=/usr/lib/nss_winbind.so.1 0755 root other
+       # echo s none /lib/nss_wins.so.1=/usr/lib/nss_wins.so.1 0755 root other
        if [ -f lib/pam_winbind.so ]; then
                echo f none /usr/lib/security/pam_winbind.so=lib/pam_winbind.so 0755 root other
        fi
@@ -100,12 +104,13 @@ add_dynamic_entries()
 ## BEGIN MAIN 
 #####################################################################
 
-TMPINSTALLDIR=/export/build
-
 # Try to guess the distribution base..
-CURR_DIR=`pwd`
-DISTR_BASE=`echo $CURR_DIR | sed 's|\(.*\)/packaging.*|\1|'`
-echo "Assuming Samba distribution is rooted at $DISTR_BASE.."
+DISTR_BASE=`dirname \`pwd\` |sed -e 's@/packaging$@@'`
+echo "Distribution base:  $DISTR_BASE"
+
+TMPINSTALLDIR="/tmp/`basename $DISTR_BASE`-build"
+echo "Temp install dir:   $TMPINSTALLDIR"
+echo "Install directory:  $INSTALL_BASE"
 
 ##
 ## first build the source
@@ -114,7 +119,7 @@ echo "Assuming Samba distribution is rooted at $DISTR_BASE.."
 cd $DISTR_BASE/source
 
 if [ "x$1" != "xnobuild" ]; then
-       ./configure --prefix=$INSTALL_DIR \
+       ./configure --prefix=$INSTALL_BASE \
                --with-acl-support \
                --with-included-popt \
                --localstatedir=/var/lib/samba \
@@ -130,11 +135,11 @@ if [ "x$1" != "xnobuild" ]; then
        fi
 fi
        
+mkdir $TMPINSTALLDIR
 make DESTDIR=$TMPINSTALLDIR install
 
 ## clear out *.old
-( cd $TMPINSTALLDIR; du -a | grep \.old$ | awk '{print "rm -rf "$2}' | sh )
-
+find $TMPINSTALLDIR -name \*.old |while read x; do rm -rf "$x"; done
  
 ##
 ## Now get the install locations
@@ -143,6 +148,7 @@ SBINDIR=`bin/smbd -b | grep SBINDIR | awk '{print $2}'`
 BINDIR=`bin/smbd -b | grep BINDIR | grep -v SBINDIR |  awk '{print $2}'`
 SWATDIR=`bin/smbd -b | grep SWATDIR | awk '{print $2}'`
 CONFIGFILE=`bin/smbd -b | grep CONFIGFILE | awk '{print $2}'`
+LOCKDIR=`bin/smbd -b | grep LOCKDIR | awk '{print $2}'`
 CONFIGDIR=`dirname $CONFIGFILE`
 LOGFILEBASE=`bin/smbd -b | grep LOGFILEBASE | awk '{print $2}'`
 LIBDIR=`bin/smbd -b | grep LIBDIR | awk '{print $2}'`
@@ -151,15 +157,19 @@ PRIVATE_DIR=`bin/smbd -b | grep PRIVATE_DIR | awk '{print $2}'`
 DOCDIR=$INSTALL_BASE/docs
 
 ## 
-## copy some misc files that are ont done as part of 'make install'
+## copy some misc files that are not done as part of 'make install'
 ##
+cp -fp nsswitch/libnss_wins.so $TMPINSTALLDIR/$LIBDIR/nss_wins.so.1
 cp -fp nsswitch/libnss_winbind.so $TMPINSTALLDIR/$LIBDIR/nss_winbind.so.1
 if [ -f nsswitch/pam_winbind.so ]; then
        cp -fp nsswitch/pam_winbind.so $TMPINSTALLDIR/$LIBDIR/pam_winbind.so
 fi
-
-cp -p bin/smbwrapper.so $TMPINSTALLDIR/$INSTALL_BASE/lib
-cp -p bin/smbsh $TMPINSTALLDIR/$INSTALL_BASE/bin
+if [ -f bin/smbwrapper.so ]; then
+       cp -fp bin/smbwrapper.so $TMPINSTALLDIR/$INSTALL_BASE/lib
+fi
+if [ -f bin/smbsh ]; then
+       cp -fp bin/smbsh $TMPINSTALLDIR/$INSTALL_BASE/bin
+fi
 
 mkdir -p $TMPINSTALLDIR/$INSTALL_BASE/docs
 cp -p ../docs/*pdf $TMPINSTALLDIR/$INSTALL_BASE/docs
@@ -192,6 +202,7 @@ done
 ##
 echo "CONFIGDIR=$CONFIGDIR" >> pkginfo
 echo "LOGFILEBASE=$LOGFILEBASE" >> pkginfo
+echo "LOCKDIR=$LOCKDIR" >> pkginfo
 echo "PIDDIR=$PIDDIR" >> pkginfo
 echo "PRIVATE_DIR=$PRIVATE_DIR" >> pkginfo