# Copyright Andrew Bartlett 2002
# Copyright (C) 2003 Jim McDonough <jmcd@us.ibm.com>
# Copyright (C) 2002-2003 Jelmer Vernooij <jelmer@samba.org>
+# Copyright (C) 2006 Lars Mueller <lars@samba.org>
###########################################################################
prefix=@prefix@
INSTALLCMD=@INSTALL@
INSTALLLIBCMD_SH=@INSTALLLIBCMD_SH@
INSTALLLIBCMD_A=@INSTALLLIBCMD_A@
+UNINSTALLLIBCMD_SH=@UNINSTALLLIBCMD_SH@
+UNINSTALLLIBCMD_A=@UNINSTALLLIBCMD_A@
VPATH=@srcdir@
srcdir=@abs_srcdir@
AUTH_MODULES = @AUTH_MODULES@
MODULES = $(VFS_MODULES) $(PDB_MODULES) $(RPC_MODULES) $(IDMAP_MODULES) $(CHARSET_MODULES) $(AUTH_MODULES)
+DAT_FILES = lowcase upcase valid
+SWAT_MSG_FILES = de en fr it ja nl pl tr
+
######################################################################
# object file lists
######################################################################
bin/t_snprintf@EXEEXT@: lib/snprintf.c
$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(DYNEXP) -DTEST_SNPRINTF lib/snprintf.c -lm
-install: installbin installman installscripts installdat installswat installmodules @INSTALL_LIBSMBCLIENT@ @INSTALL_LIBMSRPC@
+install: installservers installbin installman installscripts installdat installswat installmodules @INSTALL_LIBSMBCLIENT@ @INSTALL_LIBMSRPC@
install-everything: install installmodules
@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS) $(DESTDIR) $(BASEDIR) $(BINDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(PRIVATEDIR) $(PIDDIR) $(LOCKDIR) $(MANDIR)
installservers: all installdirs
- @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(BASEDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(SBIN_PROGS)
+ @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(SBINDIR) $(SBIN_PROGS)
installbin: all installdirs
- @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(BASEDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(SBIN_PROGS)
- @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(BASEDIR) $(BINDIR) $(LIBDIR) $(VARDIR) $(BIN_PROGS)
+ @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(BINDIR) $(BIN_PROGS)
# Some symlinks are required for the 'probing' of modules.
@$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS)
installdat: installdirs
- @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir)
+ @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR) $(LIBDIR) $(srcdir) $(DAT_FILES)
installmsg: installdirs
- @$(SHELL) $(srcdir)/script/installmsg.sh $(DESTDIR)$(LIBDIR) $(srcdir)
+ @$(SHELL) $(srcdir)/script/installmsg.sh $(DESTDIR) $(LIBDIR) $(srcdir) $(SWAT_MSG_FILES)
installswat: installdirs installmsg
- @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
+ @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR) $(SWATDIR) $(srcdir)
installclientlib: installdirs libsmbclient
@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS) $(DESTDIR) $(LIBDIR)
@echo " swatdir: $(SWATDIR)"
-uninstall: uninstallman uninstallbin uninstallscripts uninstallmodules
+uninstall: uninstallman uninstallservers uninstallbin uninstallscripts uninstalldat uninstallswat uninstallmodules @UNINSTALL_LIBSMBCLIENT@ @UNINSTALL_LIBMSRPC@
uninstallman:
@$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(srcdir) C
+uninstallservers:
+ @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR) $(SBINDIR) $(SBIN_PROGS)
+
uninstallbin:
- @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
- @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS)
+ @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR) $(BINDIR) $(BIN_PROGS)
uninstallmodules:
- @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(VFSLIBDIR) $(DESTDIR)$(VFS_MODULES)
- @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(PDBLIBDIR) $(DESTDIR)$(PDB_MODULES)
- @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(RPCLIBDIR) $(DESTDIR)$(RPC_MODULES)
- @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSETLIBDIR) $(DESTDIR)$(CHARSET_MODULES)
- @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(AUTHLIBDIR) $(DESTDIR)$(AUTH_MODULES)
+ @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR) $(BASEDIR) $(VFSLIBDIR) $(VFS_MODULES)
+ @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR) $(BASEDIR) $(PDBLIBDIR) $(PDB_MODULES)
+ @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR) $(BASEDIR) $(RPCLIBDIR) $(RPC_MODULES)
+ @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR) $(BASEDIR) $(IDMAPLIBDIR) $(IDMAP_MODULES)
+ @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR) $(BASEDIR) $(CHARSETLIBDIR) $(CHARSET_MODULES)
+ @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR) $(BASEDIR) $(AUTHLIBDIR) $(AUTH_MODULES)
uninstallscripts:
@$(SHELL) $(srcdir)/script/uninstallscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS)
+uninstalldat:
+ @$(SHELL) $(srcdir)/script/uninstalldat.sh $(DESTDIR) $(LIBDIR) $(srcdir) $(DAT_FILES)
+
+uninstallmsg:
+ @$(SHELL) $(srcdir)/script/uninstallmsg.sh $(DESTDIR) $(LIBDIR) $(srcdir) $(SWAT_MSG_FILES)
+
+uninstallswat: uninstallmsg
+ @$(SHELL) $(srcdir)/script/uninstallswat.sh $(DESTDIR) $(SWATDIR) $(srcdir)
+
+uninstallclientlib: installdirs libsmbclient
+ -$(UNINSTALLLIBCMD_SH) $(DESTDIR)$(LIBDIR)/libsmbclient.@SHLIBEXT@
+ -$(UNINSTALLLIBCMD_A) $(DESTDIR)$(LIBDIR)/libsmbclient.a
+ -rm -f $(DESTDIR)${prefix}/include/libsmbclient.h
+
+uninstalllibmsrpc: installdirs libmsrpc
+ -$(UNINSTALLLIBCMD_SH) $(DESTDIR)$(LIBDIR)/libmsrpc.@SHLIBEXT@
+ -$(UNINSTALLLIBCMD_A) $(DESTDIR)$(LIBDIR)/libmsrpc.a
+ -rm -f $(DESTDIR)${prefix}/include/libmsrpc.h
+
# Toplevel clean files
TOPFILES=dynconfig.o dynconfig.@PICSUFFIX@
AC_SUBST(SHLIBEXT)
AC_SUBST(INSTALLLIBCMD_SH)
AC_SUBST(INSTALLLIBCMD_A)
+AC_SUBST(UNINSTALLLIBCMD_SH)
+AC_SUBST(UNINSTALLLIBCMD_A)
AC_SUBST(INSTALL_LIBMSRPC)
+AC_SUBST(UNINSTALL_LIBMSRPC)
AC_SUBST(LIBMSRPC_SHARED)
AC_SUBST(LIBMSRPC)
AC_SUBST(INSTALL_LIBSMBCLIENT)
+AC_SUBST(UNINSTALL_LIBSMBCLIENT)
AC_SUBST(LIBSMBCLIENT_SHARED)
AC_SUBST(LIBSMBCLIENT)
AC_SUBST(INSTALL_LIBSMBSHAREMODES)
INSTALLLIBCMD_SH=:
INSTALLLIBCMD_A=:
+UNINSTALLLIBCMD_SH=:
+UNINSTALLLIBCMD_A=:
if test $BLDSHARED = true; then
INSTALLLIBCMD_SH="\$(INSTALLCMD)"
+ UNINSTALLLIBCMD_SH="rm -f"
fi
if test $enable_static = yes; then
INSTALLLIBCMD_A="\$(INSTALLCMD)"
+ UNINSTALLLIBCMD_A="rm -f"
fi
#################################################
# should we build libmsrpc?
INSTALL_LIBMSRPC=
+UNINSTALL_LIBMSRPC=
LIBMSRPC_SHARED=
LIBMSRPC=
AC_MSG_CHECKING(whether to build the libmsrpc shared library)
LIBMSRPC=libmsrpc
fi
INSTALL_LIBMSRPC=installlibmsrpc
+ UNINSTALL_LIBMSRPC=uninstalllibmsrpc
;;
esac ],
[
LIBMSRPC=libmsrpc
fi]
INSTALL_LIBMSRPC=installlibmsrpc
+ UNINSTALL_LIBMSRPC=uninstalllibmsrpc
)
#################################################
# should we build libsmbclient?
INSTALL_LIBSMBCLIENT=
+UNINSTALL_LIBSMBCLIENT=
LIBSMBCLIENT_SHARED=
LIBSMBCLIENT=
AC_MSG_CHECKING(whether to build the libsmbclient shared library)
LIBSMBCLIENT=libsmbclient
fi
INSTALL_LIBSMBCLIENT=installclientlib
+ UNINSTALL_LIBSMBCLIENT=uninstallclientlib
;;
esac ],
[
LIBSMBCLIENT=libsmbclient
fi]
INSTALL_LIBSMBCLIENT=installclientlib
+ UNINSTALL_LIBSMBCLIENT=uninstallclientlib
)
INSTALL_LIBSMBSHAREMODES=
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
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
#!/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
#!/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
# 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
#!/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
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
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
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
#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
--- /dev/null
+installdat.sh
\ No newline at end of file
#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
--- /dev/null
+installmsg.sh
\ No newline at end of file
--- /dev/null
+installswat.sh
\ No newline at end of file