From f1909f3d5d948d8ef7d47a7b37d53b0121e09346 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sun, 7 Nov 2004 19:59:09 +0000 Subject: [PATCH] r3603: updating packaging for 3.0.8 (sync from 3.0 tree) --- packaging/Fedora/samba.spec.tmpl | 1 + packaging/Solaris/makepkg.sh | 230 +++++++++++++++++++++++++++++++++++++ packaging/Solaris/makepkg.sh.tmpl | 182 ----------------------------- packaging/Solaris/pkginfo.master | 6 +- packaging/Solaris/postinstall | 6 - packaging/Solaris/preremove | 4 +- packaging/Solaris/prototype.master | 97 +++++++--------- 7 files changed, 279 insertions(+), 247 deletions(-) create mode 100644 packaging/Solaris/makepkg.sh delete mode 100755 packaging/Solaris/makepkg.sh.tmpl rewrite packaging/Solaris/prototype.master (82%) diff --git a/packaging/Fedora/samba.spec.tmpl b/packaging/Fedora/samba.spec.tmpl index f3fae29a5ee..b24335387ca 100644 --- a/packaging/Fedora/samba.spec.tmpl +++ b/packaging/Fedora/samba.spec.tmpl @@ -273,6 +273,7 @@ fi %{_bindir}/smbstatus # %{_bindir}/smbadduser %{_bindir}/tdbbackup +%{_bindir}/tdbtool %config(noreplace) %{_sysconfdir}/sysconfig/samba %config(noreplace) %{_sysconfdir}/samba/smbusers %attr(755,root,root) %config %{initdir}/smb diff --git a/packaging/Solaris/makepkg.sh b/packaging/Solaris/makepkg.sh new file mode 100644 index 00000000000..fdf4811a56d --- /dev/null +++ b/packaging/Solaris/makepkg.sh @@ -0,0 +1,230 @@ +#!/bin/sh +# +# Copyright (C) Shirish A Kalele 2000 +# Copyright (C) Gerald Carter 2004 +# +# script for build solaris Samba package +# + +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" +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" + +add_dynamic_entries() +{ + # Add the binaries, docs and SWAT files + cd $TMPINSTALLDIR/$INSTALL_BASE + + echo "#\n# Server Binaries \n#" + for file in $SBINPROGS; do + echo f none sbin/$file 0755 root other + done + + echo "#\n# User Binaries \n#" + for file in $BINPROGS; do + echo f none bin/$file 0755 root other + done + + echo "#\n# Libraries\n#" + 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 $CHARSETLIBS; do + echo f none lib/charset/$file 0755 root other + done + + echo "#\n# libsmbclient\n#" + 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 + + 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/pam_winbind.so ]; then + echo f none /usr/lib/security/pam_winbind.so=lib/pam_winbind.so 0755 root other + fi + if [ -f lib/pam_smbpass.so ]; then + echo f none /usr/lib/security/pam_pam_smbpass.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` + if [ $? -eq 0 ]; then + echo d none /usr/share/man/man$i ? ? ? + for manpage in $manpages; do + echo f none /usr/share/man/man${i}/${manpage}=docs/manpages/$manpage 0644 root other + done + fi + done + cd .. + + echo "#\n# SWAT \n#" + list=`find swat -type d | grep -v "/.svn$"` + for dir in $list; do + if [ -d $dir ]; then + echo d none $dir 0755 root other + fi + done + + list=`find swat -type f | grep -v /.svn/` + for file in $list; do + if [ -f $file ]; then + echo f none $file 0644 root other + fi + done + + # Create entries for docs for the beginner + echo s none docs/using_samba=$BASEDIR/swat/help/using_samba + for file in docs/*pdf; do + echo f none $file 0644 root other + done +} + +##################################################################### +## 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.." + +## +## first build the source +## + +cd $DISTR_BASE/source + +if [ "x$1" != "xnobuild" ]; then + ./configure --prefix=$INSTALL_DIR \ + --with-acl-support \ + --with-included-popt \ + --with-pam_smbpass \ + --localstatedir=/var/lib/samba \ + --with-piddir=/var/run \ + --with-logfilebase=/var/log/samba \ + --with-privatedir=/etc/samba/private \ + --with-configdir=/etc/samba \ + && make + + if [ $? -ne 0 ]; then + echo "Build failed! Exiting...." + exit 1 + fi +fi + +make DESTDIR=$TMPINSTALLDIR install + +## clear out *.old +( cd $TMPINSTALLDIR; du -a | grep \.old$ | awk '{print "rm -rf "$2}' | sh ) + + +## +## Now get the install locations +## +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}'` +CONFIGDIR=`dirname $CONFIGFILE` +LOGFILEBASE=`bin/smbd -b | grep LOGFILEBASE | awk '{print $2}'` +LIBDIR=`bin/smbd -b | grep LIBDIR | awk '{print $2}'` +PIDDIR=`bin/smbd -b | grep PIDDIR | awk '{print $2}'` +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' +## +cp -fp nsswitch/libnss_winbind.so $TMPINSTALLDIR/$LIBDIR/libnss_winbind.so +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 + +mkdir -p $TMPINSTALLDIR/$INSTALL_BASE/docs +cp -p ../docs/*pdf $TMPINSTALLDIR/$INSTALL_BASE/docs + + +cd $DISTR_BASE/packaging/Solaris + +## +## Main driver +## + +# Setup version from smbd -V + +VERSION=`$TMPINSTALLDIR/$SBINDIR/smbd -V | awk '{print $2}'` +sed -e "s|__VERSION__|$VERSION|" -e "s|__ARCH__|`uname -p`|" -e "s|__BASEDIR__|$INSTALL_BASE|g" pkginfo.master > pkginfo + +sed -e "s|__BASEDIR__|$INSTALL_BASE|g" inetd.conf.master > inetd.conf +sed -e "s|__BASEDIR__|$INSTALL_BASE|g" samba.init.master > samba.init + +## +## copy over some scripts need for packagaing +## +mkdir -p $TMPINSTALLDIR/$INSTALL_BASE/scripts +for i in inetd.conf samba.init smb.conf.default services; do + cp -fp $i $TMPINSTALLDIR/$INSTALL_BASE/scripts +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 "PIDDIR=$PIDDIR" >> pkginfo +echo "DOCDIR=docs" >> pkginfo +echo "PRIVATE_DIR=$PRIVATE_DIR" >> pkginfo + +cp prototype.master prototype + +# Add the dynamic part to the prototype file +(add_dynamic_entries >> prototype) + +## +## copy packaging files +## +for i in prototype pkginfo copyright preremove postinstall request i.swat r.swat; do + cp $i $TMPINSTALLDIR/$INSTALL_BASE +done + +# Create the package +pkgmk -o -d /tmp -b $TMPINSTALLDIR/$INSTALL_BASE -f prototype + +if [ $? = 0 ]; then + pkgtrans /tmp samba.pkg samba +fi + +echo The samba package is in /tmp diff --git a/packaging/Solaris/makepkg.sh.tmpl b/packaging/Solaris/makepkg.sh.tmpl deleted file mode 100755 index 0d4dc02d1ce..00000000000 --- a/packaging/Solaris/makepkg.sh.tmpl +++ /dev/null @@ -1,182 +0,0 @@ -#!/bin/sh -# -# Copyright (C) Shirish A Kalele 2000 -# -# Builds a Samba package from the samba distribution. -# By default, the package will be built to install samba in /usr/local -# Change the INSTALL_BASE variable to change this: will modify the pkginfo -# and samba.server files to point to the new INSTALL_BASE -# -INSTALL_BASE=/usr/local - -add_dynamic_entries() -{ - # Add the binaries, docs and SWAT files - - echo "#\n# Binaries \n#" - cd $DISTR_BASE/source/bin - for binfile in * - do - if [ -f $binfile ]; then - case $file in - CP*.so) - echo echo f none samba/lib/charset/$binfile=source/bin/$binfile 0755 root other - ;; - *) - echo f none samba/bin/$binfile=source/bin/$binfile 0755 root other - ;; - esac - fi - done - - # Add the scripts to bin/ - echo "#\n# Scripts \n#" - cd $DISTR_BASE/source/script - for shfile in * - do - if [ -f $shfile ]; then - echo f none samba/bin/$shfile=source/script/$shfile 0755 root other - fi - done - - # add libraries to /lib for winbind - echo "#\n# Libraries \n#" - if [ -f $DISTR_BASE/source/nsswitch/libnss_winbind.so ] ; then - echo f none /usr/lib/libnss_winbind.so=source/nsswitch/libnss_winbind.so 0755 root other - echo s none /usr/lib/libnss_winbind.so.1=/usr/lib/libnss_winbind.so 0755 root other - echo s none /usr/lib/libnss_winbind.so.2=/usr/lib/libnss_winbind.so 0755 root other - echo s none /usr/lib/nss_winbind.so.1=/usr/lib/libnss_winbind.so 0755 root other - echo s none /usr/lib/nss_winbind.so.2=/usr/lib/libnss_winbind.so 0755 root other - fi - - # add pam_winbind module to /usr/lib/security - if [ -f $DISTR_BASE/source/nsswitch/pam_winbind.so ] ; then - echo f none /usr/lib/security/pam_winbind.so.1=source/nsswitch/pam_winbind.so 0755 root bin - echo s none /usr/lib/security/pam_winbind.so=/usr/lib/security/pam_winbind.so.1 0777 root root - fi - - # add the .dat codepages - echo "#\n# Codepages \n#" - for file in $DISTR_BASE/source/codepages/*.dat ; do - bfile=`basename $file` - echo f none /usr/local/samba/lib/$bfile=source/codepages/$bfile - done - - # 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 $DISTR_BASE/docs/manpages - for i in 1 2 3 4 5 6 7 8 9 - do - manpages=`ls *.$i 2>/dev/null` - if [ $? -eq 0 ] - then - echo d none /usr/share/man/man$i ? ? ? - for manpage in $manpages - do - echo f none /usr/share/man/man${i}/${manpage}=docs/manpages/$manpage 0644 root other - done - fi - done - - echo "#\n# HTML documentation \n#" - cd $DISTR_BASE - list=`find docs/htmldocs -type d | grep -v "/CVS$"` - for docdir in $list - do - if [ -d $docdir ]; then - echo d none samba/$docdir 0755 root other - fi - done - - list=`find docs/htmldocs -type f | grep -v /CVS/` - for htmldoc in $list - do - if [ -f $htmldoc ]; then - echo f none samba/$htmldoc=$htmldoc 0644 root other - fi - done - - # Create a symbolic link to the Samba book in docs/ for beginners - echo 's none samba/docs/samba_book=htmldocs/using_samba' - - echo "#\n# SWAT \n#" - cd $DISTR_BASE - list=`find swat -type d | grep -v "/CVS$"` - for i in $list - do - echo "d none samba/$i 0755 root other" - done - list=`find swat -type f | grep -v /CVS/` - for i in $list - do - echo "f none samba/$i=$i 0644 root other" - done - # add the .msg files for SWAT - echo "#\n# msg files \n#" - for file in $DISTR_BASE/source/po/*.msg ; do - bfile=`basename $file` - echo f none /usr/local/samba/lib/$bfile=source/po/$bfile - done - - echo "#\n# HTML documentation for SWAT\n#" - cd $DISTR_BASE/docs/htmldocs - for htmldoc in * - do - if [ -f $htmldoc ]; then - echo f none samba/swat/help/$htmldoc=docs/htmldocs/$htmldoc 0644 root other - fi - done - - echo "#\n# Using Samba Book files for SWAT\n#" - cd $DISTR_BASE/docs/htmldocs - -# set up a symbolic link instead of duplicating the book tree - echo 's none samba/swat/using_samba=../docs/htmldocs/using_samba' - -} - -if [ $# = 0 ] -then - # 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.." -else - DISTR_BASE=$1 -fi - -# -if [ ! -d $DISTR_BASE ]; then - echo "Source build directory $DISTR_BASE does not exist." - exit 1 -fi - -# Set up the prototype file from prototype.master -if [ -f prototype ]; then - rm prototype -fi - -# Setup version from version.h -VERSION=PVERSION -sed -e "s|__VERSION__|$VERSION|" -e "s|__ARCH__|`uname -p`|" -e "s|__BASEDIR__|$INSTALL_BASE|g" pkginfo.master >pkginfo - -sed -e "s|__BASEDIR__|$INSTALL_BASE|g" inetd.conf.master >inetd.conf -sed -e "s|__BASEDIR__|$INSTALL_BASE|g" samba.server.master >samba.server - -cp prototype.master prototype - -# Add the dynamic part to the prototype file -(add_dynamic_entries >> prototype) - -# Create the package -pkgmk -o -d /tmp -b $DISTR_BASE -f prototype -if [ $? = 0 ] -then - pkgtrans /tmp samba.pkg samba -fi -echo The samba package is in /tmp diff --git a/packaging/Solaris/pkginfo.master b/packaging/Solaris/pkginfo.master index 33e7cdb471d..2ab201dae91 100644 --- a/packaging/Solaris/pkginfo.master +++ b/packaging/Solaris/pkginfo.master @@ -1,12 +1,12 @@ PKG=samba -NAME=SMB based file/printer sharing +NAME=CIFS File and Print server ARCH=__ARCH__ VERSION=__VERSION__ CATEGORY=system -VENDOR=Samba Team +VENDOR=Gerald (Jerry) Carter, Samba Team DESC=File and printer sharing for Windows workstations HOTLINE=Please contact your local UNIX support group -EMAIL=samba@samba.org +EMAIL=jerry@samba.org CLASSES=none BASEDIR=__BASEDIR__ INTONLY=1 diff --git a/packaging/Solaris/postinstall b/packaging/Solaris/postinstall index 0b7f40a85d0..9a21ae659ce 100644 --- a/packaging/Solaris/postinstall +++ b/packaging/Solaris/postinstall @@ -9,12 +9,6 @@ You can configure Samba by creating a configuration file at ${BASEDIR}/samba/lib/smb.conf. For details on configuration, refer to the Samba man pages under ${PKG_INSTALL_ROOT}/usr/share/man and the documentation at ${BASEDIR}/samba/docs. - -BEGINNERS: -Beginners can also refer to the excellent "Using Samba" book published -by O'Reilly and Associates and officially supported by the Samba Team. -This book is supplied with this package and can be accessed at -${BASEDIR}/samba/docs/samba_book/index.html ___________________________________________________________________________ EOF diff --git a/packaging/Solaris/preremove b/packaging/Solaris/preremove index 28e8d75c298..7313b0074f9 100644 --- a/packaging/Solaris/preremove +++ b/packaging/Solaris/preremove @@ -5,8 +5,8 @@ if [ -z "$PKG_INSTALL_ROOT" ] then SMBD=`ps -e -o pid,comm | grep smbd | awk '{print $1}'` NMBD=`ps -e -o pid,comm | grep nmbd | awk '{print $1}'` - [ ! -z "$SMBD" ] && kill $SMBD - [ ! -z "$NMBD" ] && kill $NMBD + [ ! -z "$SMBD" ] && kill -TERM $SMBD + [ ! -z "$NMBD" ] && kill -TERM $NMBD sleep 2 fi diff --git a/packaging/Solaris/prototype.master b/packaging/Solaris/prototype.master dissimilarity index 82% index 0863e158c3d..7d15b7d8ae6 100644 --- a/packaging/Solaris/prototype.master +++ b/packaging/Solaris/prototype.master @@ -1,54 +1,43 @@ -# -# The static master prototype file for the Samba package. -# For files that can't be dynamically added to the prototype file at -# package build time -# -# Information files. -# -i pkginfo=./pkginfo -i copyright=./copyright -i request=./request -i preremove=./preremove -i postinstall=./postinstall -i i.swat=./i.swat -i r.swat=./r.swat -# -# Stuff that goes into the system areas of the filesystem. -# -d none /etc ? ? ? -d initscript /etc/init.d ? ? ? -f initscript /etc/init.d/samba.server=packaging/Solaris/samba.server 0744 root sys -d initscript /etc/rc3.d ? ? ? -s initscript /etc/rc3.d/S99samba.server=../init.d/samba.server -# -# Stuff to set up SWAT -# -d swat /etc/inet ? ? ? -e swat /etc/inet/services=packaging/Solaris/services ? ? ? -e swat /etc/inet/inetd.conf=packaging/Solaris/inetd.conf ? ? ? -# -# Create the samba subtree. (Usually /usr/local/samba ) -# -d none samba 0755 root other -d none samba/var 0755 root other -d none samba/bin 0755 root other -d none samba/lib 0755 root other -d none samba/docs 0755 root other -# -# Stuff that goes into lib -# -d none samba/lib/charset 0755 root other -f none samba/lib/smb.conf.example=examples/smb.conf.default 0644 root other -d none samba/lib/regeditscripts 0755 root other -f none samba/lib/regeditscripts/NT4_PlainPassword.reg=docs/registry/NT4_PlainPassword.reg 0444 root other -f none samba/lib/regeditscripts/Win95_PlainPassword.reg=docs/registry/Win95_PlainPassword.reg 0444 root other -f none samba/lib/regeditscripts/Win98_PlainPassword.reg=docs/registry/Win98_PlainPassword.reg 0444 root other -f none samba/lib/regeditscripts/WinME_PlainPassword.reg=docs/registry/WinME_PlainPassword.reg 0444 root other -f none samba/lib/regeditscripts/Win2000_PlainPassword.reg=docs/registry/Win2000_PlainPassword.reg 0444 root other -f none samba/lib/regeditscripts/WinXP_PlainPassword.reg=docs/registry/WinXP_PlainPassword.reg 0444 root other -# -# Random files -f none samba/docs/Samba-HOWTO-Collection.pdf=docs/Samba-HOWTO-Collection.pdf 0644 root other -# -# Static part of prototype file ends. -# +# +# Information files. +# +i pkginfo=./pkginfo +i copyright=./copyright +# i request=./request +i preremove=./preremove +i postinstall=./postinstall +i i.swat=./i.swat +i r.swat=./r.swat +# +# Stuff that goes into the system areas of the filesystem. +# +d none $CONFIGDIR ? ? ? +d initscript /etc/init.d ? ? ? +f initscript /etc/init.d/samba=scripts/samba.init 0744 root sys +d initscript /etc/rc3.d ? ? ? +# +# Stuff to set up SWAT +# +d swat /etc/inet ? ? ? +e swat /etc/inet/services=scripts/services ? ? ? +e swat /etc/inet/inetd.conf=scripts/inetd.conf ? ? ? +# +# Create the samba subtree. +# +d none $DOCDIR 755 root other +d none $CONFIGDIR 755 root sys +d none $PRIVATE_DIR 700 root sys +d none $SBINDIR 0755 root other +d none $BINDIR 0755 root other +d none $LIBDIR 0755 root other +d none $LIBDIR/charset 0755 root other +d none $LIBDIR/vfs 0755 root other +d none include 0755 root other +d none $SWATDIR 0755 root other +d none $LOGFILEBASE 0755 root other +d none $PIDDIR 0755 root other +# +# +f none $CONFIGDIR/smb.conf.default=scripts/smb.conf.default 0644 root other +# +# -- 2.11.4.GIT