2 #first version March 1998, Andrew Tridgell
5 SWATDIR
=`echo $2 | sed 's/\/\//\//g'`
7 BOOKDIR
="$DESTDIR/$SWATDIR/using_samba"
11 echo "Removing SWAT from $DESTDIR/$SWATDIR "
12 echo "Removing the Samba Web Administration Tool "
17 echo "Installing SWAT in $DESTDIR/$SWATDIR "
18 echo "Installing the Samba Web Administration Tool "
24 LANGS
=". `cd $SRCDIR../swat/; /bin/echo lang/??`"
25 echo "langs are `cd $SRCDIR../swat/lang/; /bin/echo ??` "
27 if test "$mode" = 'install'; then
29 SWATLANGDIR
="$DESTDIR/$SWATDIR/$ln"
30 for d
in $SWATLANGDIR $SWATLANGDIR/help $SWATLANGDIR/images \
31 $SWATLANGDIR/include
$SWATLANGDIR/js
; do
35 echo "Failed to make directory $d, does $USER have privileges? "
46 for f
in $SRCDIR..
/swat
/$ln/images
/*.png
; do
50 FNAME
="$DESTDIR/$SWATDIR/$ln/images/`basename $f`"
52 if test "$mode" = 'install'; then
54 if test ! -f "$FNAME"; then
55 echo "Cannot install $FNAME. Does $USER have privileges? "
59 elif test "$mode" = 'uninstall'; then
61 if test -f "$FNAME"; then
62 echo "Cannot remove $FNAME. Does $USER have privileges? "
66 echo "Unknown mode, $mode. Script called as $0 "
72 for f
in $SRCDIR..
/swat
/$ln/help
/*.html
; do
76 FNAME
="$DESTDIR/$SWATDIR/$ln/help/`basename $f`"
78 if test "$mode" = 'install'; then
79 if [ "x$BOOKDIR" = "x" ]; then
80 cat $f |
sed 's/@BOOKDIR@.*$//' > $f.tmp
82 cat $f |
sed 's/@BOOKDIR@//' > $f.tmp
87 if test ! -f "$FNAME"; then
88 echo "Cannot install $FNAME. Does $USER have privileges? "
92 elif test "$mode" = 'uninstall'; then
94 if test -f "$FNAME"; then
95 echo "Cannot remove $FNAME. Does $USER have privileges? "
101 # "server-side" includes
102 for f
in $SRCDIR..
/swat
/$ln/include
/*; do
103 if [ ! -f $f ] ; then
106 FNAME
="$DESTDIR/$SWATDIR/$ln/include/`basename $f`"
108 if test "$mode" = 'install'; then
110 if test ! -f "$FNAME"; then
111 echo "Cannot install $FNAME. Does $USER have privileges? "
115 elif test "$mode" = 'uninstall'; then
117 if test -f "$FNAME"; then
118 echo "Cannot remove $FNAME. Does $USER have privileges? "
125 for f
in $SRCDIR..
/swat
/$ln/js
/*.js
; do
126 if [ ! -f $f ] ; then
129 FNAME
="$DESTDIR/$SWATDIR/$ln/js/`basename $f`"
131 if test "$mode" = 'install'; then
133 if test ! -f "$FNAME"; then
134 echo "Cannot install $FNAME. Does $USER have privileges? "
138 elif test "$mode" = 'uninstall'; then
140 if test -f "$FNAME"; then
141 echo "Cannot remove $FNAME. Does $USER have privileges? "
149 # Install/ remove html documentation (if html documentation tree is here)
151 if [ -d $SRCDIR..
/docs
/htmldocs
/ ]; then
153 for dir
in htmldocs
/manpages htmldocs
/Samba3-ByExample htmldocs
/Samba3-Developers-Guide htmldocs
/Samba3-HOWTO
156 if [ ! -d $SRCDIR..
/docs
/$dir ]; then
160 INSTALLDIR
="$DESTDIR/$SWATDIR/help/`echo $dir | sed 's/htmldocs\///g'`"
161 if test ! -d "$INSTALLDIR" -a "$mode" = 'install'; then
163 if test ! -d "$INSTALLDIR"; then
164 echo "Failed to make directory $INSTALLDIR, does $USER have privileges? "
169 for f
in $SRCDIR..
/docs
/$dir/*.html
; do
170 FNAME
=$INSTALLDIR/`basename $f`
172 if test "$mode" = 'install'; then
174 if test ! -f "$FNAME"; then
175 echo "Cannot install $FNAME. Does $USER have privileges? "
179 elif test "$mode" = 'uninstall'; then
181 if test -f "$FNAME"; then
182 echo "Cannot remove $FNAME. Does $USER have privileges? "
188 if test -d "$SRCDIR../docs/$dir/images/"; then
189 if test ! -d "$INSTALLDIR/images/" -a "$mode" = 'install'; then
190 mkdir
"$INSTALLDIR/images"
191 if test ! -d "$INSTALLDIR/images/"; then
192 echo "Failed to make directory $INSTALLDIR/images, does $USER have privileges? "
196 for f
in $SRCDIR..
/docs
/$dir/images
/*.png
; do
197 FNAME
=$INSTALLDIR/images
/`basename $f`
199 if test "$mode" = 'install'; then
201 if test ! -f "$FNAME"; then
202 echo "Cannot install $FNAME. Does $USER have privileges? "
206 elif test "$mode" = 'uninstall'; then
208 if test -f "$FNAME"; then
209 echo "Cannot remove $FNAME. Does $USER have privileges? "
218 # Install/ remove Using Samba book (but only if it is there)
220 if [ "x$BOOKDIR" != "x" -a -f $SRCDIR..
/docs
/htmldocs
/using_samba
/toc.html
]; then
224 for d
in $BOOKDIR $BOOKDIR/figs
; do
225 if test ! -d "$d" -a "$mode" = 'install'; then
227 if test ! -d "$d"; then
228 echo "Failed to make directory $d, does $USER have privileges? "
236 for f
in $SRCDIR..
/docs
/htmldocs
/using_samba
/*.html
; do
237 FNAME
=$BOOKDIR/`basename $f`
239 if test "$mode" = 'install'; then
241 if test ! -f "$FNAME"; then
242 echo "Cannot install $FNAME. Does $USER have privileges? "
246 elif test "$mode" = 'uninstall'; then
248 if test -f "$FNAME"; then
249 echo "Cannot remove $FNAME. Does $USER have privileges? "
255 for f
in $SRCDIR..
/docs
/htmldocs
/using_samba
/*.gif
; do
256 FNAME
=$BOOKDIR/`basename $f`
258 if test "$mode" = 'install'; then
260 if test ! -f "$FNAME"; then
261 echo "Cannot install $FNAME. Does $USER have privileges? "
265 elif test "$mode" = 'uninstall'; then
267 if test -f "$FNAME"; then
268 echo "Cannot remove $FNAME. Does $USER have privileges? "
276 for f
in $SRCDIR..
/docs
/htmldocs
/using_samba
/figs
/*.gif
; do
277 FNAME
=$BOOKDIR/figs
/`basename $f`
279 if test "$mode" = 'install'; then
281 if test ! -f "$FNAME"; then
282 echo "Cannot install $FNAME. Does $USER have privileges? "
286 elif test "$mode" = 'uninstall'; then
288 if test -f "$FNAME"; then
289 echo "Cannot remove $FNAME. Does $USER have privileges? "
297 if test "$mode" = 'install'; then
299 ======================================================================
300 The SWAT files have been installed. Remember to read the documentation
301 for information on enabling and using SWAT
302 ======================================================================
306 ======================================================================
307 The SWAT files have been removed. You may restore these files using
308 the command "make installswat" or "make install" to install binaries,
309 man pages, modules, SWAT, and shell scripts.
310 ======================================================================