From 3ac5f6b59ee30d12bfec0cc36cf00b9e9798a453 Mon Sep 17 00:00:00 2001 From: Shirish Kalele Date: Wed, 11 Apr 2001 02:28:38 +0000 Subject: Adding Solaris packaging files to HEAD. --- packaging/Solaris/README | 18 +++++ packaging/Solaris/copyright | 1 + packaging/Solaris/i.swat | 44 ++++++++++++ packaging/Solaris/inetd.conf.master | 1 + packaging/Solaris/makepkg.sh | 122 ++++++++++++++++++++++++++++++++++ packaging/Solaris/pkginfo.master | 12 ++++ packaging/Solaris/preremove | 12 ++++ packaging/Solaris/prototype.master | 84 +++++++++++++++++++++++ packaging/Solaris/r.swat | 16 +++++ packaging/Solaris/request | 17 +++++ packaging/Solaris/samba.server.master | 48 +++++++++++++ packaging/Solaris/services | 1 + 12 files changed, 376 insertions(+) create mode 100644 packaging/Solaris/README create mode 100644 packaging/Solaris/copyright create mode 100644 packaging/Solaris/i.swat create mode 100644 packaging/Solaris/inetd.conf.master create mode 100755 packaging/Solaris/makepkg.sh create mode 100644 packaging/Solaris/pkginfo.master create mode 100644 packaging/Solaris/preremove create mode 100644 packaging/Solaris/prototype.master create mode 100644 packaging/Solaris/r.swat create mode 100644 packaging/Solaris/request create mode 100755 packaging/Solaris/samba.server.master create mode 100644 packaging/Solaris/services (limited to 'packaging') diff --git a/packaging/Solaris/README b/packaging/Solaris/README new file mode 100644 index 00000000000..b918cf91732 --- /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 +Date: 2000.01.12 + diff --git a/packaging/Solaris/copyright b/packaging/Solaris/copyright new file mode 100644 index 00000000000..1792668d174 --- /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 00000000000..047f0e17200 --- /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="" + fi + + cat <&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 + + # 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 + echo "#\n# HTML documentation \n#" + echo d none samba/docs/htmldocs 0755 root other + cd $DISTR_BASE/docs/htmldocs + for htmldoc in * + do + if [ -f $htmldoc ]; then + echo f none samba/docs/htmldocs/$htmldoc=docs/htmldocs/$htmldoc 0644 root other + fi + done + 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` + for i in $list + do + echo "d none samba/$i 0755 root other" + done + list=`find swat -type f` + 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 + +} + +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 +rm -f prototype diff --git a/packaging/Solaris/pkginfo.master b/packaging/Solaris/pkginfo.master new file mode 100644 index 00000000000..33e7cdb471d --- /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/preremove b/packaging/Solaris/preremove new file mode 100644 index 00000000000..28e8d75c298 --- /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 00000000000..c63a9d1a42b --- /dev/null +++ b/packaging/Solaris/prototype.master @@ -0,0 +1,84 @@ +# +# 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 i.swat=./i.swat +i r.swat=./r.swat +# +# Stuff that goes into the system areas of the filesystem. +# +d initscript /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 +# +e swat /etc/services=packaging/Solaris/services ? ? ? +e swat /etc/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 +# +# Scripts +# +f none samba/bin/smbtar=source/script/smbtar 0755 root other +f none samba/bin/addtosmbpass=source/script/addtosmbpass 0755 root other +f none samba/bin/convert_smbpasswd=source/script/convert_smbpasswd 0755 root other +f none samba/bin/mksmbpasswd.sh=source/script/mksmbpasswd.sh 0755 root other +# +# man pages +# +d none /usr ? ? ? +d none /usr/share ? ? ? +d none /usr/share/man ? ? ? +d none /usr/share/man/man1 ? ? ? +d none /usr/share/man/man5 ? ? ? +d none /usr/share/man/man7 ? ? ? +d none /usr/share/man/man8 ? ? ? +f none /usr/share/man/man1/make_smbcodepage.1=docs/manpages/make_smbcodepage.1 0644 root other +f none /usr/share/man/man1/nmblookup.1=docs/manpages/nmblookup.1 0644 root other +f none /usr/share/man/man1/smbclient.1=docs/manpages/smbclient.1 0644 root other +f none /usr/share/man/man1/smbrun.1=docs/manpages/smbrun.1 0644 root other +f none /usr/share/man/man1/smbsh.1=docs/manpages/smbsh.1 0644 root other +f none /usr/share/man/man1/smbstatus.1=docs/manpages/smbstatus.1 0644 root other +f none /usr/share/man/man1/smbtar.1=docs/manpages/smbtar.1 0644 root other +f none /usr/share/man/man1/testparm.1=docs/manpages/testparm.1 0644 root other +f none /usr/share/man/man1/testprns.1=docs/manpages/testprns.1 0644 root other +f none /usr/share/man/man5/lmhosts.5=docs/manpages/lmhosts.5 0644 root other +f none /usr/share/man/man5/smb.conf.5=docs/manpages/smb.conf.5 0644 root other +f none /usr/share/man/man5/smbpasswd.5=docs/manpages/smbpasswd.5 0644 root other +f none /usr/share/man/man7/samba.7=docs/manpages/samba.7 0644 root other +f none /usr/share/man/man8/nmbd.8=docs/manpages/nmbd.8 0644 root other +f none /usr/share/man/man8/smbd.8=docs/manpages/smbd.8 0644 root other +f none /usr/share/man/man8/smbmnt.8=docs/manpages/smbmnt.8 0644 root other +f none /usr/share/man/man8/smbmount.8=docs/manpages/smbmount.8 0644 root other +f none /usr/share/man/man8/smbpasswd.8=docs/manpages/smbpasswd.8 0644 root other +f none /usr/share/man/man8/smbumount.8=docs/manpages/smbumount.8 0644 root other +f none /usr/share/man/man8/swat.8=docs/manpages/swat.8 0644 root other +f none /usr/share/man/man8/smbspool.8=docs/manpages/smbspool.8 0644 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 +# +# Static part of prototype file ends. +# diff --git a/packaging/Solaris/r.swat b/packaging/Solaris/r.swat new file mode 100644 index 00000000000..11c776646da --- /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 00000000000..59cdd0ab22a --- /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 <