diff options
Diffstat (limited to 'source3/script')
-rwxr-xr-x | source3/script/installbin.sh | 13 | ||||
-rwxr-xr-x | source3/script/installdat.sh | 62 | ||||
-rwxr-xr-x | source3/script/installmodules.sh | 2 | ||||
-rw-r--r-- | source3/script/installmsg.sh | 64 | ||||
-rwxr-xr-x | source3/script/installswat.sh | 271 | ||||
-rwxr-xr-x | source3/script/uninstallbin.sh | 28 | ||||
l--------- | source3/script/uninstalldat.sh | 1 | ||||
-rwxr-xr-x | source3/script/uninstallmodules.sh | 22 | ||||
l--------- | source3/script/uninstallmsg.sh | 1 | ||||
l--------- | source3/script/uninstallswat.sh | 1 |
10 files changed, 344 insertions, 121 deletions
diff --git a/source3/script/installbin.sh b/source3/script/installbin.sh index 2f15ce595a..8859c95341 100755 --- a/source3/script/installbin.sh +++ b/source3/script/installbin.sh @@ -2,20 +2,14 @@ INSTALLPERMS=$1 DESTDIR=$2 -BASEDIR=`echo $3 | sed 's/\/\//\//g'` -BINDIR=`echo $4 | sed 's/\/\//\//g'` -LIBDIR=`echo $5 | sed 's/\/\//\//g'` -VARDIR=`echo $6 | sed 's/\/\//\//g'` -shift -shift -shift +BINDIR=`echo $3 | sed 's/\/\//\//g'` shift shift shift for p in $*; do p2=`basename $p` - echo Installing $p as $DESTDIR/$BINDIR/$p2 + echo "Installing $p as $DESTDIR/$BINDIR/$p2 " if [ -f $DESTDIR/$BINDIR/$p2 ]; then rm -f $DESTDIR/$BINDIR/$p2.old mv $DESTDIR/$BINDIR/$p2 $DESTDIR/$BINDIR/$p2.old @@ -27,7 +21,8 @@ for p in $*; do if [ $p2 = smbmount ]; then if [ ! -d $DESTDIR/sbin ]; then mkdir $DESTDIR/sbin - fi + fi + echo "Creating sym link $DESTDIR/sbin/mount.smbfs to $BINDIR/$p2 " ln -sf $BINDIR/$p2 $DESTDIR/sbin/mount.smbfs fi done diff --git a/source3/script/installdat.sh b/source3/script/installdat.sh index 4a5b1de5dc..5d7958e273 100755 --- a/source3/script/installdat.sh +++ b/source3/script/installdat.sh @@ -1,23 +1,65 @@ #!/bin/sh #fist version March 2002, Herb Lewis -DATDIR=`echo $1 | sed 's/\/\//\//g'` -SRCDIR=$2/ +DESTDIR=$1 +DATDIR=`echo $2 | sed 's/\/\//\//g'` +SRCDIR=$3/ +shift +shift +shift -echo Installing dat files in $DATDIR +case $0 in + *uninstall*) + if test ! -d "$DESTDIR/$DATDIR"; then + echo "Directory $DESTDIR/$DATDIR does not exist! " + echo "Do a "make installmsg" or "make install" first. " + exit 1 + fi + mode='uninstall' + ;; + *) mode='install' ;; +esac -for f in $SRCDIR/codepages/*.dat; do - FNAME=$DATDIR/`basename $f` - echo $FNAME - cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges? - chmod 0644 $FNAME +for f in $@; do + FNAME="$DESTDIR/$DATDIR/$f.dat" + if test "$mode" = 'install'; then + echo "Installing $f.dat as $FNAME " + cp "$SRCDIR/codepages/$f.dat" "$FNAME" + if test ! -e "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges? " + exit 1 + fi + chmod 0644 $FNAME + elif test "$mode" = 'uninstall'; then + echo "Removing $FNAME " + rm -f "$FNAME" + if test -e "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges? " + exit 1 + fi + else + echo "Unknown mode, $mode. Script called as $0 " + exit 1 + fi done -cat << EOF +if test "$mode" = 'install'; then + cat << EOF ====================================================================== -The dat files have been installed. +The dat files have been installed. You may uninstall the dat files +using the command "make uninstalldat" or "make uninstall" to uninstall +binaries, man pages, dat files, and shell scripts. ====================================================================== EOF +else + cat << EOF +====================================================================== +The dat files have been removed. You may restore these files using +the command "make installdat" or "make install" to install binaries, +man pages, modules, dat files, and shell scripts. +====================================================================== +EOF +fi exit 0 diff --git a/source3/script/installmodules.sh b/source3/script/installmodules.sh index 4ea8fde327..bfc1c359b5 100755 --- a/source3/script/installmodules.sh +++ b/source3/script/installmodules.sh @@ -1,7 +1,7 @@ #!/bin/sh INSTALLPERMS=$1 -DESTDIR=`echo $2 | sed 's/\/\//\//g'` +DESTDIR=$2 BASEDIR=`echo $3 | sed 's/\/\//\//g'` LIBDIR=`echo $4 | sed 's/\/\//\//g'` shift diff --git a/source3/script/installmsg.sh b/source3/script/installmsg.sh index 5a41fe1ca8..3bfa3ee772 100644 --- a/source3/script/installmsg.sh +++ b/source3/script/installmsg.sh @@ -2,22 +2,64 @@ # first version (Sept 2003) written by Shiro Yamada <shiro@miraclelinux.com> # based on the first verion (March 2002) of installdat.sh written by Herb Lewis -MSGDIR=`echo $1 | sed 's/\/\//\//g'` -SRCDIR=$2/ +DESTDIR=$1 +MSGDIR=`echo $2 | sed 's/\/\//\//g'` +SRCDIR=$3/ +shift +shift +shift -echo Installing msg files in $MSGDIR +case $0 in + *uninstall*) + if test ! -d "$DESTDIR/$MSGDIR"; then + echo "Directory $DESTDIR/$MSGDIR does not exist! " + echo "Do a "make installmsg" or "make install" first. " + exit 1 + fi + mode='uninstall' + ;; + *) mode='install' ;; +esac -for f in $SRCDIR/po/*.msg; do - FNAME=$MSGDIR/`basename $f` - echo $FNAME - cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges? - chmod 0644 $FNAME +for f in $@; do + FNAME="$DESTDIR/$MSGDIR/$f.msg" + if test "$mode" = 'install'; then + echo "Installing $f.msg as $FNAME " + cp "$SRCDIR/po/$f.msg" "$FNAME" + if test ! -e "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges? " + exit 1 + fi + chmod 0644 $FNAME + elif test "$mode" = 'uninstall'; then + echo "Removing $FNAME " + rm -f "$FNAME" + if test -e "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges? " + exit 1 + fi + else + echo "Unknown mode, $mode. Script called as $0 " + exit 1 + fi done -cat << EOF -====================================================================== -The msg files have been installed. +if test "$mode" = 'install'; then + cat << EOF +============================================================================== +The SWAT msg files have been installed. You may uninstall the msg files using +the command "make uninstallmsg" or "make uninstall" to uninstall binaries, man +pages, msg files, and shell scripts. +============================================================================== +EOF +else + cat << EOF +============================================================================= +The SWAT msg files have been removed. You may restore these files using the +command "make installmsg" or "make install" to install binaries, man pages, +modules, msg files, and shell scripts. ====================================================================== EOF +fi exit 0 diff --git a/source3/script/installswat.sh b/source3/script/installswat.sh index c5c285894e..095ccb897b 100755 --- a/source3/script/installswat.sh +++ b/source3/script/installswat.sh @@ -1,89 +1,152 @@ #!/bin/sh #first version March 1998, Andrew Tridgell -SWATDIR=`echo $1 | sed 's/\/\//\//g'` -SRCDIR=$2/ -BOOKDIR=$SWATDIR/using_samba +DESTDIR=$1 +SWATDIR=`echo $2 | sed 's/\/\//\//g'` +SRCDIR=$3/ +BOOKDIR="$DESTDIR/$SWATDIR/using_samba" -echo Installing SWAT in $SWATDIR -echo Installing the Samba Web Administration Tool +case $0 in + *uninstall*) + echo "Removing SWAT from $DESTDIR/$SWATDIR " + echo "Removing the Samba Web Administration Tool " + echo -n "Removed " + mode='uninstall' + ;; + *) + echo "Installing SWAT in $DESTDIR/$SWATDIR " + echo "Installing the Samba Web Administration Tool " + echo -n "Installing " + mode='install' + ;; +esac LANGS=". `cd $SRCDIR../swat/; /bin/echo lang/??`" -echo Installing langs are `cd $SRCDIR../swat/lang/; /bin/echo ??` +echo "langs are `cd $SRCDIR../swat/lang/; /bin/echo ??` " -for ln in $LANGS; do - SWATLANGDIR=$SWATDIR/$ln - for d in $SWATLANGDIR $SWATLANGDIR/help $SWATLANGDIR/images \ - $SWATLANGDIR/include $SWATLANGDIR/js; do +if test "$mode" = 'install'; then + for ln in $LANGS; do + SWATLANGDIR="$DESTDIR/$SWATDIR/$ln" + for d in $SWATLANGDIR $SWATLANGDIR/help $SWATLANGDIR/images \ + $SWATLANGDIR/include $SWATLANGDIR/js; do + if [ ! -d $d ]; then + mkdir -p $d if [ ! -d $d ]; then - mkdir -p $d - if [ ! -d $d ]; then - echo Failed to make directory $d, does $USER have privileges? - exit 1 - fi + echo "Failed to make directory $d, does $USER have privileges? " + exit 1 fi + fi + done done -done +fi -# Install images for ln in $LANGS; do + # images for f in $SRCDIR../swat/$ln/images/*.png; do - if [ ! -f $f ] ; then - continue + if [ ! -f $f ] ; then + continue + fi + FNAME="$DESTDIR/$SWATDIR/$ln/images/`basename $f`" + echo $FNAME + if test "$mode" = 'install'; then + cp "$f" "$FNAME" + if test ! -e "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges? " + exit 1 fi - FNAME=$SWATDIR/$ln/images/`basename $f` - echo $FNAME - cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges? - chmod 0644 $FNAME + chmod 0644 "$FNAME" + elif test "$mode" = 'uninstall'; then + rm -f "$FNAME" + if test -e "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges? " + exit 1 + fi + else + echo "Unknown mode, $mode. Script called as $0 " + exit 1 + fi done - # Install html help - + # html help for f in $SRCDIR../swat/$ln/help/*.html; do - if [ ! -f $f ] ; then - continue - fi - FNAME=$SWATDIR/$ln/help/`basename $f` - echo $FNAME + if [ ! -f $f ] ; then + continue + fi + FNAME="$DESTDIR/$SWATDIR/$ln/help/`basename $f`" + echo $FNAME + if test "$mode" = 'install'; then if [ "x$BOOKDIR" = "x" ]; then cat $f | sed 's/@BOOKDIR@.*$//' > $f.tmp else cat $f | sed 's/@BOOKDIR@//' > $f.tmp fi f=$f.tmp - cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges? - rm -f $f - chmod 0644 $FNAME + cp "$f" "$FNAME" + rm -f "$f" + if test ! -e "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges? " + exit 1 + fi + chmod 0644 "$FNAME" + elif test "$mode" = 'uninstall'; then + rm -f "$FNAME" + if test -e "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges? " + exit 1 + fi + fi done - # Install "server-side" includes - + # "server-side" includes for f in $SRCDIR../swat/$ln/include/*; do if [ ! -f $f ] ; then continue fi - FNAME=$SWATDIR/$ln/include/`basename $f` + FNAME="$DESTDIR/$SWATDIR/$ln/include/`basename $f`" echo $FNAME - cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges? - chmod 0644 $FNAME + if test "$mode" = 'install'; then + cp "$f" "$FNAME" + if test ! -e "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges? " + exit 1 + fi + chmod 0644 $FNAME + elif test "$mode" = 'uninstall'; then + rm -f "$FNAME" + if test -e "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges? " + exit 1 + fi + fi done - # Install javascripts - + # javascripts for f in $SRCDIR../swat/$ln/js/*.js; do if [ ! -f $f ] ; then continue fi - FNAME=$SWATDIR/$ln/js/`basename $f` + FNAME="$DESTDIR/$SWATDIR/$ln/js/`basename $f`" echo $FNAME - cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges? - chmod 0644 $FNAME + if test "$mode" = 'install'; then + cp "$f" "$FNAME" + if test ! -e "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges? " + exit 1 + fi + chmod 0644 $FNAME + elif test "$mode" = 'uninstall'; then + rm -f "$FNAME" + if test -e "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges? " + exit 1 + fi + fi done done -# Install html documentation (if html documentation tree is here) +# Install/ remove html documentation (if html documentation tree is here) if [ -d $SRCDIR../docs/htmldocs/ ]; then @@ -94,47 +157,75 @@ if [ -d $SRCDIR../docs/htmldocs/ ]; then continue fi - INSTALLDIR=$SWATDIR/help/`echo $dir | sed 's/htmldocs\///g'` - if [ ! -d $INSTALLDIR ]; then - mkdir $INSTALLDIR + INSTALLDIR="$DESTDIR/$SWATDIR/help/`echo $dir | sed 's/htmldocs\///g'`" + if test ! -d "$INSTALLDIR" -a "$mode" = 'install'; then + mkdir "$INSTALLDIR" + if test ! -d "$INSTALLDIR"; then + echo "Failed to make directory $INSTALLDIR, does $USER have privileges? " + exit 1 + fi fi for f in $SRCDIR../docs/$dir/*.html; do FNAME=$INSTALLDIR/`basename $f` echo $FNAME - cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges? - chmod 0644 $FNAME + if test "$mode" = 'install'; then + cp "$f" "$FNAME" + if test ! -e "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges? " + exit 1 + fi + chmod 0644 $FNAME + elif test "$mode" = 'uninstall'; then + rm -f "$FNAME" + if test -e "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges? " + exit 1 + fi + fi done - if [ -d $SRCDIR../docs/$dir/images/ ]; then - if [ ! -d $INSTALLDIR/images/ ]; then - mkdir $INSTALLDIR/images - if [ ! -d $INSTALLDIR/images/ ]; then - echo Failed to make directory $SWATDIR/help/images, does $USER have privileges? + if test -d "$SRCDIR../docs/$dir/images/"; then + if test ! -d "$INSTALLDIR/images/" -a "$mode" = 'install'; then + mkdir "$INSTALLDIR/images" + if test ! -d "$INSTALLDIR/images/"; then + echo "Failed to make directory $INSTALLDIR/images, does $USER have privileges? " exit 1 fi fi for f in $SRCDIR../docs/$dir/images/*.png; do FNAME=$INSTALLDIR/images/`basename $f` echo $FNAME - cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges? - chmod 0644 $FNAME + if test "$mode" = 'install'; then + cp "$f" "$FNAME" + if test ! -e "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges? " + exit 1 + fi + chmod 0644 $FNAME + elif test "$mode" = 'uninstall'; then + rm -f "$FNAME" + if test -e "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges? " + exit 1 + fi + fi done fi done fi -# Install Using Samba book (but only if it is there) +# Install/ remove Using Samba book (but only if it is there) if [ "x$BOOKDIR" != "x" -a -f $SRCDIR../docs/htmldocs/using_samba/toc.html ]; then # Create directories for d in $BOOKDIR $BOOKDIR/figs ; do - if [ ! -d $d ]; then + if test ! -d "$d" -a "$mode" = 'install'; then mkdir $d - if [ ! -d $d ]; then - echo Failed to make directory $d, does $USER have privileges? + if test ! -d "$d"; then + echo "Failed to make directory $d, does $USER have privileges? " exit 1 fi fi @@ -145,15 +236,39 @@ if [ "x$BOOKDIR" != "x" -a -f $SRCDIR../docs/htmldocs/using_samba/toc.html ]; th for f in $SRCDIR../docs/htmldocs/using_samba/*.html; do FNAME=$BOOKDIR/`basename $f` echo $FNAME - cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges? - chmod 0644 $FNAME + if test "$mode" = 'install'; then + cp "$f" "$FNAME" + if test ! -e "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges? " + exit 1 + fi + chmod 0644 $FNAME + elif test "$mode" = 'uninstall'; then + rm -f "$FNAME" + if test -e "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges? " + exit 1 + fi + fi done for f in $SRCDIR../docs/htmldocs/using_samba/*.gif; do FNAME=$BOOKDIR/`basename $f` echo $FNAME - cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges? - chmod 0644 $FNAME + if test "$mode" = 'install'; then + cp "$f" "$FNAME" + if test ! -e "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges? " + exit 1 + fi + chmod 0644 $FNAME + elif test "$mode" = 'uninstall'; then + rm -f "$FNAME" + if test -e "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges? " + exit 1 + fi + fi done # Figures @@ -161,18 +276,40 @@ if [ "x$BOOKDIR" != "x" -a -f $SRCDIR../docs/htmldocs/using_samba/toc.html ]; th for f in $SRCDIR../docs/htmldocs/using_samba/figs/*.gif; do FNAME=$BOOKDIR/figs/`basename $f` echo $FNAME - cp $f $FNAME || echo Cannot install $FNAME. Does $USER have privileges? - chmod 0644 $FNAME + if test "$mode" = 'install'; then + cp "$f" "$FNAME" + if test ! -e "$FNAME"; then + echo "Cannot install $FNAME. Does $USER have privileges? " + exit 1 + fi + chmod 0644 $FNAME + elif test "$mode" = 'uninstall'; then + rm -f "$FNAME" + if test -e "$FNAME"; then + echo "Cannot remove $FNAME. Does $USER have privileges? " + exit 1 + fi + fi done fi -cat << EOF +if test "$mode" = 'install'; then + cat << EOF ====================================================================== The SWAT files have been installed. Remember to read the documentation for information on enabling and using SWAT ====================================================================== EOF +else + cat << EOF +====================================================================== +The SWAT files have been removed. You may restore these files using +the command "make installswat" or "make install" to install binaries, +man pages, modules, SWAT, and shell scripts. +====================================================================== +EOF +fi exit 0 diff --git a/source3/script/uninstallbin.sh b/source3/script/uninstallbin.sh index 5de936fccf..597c5d95a5 100755 --- a/source3/script/uninstallbin.sh +++ b/source3/script/uninstallbin.sh @@ -2,31 +2,33 @@ #4 July 96 Dan.Shearer@UniSA.edu.au INSTALLPERMS=$1 -BASEDIR=`echo $2 | sed 's/\/\//\//g'` +DESTDIR=$2 BINDIR=`echo $3 | sed 's/\/\//\//g'` -LIBDIR=`echo $4 | sed 's/\/\//\//g'` -VARDIR=`echo $5 | sed 's/\/\//\//g'` -shift -shift shift shift shift -if [ ! -d $BINDIR ]; then - echo Directory $BINDIR does not exist! - echo Do a "make installbin" or "make install" first. +if [ ! -d $DESTDIR/$BINDIR ]; then + echo "Directory $DESTDIR/$BINDIR does not exist! " + echo "Do a "make installbin" or "make install" first. " exit 1 fi for p in $*; do p2=`basename $p` - if [ -f $BINDIR/$p2 ]; then - echo Removing $BINDIR/$p2 - rm -f $BINDIR/$p2 - if [ -f $BINDIR/$p2 ]; then - echo Cannot remove $BINDIR/$p2 ... does $USER have privileges? + if [ -f $DESTDIR/$BINDIR/$p2 ]; then + echo "Removing $DESTDIR/$BINDIR/$p2 " + rm -f $DESTDIR/$BINDIR/$p2 + if [ -f $DESTDIR/$BINDIR/$p2 ]; then + echo "Cannot remove $DESTDIR/$BINDIR/$p2 ... does $USER have privileges? " fi fi + + # this is a special case, mount needs this in a specific location + if test "$p2" = smbmount -a -e "$DESTDIR/sbin/mount.smbfs"; then + echo "Removing $DESTDIR/sbin/mount.smbfs " + rm -f "$DESTDIR/sbin/mount.smbfs" + fi done diff --git a/source3/script/uninstalldat.sh b/source3/script/uninstalldat.sh new file mode 120000 index 0000000000..656142745c --- /dev/null +++ b/source3/script/uninstalldat.sh @@ -0,0 +1 @@ +installdat.sh
\ No newline at end of file diff --git a/source3/script/uninstallmodules.sh b/source3/script/uninstallmodules.sh index ac83af3dc9..194435bda3 100755 --- a/source3/script/uninstallmodules.sh +++ b/source3/script/uninstallmodules.sh @@ -2,25 +2,27 @@ #4 July 96 Dan.Shearer@UniSA.edu.au INSTALLPERMS=$1 -BASEDIR=`echo $2 | sed 's/\/\//\//g'` -LIBDIR=`echo $3 | sed 's/\/\//\//g'` +DESTDIR=$2 +BASEDIR=`echo $3 | sed 's/\/\//\//g'` +LIBDIR=`echo $4 | sed 's/\/\//\//g'` +shift shift shift shift -if [ ! -d $LIBDIR ]; then - echo Directory $LIBDIR does not exist! - echo Do a "make installmodules" or "make install" first. +if [ ! -d $DESTDIR/$LIBDIR ]; then + echo "Directory $DESTDIR/$LIBDIR does not exist! " + echo "Do a "make installmodules" or "make install" first. " exit 1 fi for p in $*; do p2=`basename $p` - if [ -f $LIBDIR/$p2 ]; then - echo Removing $LIBDIR/$p2 - rm -f $LIBDIR/$p2 - if [ -f $LIBDIR/$p2 ]; then - echo Cannot remove $LIBDIR/$p2 ... does $USER have privileges? + if [ -f $DESTDIR/$LIBDIR/$p2 ]; then + echo "Removing $DESTDIR/$LIBDIR/$p2 " + rm -f $DESTDIR/$LIBDIR/$p2 + if [ -f $DESTDIR/$LIBDIR/$p2 ]; then + echo "Cannot remove $DESTDIR/$LIBDIR/$p2 ... does $USER have privileges? " fi fi done diff --git a/source3/script/uninstallmsg.sh b/source3/script/uninstallmsg.sh new file mode 120000 index 0000000000..c108fa4416 --- /dev/null +++ b/source3/script/uninstallmsg.sh @@ -0,0 +1 @@ +installmsg.sh
\ No newline at end of file diff --git a/source3/script/uninstallswat.sh b/source3/script/uninstallswat.sh new file mode 120000 index 0000000000..0dffe646f0 --- /dev/null +++ b/source3/script/uninstallswat.sh @@ -0,0 +1 @@ +installswat.sh
\ No newline at end of file |