Changed install scripts so they don't have hardcoded values
authorSamba Release Account <samba-bugs@samba.org>
Fri, 5 Jul 1996 03:51:27 +0000 (03:51 +0000)
committerSamba Release Account <samba-bugs@samba.org>
Fri, 5 Jul 1996 03:51:27 +0000 (03:51 +0000)
Dan
(This used to be commit 2eccc5eea289fa4b6af120d0bc92d568ca925482)

source3/script/installbin.sh
source3/script/installman.sh
source3/script/installscripts.sh

index 633e6cb5bb2d68d0622cf1248f5040508512d04a..b976a3e5ea8440d57e3dc03a69341d8a37fc5676 100755 (executable)
@@ -34,7 +34,9 @@ done
 cat << EOF
 ======================================================================
 The binaries are installed. You may restore the old binaries (if there
 cat << EOF
 ======================================================================
 The binaries are installed. You may restore the old binaries (if there
-were any) using the command "make revert"
+were any) using the command "make revert". You may uninstall the binaries
+using the command "make uninstallbin" or "make uninstall" to uninstall
+binaries, man pages and shell scripts.
 ======================================================================
 EOF
 
 ======================================================================
 EOF
 
index a79d157c5f570964a1cd04ba706b80ba86f02330..3c8fc7186542ec23824bff6338a08f1083f9333f 100755 (executable)
@@ -1,4 +1,6 @@
 #!/bin/sh
 #!/bin/sh
+#5 July 96 Dan.Shearer@unisa.edu.au  removed hardcoded values
+
 MANDIR=$1
 SRCDIR=$2
 
 MANDIR=$1
 SRCDIR=$2
 
@@ -8,28 +10,29 @@ for d in $MANDIR $MANDIR/man1 $MANDIR/man5 $MANDIR/man7 $MANDIR/man8; do
 if [ ! -d $d ]; then
 mkdir $d
 if [ ! -d $d ]; then
 if [ ! -d $d ]; then
 mkdir $d
 if [ ! -d $d ]; then
-  echo Failed to make directory $d
+  echo Failed to make directory $d, does $USER have privileges?
   exit 1
 fi
 fi
 done
 
   exit 1
 fi
 fi
 done
 
-cp $SRCDIR../docs/*.1 $MANDIR/man1
-cp $SRCDIR../docs/*.5 $MANDIR/man5
-cp $SRCDIR../docs/*.8 $MANDIR/man8
-cp $SRCDIR../docs/*.7 $MANDIR/man7
-echo Setting permissions on man pages
-chmod 0644 $MANDIR/man1/smbstatus.1
-chmod 0644 $MANDIR/man1/smbclient.1
-chmod 0644 $MANDIR/man1/smbrun.1
-chmod 0644 $MANDIR/man1/testparm.1
-chmod 0644 $MANDIR/man1/testprns.1
-chmod 0644 $MANDIR/man1/smbtar.1
-chmod 0644 $MANDIR/man5/smb.conf.5
-chmod 0644 $MANDIR/man7/samba.7
-chmod 0644 $MANDIR/man8/smbd.8
-chmod 0644 $MANDIR/man8/nmbd.8
+for sect in 1 5 7 8 ; do
+  for m in $MANDIR/man$sect ; do
+    for s in $SRCDIR../docs/*$sect; do
+      FNAME=$m/`basename $s`
+      cp $s $m || echo Cannot create $FNAME... does $USER have privileges?
+      chmod 0644 $FNAME
+    done
+  done
+done
+
+cat << EOF
+======================================================================
+The man pages have been installed. You may uninstall them using the command
+the command "make uninstallman" or make "uninstall" to uninstall binaries,
+man pages and shell scripts.
+======================================================================
+EOF
 
 
-echo Man pages installed
 exit 0
 
 exit 0
 
index c27d41c36b5a84d4c4372096b767717f7aa66a9e..ab9035ff812fa61a2542e90084398b5c767e09c9 100755 (executable)
@@ -1,26 +1,43 @@
 #!/bin/sh
 # this script courtesy of James_K._Foote.PARC@xerox.com
 #!/bin/sh
 # this script courtesy of James_K._Foote.PARC@xerox.com
+# 5 July 96 Dan.Shearer@UniSA.Edu.Au  Don't hardcode script names, get from Make
+
 INSTALLPERMS=$1
 BINDIR=$2
 INSTALLPERMS=$1
 BINDIR=$2
-SRCDIR=$3
+
+shift
+shift
 
 echo Installing scripts in $BINDIR
 
 
 echo Installing scripts in $BINDIR
 
-for d in $BINDIR; do
+for d in [ $BINDIR ]; do
  if [ ! -d $d ]; then
   mkdir $d
   if [ ! -d $d ]; then
     echo Failed to make directory $d
  if [ ! -d $d ]; then
   mkdir $d
   if [ ! -d $d ]; then
     echo Failed to make directory $d
+    echo Have you run installbin first?
     exit 1
   fi
  fi
 done
 
     exit 1
   fi
  fi
 done
 
-cp ${SRCDIR}smbtar $BINDIR
-cp ${SRCDIR}addtosmbpass $BINDIR
-echo Setting permissions on scripts
-chmod $INSTALLPERMS $BINDIR/smbtar
-chmod $INSTALLPERMS $BINDIR/addtosmbpass
+for p in $*; do
+  echo Installing $BINDIR/$p
+  cp $p $BINDIR/$p
+  if [ ! -f $BINDIR/$p ]; then
+    echo Cannot copy $p... does $USER have privileges?
+  fi
+  echo Setting permissions on $BINDIR/$p
+  chmod $INSTALLPERMS $BINDIR/$p
+done
+
+cat << EOF
+======================================================================
+The scripts have been installed. You may uninstall them using
+the command "make uninstallscripts" or "make install" to install binaries,
+man pages and shell scripts. You may recover the previous version (if any
+by "make revert".
+======================================================================
+EOF
 
 
-echo Scripts installed
 exit 0
 exit 0