summaryrefslogtreecommitdiff
path: root/packaging/Solaris
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/Solaris')
-rw-r--r--packaging/Solaris/README18
-rw-r--r--packaging/Solaris/copyright1
-rw-r--r--packaging/Solaris/i.swat44
-rw-r--r--packaging/Solaris/inetd.conf.master1
-rwxr-xr-xpackaging/Solaris/makepkg.sh122
-rw-r--r--packaging/Solaris/pkginfo.master12
-rw-r--r--packaging/Solaris/preremove12
-rw-r--r--packaging/Solaris/prototype.master84
-rw-r--r--packaging/Solaris/r.swat16
-rw-r--r--packaging/Solaris/request17
-rwxr-xr-xpackaging/Solaris/samba.server.master48
-rw-r--r--packaging/Solaris/services1
12 files changed, 376 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..a2521179fa
--- /dev/null
+++ b/packaging/Solaris/makepkg.sh
@@ -0,0 +1,122 @@
+#!/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
+
+ # 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 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/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..c63a9d1a42
--- /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 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