r6947: Removal of testprns from package spec.
[garming/samba-autobuild/.git] / packaging / Solaris / makepkg.sh
index 6d4130b29275a306e461289af08a62a2ea75d2ee..10ffa1a30727b535760e0a0bc4a1997a386d2c22 100644 (file)
@@ -8,8 +8,8 @@
 
 INSTALL_BASE=/opt/samba
 
-SBINPROS="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"
+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"
 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"
@@ -34,12 +34,12 @@ add_dynamic_entries()
        for file in $MSGFILES; do
                echo f none lib/$file 0644 root other
        done
-       for file in $VFSLIBS; do
-               echo f none lib/vfs/$file 0755 root other
-       done
        for file in $DATFILES; do
                echo f none lib/$file 0644 root other
        done
+       for file in $VFSLIBS; do
+               echo f none lib/vfs/$file 0755 root other
+       done
        for file in $CHARSETLIBS; do
                echo f none lib/charset/$file 0755 root other
        done
@@ -48,27 +48,31 @@ add_dynamic_entries()
        echo f none lib/libsmbclient.so 0755 root other
        echo f none include/libsmbclient.h 0644 root other
 
-       echo "#\n# nss_winbind.so\n#"
-       echo f none /usr/lib/nss_winbind.so.1=lib/libnss_winbind.so 0755 root other
-       echo s none /lib/nss_winbind.so.1=../usr/lib/nss_winbind.so.1 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 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
 
-       # Add the manpages
        echo "#\n# man pages \n#"
-       echo d none /usr ? ? ?
-       echo d none /usr/share ? ? ?
-       echo d none /usr/share/man ? ? ?
 
        # Create directories for man page sections if nonexistent
        cd man
        for i in 1 2 3 4 5 6 7 8 9; do
-               manpages=`ls *.$i 2>/dev/null`
+               manpages=`ls man$i 2>/dev/null`
                if [ $? -eq 0 ]; then
-                       echo d none /usr/share/man/man$i ? ? ?
+                       echo d none man/man${i} ? ? ?
                        for manpage in $manpages; do
-                               echo f none /usr/share/man/man${i}/${manpage}=docs/manpages/$manpage 0644 root other
+                               echo f none man/man${i}/${manpage} 0644 root other
                        done
                fi
        done
@@ -90,7 +94,7 @@ add_dynamic_entries()
        done
 
        # Create entries for docs for the beginner
-       echo s none docs/using_samba=$BASEDIR/swat/help/using_samba
+       echo 's none docs/using_samba=$BASEDIR/swat/using_samba'
        for file in docs/*pdf; do
                echo f none $file 0644 root other
        done
@@ -100,12 +104,13 @@ add_dynamic_entries()
 ## BEGIN MAIN 
 #####################################################################
 
-TMPINSTALLDIR=$HOME/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,12 +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_winbind.so $TMPINSTALLDIR/$LIBDIR/libnss_winbind.so
+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
+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
@@ -187,14 +200,10 @@ done
 ##
 ## Start building the prototype file
 ##
-echo "SBINDIR=sbin" >> pkginfo
-echo "BINDIR=bin" >> pkginfo
-echo "SWATDIR=swat" >> pkginfo
 echo "CONFIGDIR=$CONFIGDIR" >> pkginfo
 echo "LOGFILEBASE=$LOGFILEBASE" >> pkginfo
-echo "LIBDIR=lib" >> pkginfo
+echo "LOCKDIR=$LOCKDIR" >> pkginfo
 echo "PIDDIR=$PIDDIR" >> pkginfo
-echo "DOCDIR=docs" >> pkginfo
 echo "PRIVATE_DIR=$PRIVATE_DIR" >> pkginfo
 
 cp prototype.master prototype