r14317: Use source/bin as dir to link pam_winbind instead of source/nsswitch/
[abartlet/samba.git/.git] / packaging / Solaris / makepkg.sh
index 7f8c4b6d7171fba612bb5a2144d70cde4eb44321..6a8660b350c5f7ea115f8cc3379bf2fb95e873f4 100644 (file)
@@ -9,11 +9,12 @@
 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 eventlogadm 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"
 CHARSETLIBS="CP437.so CP850.so"
+AUTHLIBS="script.so"
 
 add_dynamic_entries() 
 {
@@ -43,18 +44,31 @@ add_dynamic_entries()
        for file in $CHARSETLIBS; do
                echo f none lib/charset/$file 0755 root other
        done
+       for file in $AUTHLIBS; do
+               echo f none lib/auth/$file 0755 root other
+       done
        
        echo "#\n# libsmbclient\n#"
        echo f none lib/libsmbclient.so 0755 root other
+       echo f none lib/libsmbclient.a 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
+       echo "#\n# libmsrpc\n#"
+       echo f none lib/libmsrpc.so 0755 root other
+       echo f none lib/libmsrpc.a 0755 root other
+       echo f none include/libmsrpc.h 0644 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 +114,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
@@ -113,15 +128,16 @@ echo "Assuming Samba distribution is rooted at $DISTR_BASE.."
 
 cd $DISTR_BASE/source
 
-if [ "x$1" != "xnobuild" ]; then
-       ./configure --prefix=$INSTALL_DIR \
-               --with-acl-support \
-               --with-included-popt \
+if test "x$1" = "xbuild" ]; then
+       ./configure --prefix=$INSTALL_BASE \
                --localstatedir=/var/lib/samba \
                --with-piddir=/var/run \
                --with-logfilebase=/var/log/samba \
                --with-privatedir=/etc/samba/private \
                --with-configdir=/etc/samba \
+               --with-lockdir=/var/lib/samba \
+               --with-pam --with-acl-support \
+               --with-quotas --with-included-popt \
        && make
 
        if [ $? -ne 0 ]; then
@@ -130,11 +146,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 +159,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 +168,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
+if [ -f bin/pam_winbind.so ]; then
+       cp -fp bin/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
-
-cp -p bin/smbwrapper.so $TMPINSTALLDIR/$INSTALL_BASE/lib
-cp -p bin/smbsh $TMPINSTALLDIR/$INSTALL_BASE/bin
 
 mkdir -p $TMPINSTALLDIR/$INSTALL_BASE/docs
 cp -p ../docs/*pdf $TMPINSTALLDIR/$INSTALL_BASE/docs
@@ -192,6 +213,7 @@ done
 ##
 echo "CONFIGDIR=$CONFIGDIR" >> pkginfo
 echo "LOGFILEBASE=$LOGFILEBASE" >> pkginfo
+echo "LOCKDIR=$LOCKDIR" >> pkginfo
 echo "PIDDIR=$PIDDIR" >> pkginfo
 echo "PRIVATE_DIR=$PRIVATE_DIR" >> pkginfo