diff options
Diffstat (limited to 'packaging/Solaris')
-rw-r--r-- | packaging/Solaris/README | 18 | ||||
-rw-r--r-- | packaging/Solaris/copyright | 1 | ||||
-rw-r--r-- | packaging/Solaris/i.swat | 44 | ||||
-rw-r--r-- | packaging/Solaris/inetd.conf.master | 1 | ||||
-rwxr-xr-x | packaging/Solaris/makepkg.sh | 185 | ||||
-rw-r--r-- | packaging/Solaris/pkg-specs/pkginfo | 12 | ||||
-rw-r--r-- | packaging/Solaris/pkginfo.master | 12 | ||||
-rw-r--r-- | packaging/Solaris/postinstall | 21 | ||||
-rw-r--r-- | packaging/Solaris/preremove | 12 | ||||
-rw-r--r-- | packaging/Solaris/prototype.master | 52 | ||||
-rw-r--r-- | packaging/Solaris/r.swat | 16 | ||||
-rw-r--r-- | packaging/Solaris/request | 17 | ||||
-rwxr-xr-x | packaging/Solaris/samba.server.master | 48 | ||||
-rw-r--r-- | packaging/Solaris/services | 1 |
14 files changed, 440 insertions, 0 deletions
diff --git a/packaging/Solaris/README b/packaging/Solaris/README new file mode 100644 index 0000000000..b918cf9173 --- /dev/null +++ b/packaging/Solaris/README @@ -0,0 +1,18 @@ + +INSTRUCTIONS: Preparing Samba packages for Solaris + +To produce a package: + +* Build the binaries (by running ./configure; make; in the source directory) +* Type sh makepkg.sh + +The package will be created in the /tmp directory. + +By default, the package will be built to install samba in /usr/local +To change the default, modify the INSTALL_BASE variable in makepkg.sh +This is after you have configured samba with a --prefix option of the +alternate samba location and then created the binaries. + +Shirish Kalele <kalele@samba.org> +Date: 2000.01.12 + diff --git a/packaging/Solaris/copyright b/packaging/Solaris/copyright new file mode 100644 index 0000000000..1792668d17 --- /dev/null +++ b/packaging/Solaris/copyright @@ -0,0 +1 @@ +Copyright (C) 2001 Samba Team diff --git a/packaging/Solaris/i.swat b/packaging/Solaris/i.swat new file mode 100644 index 0000000000..047f0e1720 --- /dev/null +++ b/packaging/Solaris/i.swat @@ -0,0 +1,44 @@ +while read src dest +do + sed -e '/^swat.*swat$/d' $dest >/tmp/$$swat || exit 2 + cat $src >>/tmp/$$swat || exit 2 + + # Use cp;rm instead of mv because $dest might be a symlink + cp -f /tmp/$$swat $dest || exit 2 + rm -f /tmp/$$swat +done + +if [ "$1" = ENDOFCLASS ] +then + + # If local install, restart inetd + if [ -z "${PKG_INSTALL_ROOT}" ] + then + TARGET=`hostname` + kill -HUP `ps -e -o pid,comm | grep inetd | awk '{print $1}'` + else + TARGET="<servername>" + fi + + cat <<EOF +The Samba Web Administration Tool (SWAT) has been installed on your system. +You can connect to it from a web browser on TCP port 901 at +http://${TARGET}:901/. + +If you use NIS/NIS+, check the ${PKG_INSTALL_ROOT}/etc/nsswitch.conf file +to verify that the local services file is being used as a backend for the +services database, or you won't be able to connect to the Samba Admin Tool. + +EOF + + if [ ! -z "$PKG_INSTALL_ROOT" ] + then + CAT <<EOF +The SWAT settings will not take effect till you send a hangup (HUP) signal +to inetd on the target system. + +EOF + fi + +fi + diff --git a/packaging/Solaris/inetd.conf.master b/packaging/Solaris/inetd.conf.master new file mode 100644 index 0000000000..b11fb7c3db --- /dev/null +++ b/packaging/Solaris/inetd.conf.master @@ -0,0 +1 @@ +swat stream tcp nowait.400 root __BASEDIR__/samba/bin/swat swat diff --git a/packaging/Solaris/makepkg.sh b/packaging/Solaris/makepkg.sh new file mode 100755 index 0000000000..b57e182e4a --- /dev/null +++ b/packaging/Solaris/makepkg.sh @@ -0,0 +1,185 @@ +#!/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() +{ + # First build the codepages and append codepage entries to prototype + echo "#\n# Codepages \n#" + echo d none samba/lib/codepages 0755 root other + + CODEPAGELIST="437 737 850 852 861 932 866 949 950 936" + # Check if make_smbcodepage exists + if [ ! -f $DISTR_BASE/source/bin/make_smbcodepage ]; then + echo "Could not find $DISTR_BASE/source/bin/make_smbcodepage to generate codepages.\n\ + Please create the binaries before packaging." >&2 + exit 1 + fi + + for p in $CODEPAGELIST; do + $DISTR_BASE/source/bin/make_smbcodepage c $p $DISTR_BASE/source/codepages/codepage_def.$p $DISTR_BASE/source/codepages/codepage.$p + echo f none samba/lib/codepages/codepage.$p=source/codepages/codepage.$p 0644 root other + done + + # Create unicode maps + if [ ! -f $DISTR_BASE/source/bin/make_unicodemap ]; then + echo "Missing $DISTR_BASE/source/bin/make_unicodemap. Aborting." >&2 + exit 1 + fi + + # Pull in all the unicode map files from source/codepages/CP*.TXT + list=`find $DISTR_BASE/source/codepages -name "CP*.TXT" | sed 's|^.*CP\(.*\)\.TXT|\1|'` + for umap in $list + do + $DISTR_BASE/source/bin/make_unicodemap $umap $DISTR_BASE/source/codepages/CP$umap.TXT $DISTR_BASE/source/codepages/unicode_map.$umap + echo f none samba/lib/codepages/unicode_map.$umap=source/codepages/unicode_map.$umap 0644 root other + done + + # Add the binaries, docs and SWAT files + + echo "#\n# Binaries \n#" + cd $DISTR_BASE/source/bin + for binfile in * + do + if [ -f $binfile ]; then + echo f none samba/bin/$binfile=source/bin/$binfile 0755 root other + 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 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# Text Docs \n#" + echo d none samba/docs/textdocs 0755 root other + cd $DISTR_BASE/docs/textdocs + for textdoc in * + do + if [ -f $textdoc ]; then + echo f none samba/docs/textdocs/$textdoc=docs/textdocs/$textdoc 0644 root other + fi + done + 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 + 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=`sed 's/#define VERSION \"\(.*\)\"$/\1/' ../../source/include/version.h` +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/pkg-specs/pkginfo b/packaging/Solaris/pkg-specs/pkginfo new file mode 100644 index 0000000000..d195f177e9 --- /dev/null +++ b/packaging/Solaris/pkg-specs/pkginfo @@ -0,0 +1,12 @@ +PKG=samba +NAME=SMB based file/printer sharing +ARCH=sparc +VERSION=2.0.6 +CATEGORY=system +VENDOR=Samba Group +DESC=File and printer sharing for NT workstations +HOTLINE=Please contact your local UNIX support group +EMAIL=samba@samba.org +CLASSES=none +BASEDIR=/usr/local +INTONLY=1 diff --git a/packaging/Solaris/pkginfo.master b/packaging/Solaris/pkginfo.master new file mode 100644 index 0000000000..33e7cdb471 --- /dev/null +++ b/packaging/Solaris/pkginfo.master @@ -0,0 +1,12 @@ +PKG=samba +NAME=SMB based file/printer sharing +ARCH=__ARCH__ +VERSION=__VERSION__ +CATEGORY=system +VENDOR=Samba Team +DESC=File and printer sharing for Windows workstations +HOTLINE=Please contact your local UNIX support group +EMAIL=samba@samba.org +CLASSES=none +BASEDIR=__BASEDIR__ +INTONLY=1 diff --git a/packaging/Solaris/postinstall b/packaging/Solaris/postinstall new file mode 100644 index 0000000000..0b7f40a85d --- /dev/null +++ b/packaging/Solaris/postinstall @@ -0,0 +1,21 @@ +cat <<EOF +___________________________________________________________________________ + +INSTALLATION COMPLETE. + +All files comprising the Samba Server have been installed. + +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 new file mode 100644 index 0000000000..28e8d75c29 --- /dev/null +++ b/packaging/Solaris/preremove @@ -0,0 +1,12 @@ +#!/bin/sh + +# If this is a local deinstall, stop samba +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 + sleep 2 +fi + diff --git a/packaging/Solaris/prototype.master b/packaging/Solaris/prototype.master new file mode 100644 index 0000000000..bfcb3e0049 --- /dev/null +++ b/packaging/Solaris/prototype.master @@ -0,0 +1,52 @@ +# +# 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 checkinstall +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 +# +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/NT4_PlainPassword.reg 0444 root other +f none samba/lib/regeditscripts/Win95_PlainPassword.reg=docs/Win95_PlainPassword.reg 0444 root other +f none samba/lib/regeditscripts/Win98_PlainPassword.reg=docs/Win98_PlainPassword.reg 0444 root other +f none samba/lib/regeditscripts/Win2000_PlainPassword.reg=docs/Win2000_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. +# diff --git a/packaging/Solaris/r.swat b/packaging/Solaris/r.swat new file mode 100644 index 0000000000..11c776646d --- /dev/null +++ b/packaging/Solaris/r.swat @@ -0,0 +1,16 @@ +while read dest +do + sed -e '/^swat.*swat$/d' $dest >/tmp/$$swat || exit 2 + # Use cp;rm; instead of mv because $dest might be a symlink + cp -f /tmp/$$swat $dest || exit 2 + rm -f /tmp/$$swat +done + +if [ "$1" = ENDOFCLASS ] +then + if [ -z "$PKG_INSTALL_ROOT" ] + then + kill -HUP `ps -e -o pid,comm | grep inetd | awk '{print $1}'` + fi +fi + diff --git a/packaging/Solaris/request b/packaging/Solaris/request new file mode 100644 index 0000000000..59cdd0ab22 --- /dev/null +++ b/packaging/Solaris/request @@ -0,0 +1,17 @@ +trap 'exit 3' 15 + +VALSTR=/usr/sadm/bin/valstr + +resp=`ckyorn -d y -p "Do you wish to have Samba start whenever the system boots up? (default:y) " -Q` +$VALSTR -r "^[yY]" $resp +[ $? -eq 0 ] && CLASSES="$CLASSES initscript" + +resp=`ckyorn -d y -p "Do you wish to set up the Samba Web Admin Tool (SWAT)? (default:y) " -Q` +$VALSTR -r "^[yY]" $resp +[ $? -eq 0 ] && CLASSES="$CLASSES swat" + +cat >$1 <<! +CLASSES=$CLASSES +! +exit 0 + diff --git a/packaging/Solaris/samba.server.master b/packaging/Solaris/samba.server.master new file mode 100755 index 0000000000..6de77780b3 --- /dev/null +++ b/packaging/Solaris/samba.server.master @@ -0,0 +1,48 @@ +#!/bin/sh +#ident "@(#)samba.server 1.0 96/06/19 TK" /* SVr4.0 1.1.13.1*/ +# +# Please send info on modifications to knuutila@cs.utu.fi +# +# This file should have uid root, gid sys and chmod 744 +# +if [ ! -d /usr/bin ] +then # /usr not mounted + exit +fi + +killproc() { # kill the named process(es) + pid=`/usr/bin/ps -e | + /usr/bin/grep -w $1 | + /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` + [ "$pid" != "" ] && kill $pid +} + +# Start/stop processes required for samba server + +case "$1" in + +'start') +# +# Edit these lines to suit your installation (paths, workgroup, host) +# + BASE=__BASEDIR__/samba + $BASE/bin/smbd -D -s$BASE/lib/smb.conf + $BASE/bin/nmbd -D -s$BASE/lib/smb.conf + ;; +'stop') + killproc nmbd + killproc smbd + ;; + +'restart') + killproc nmbd + killproc smbd + BASE=/usr/local/samba + $BASE/bin/smbd -D -s$BASE/lib/smb.conf + $BASE/bin/nmbd -D -l$BASE/var/log -s$BASE/lib/smb.conf + ;; + +*) + echo "Usage: /etc/init.d/samba.server { start | stop | restart }" + ;; +esac diff --git a/packaging/Solaris/services b/packaging/Solaris/services new file mode 100644 index 0000000000..fc691200c8 --- /dev/null +++ b/packaging/Solaris/services @@ -0,0 +1 @@ +swat 901/tcp # Samba Web Admin Tool - swat |