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 "
13
printf "%s" "Removed "
17
echo "Installing SWAT in $DESTDIR/$SWATDIR "
18
echo "Installing the Samba Web Administration Tool "
19
printf "%s" "Installing "
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/*.gif; 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@.*$//' > $FNAME.tmp
82
cat $f | sed 's/@BOOKDIR@//' > $FNAME.tmp
84
if test ! -f "$FNAME.tmp"; then
85
echo "Cannot install $FNAME. Does $USER have privileges? "
91
if test ! -f "$FNAME"; then
92
echo "Cannot install $FNAME. Does $USER have privileges? "
96
elif test "$mode" = 'uninstall'; then
98
if test -f "$FNAME"; then
99
echo "Cannot remove $FNAME. Does $USER have privileges? "
105
# "server-side" includes
106
for f in $SRCDIR../swat/$ln/include/*; do
107
if [ ! -f $f ] ; then
110
FNAME="$DESTDIR/$SWATDIR/$ln/include/`basename $f`"
112
if test "$mode" = 'install'; then
114
if test ! -f "$FNAME"; then
115
echo "Cannot install $FNAME. Does $USER have privileges? "
119
elif test "$mode" = 'uninstall'; then
121
if test -f "$FNAME"; then
122
echo "Cannot remove $FNAME. Does $USER have privileges? "
130
# Install/ remove html documentation (if html documentation tree is here)
132
if [ -d $SRCDIR../docs/htmldocs/ ]; then
134
for dir in htmldocs/manpages htmldocs/Samba3-ByExample htmldocs/Samba3-Developers-Guide htmldocs/Samba3-HOWTO
137
if [ ! -d $SRCDIR../docs/$dir ]; then
141
INSTALLDIR="$DESTDIR/$SWATDIR/help/`echo $dir | sed 's/htmldocs\///g'`"
142
if test ! -d "$INSTALLDIR" -a "$mode" = 'install'; then
144
if test ! -d "$INSTALLDIR"; then
145
echo "Failed to make directory $INSTALLDIR, does $USER have privileges? "
150
for f in $SRCDIR../docs/$dir/*.html; do
151
FNAME=$INSTALLDIR/`basename $f`
153
if test "$mode" = 'install'; then
155
if test ! -f "$FNAME"; then
156
echo "Cannot install $FNAME. Does $USER have privileges? "
160
elif test "$mode" = 'uninstall'; then
162
if test -f "$FNAME"; then
163
echo "Cannot remove $FNAME. Does $USER have privileges? "
169
if test -d "$SRCDIR../docs/$dir/images/"; then
170
if test ! -d "$INSTALLDIR/images/" -a "$mode" = 'install'; then
171
mkdir "$INSTALLDIR/images"
172
if test ! -d "$INSTALLDIR/images/"; then
173
echo "Failed to make directory $INSTALLDIR/images, does $USER have privileges? "
177
for f in $SRCDIR../docs/$dir/images/*.png; do
178
FNAME=$INSTALLDIR/images/`basename $f`
180
if test "$mode" = 'install'; then
182
if test ! -f "$FNAME"; then
183
echo "Cannot install $FNAME. Does $USER have privileges? "
187
elif test "$mode" = 'uninstall'; then
189
if test -f "$FNAME"; then
190
echo "Cannot remove $FNAME. Does $USER have privileges? "
199
# Install/ remove Using Samba book (but only if it is there)
201
if [ "x$BOOKDIR" != "x" -a -f $SRCDIR../docs/htmldocs/using_samba/toc.html ]; then
205
for d in $BOOKDIR $BOOKDIR/figs ; do
206
if test ! -d "$d" -a "$mode" = 'install'; then
208
if test ! -d "$d"; then
209
echo "Failed to make directory $d, does $USER have privileges? "
217
for f in $SRCDIR../docs/htmldocs/using_samba/*.html; do
218
FNAME=$BOOKDIR/`basename $f`
220
if test "$mode" = 'install'; then
222
if test ! -f "$FNAME"; then
223
echo "Cannot install $FNAME. Does $USER have privileges? "
227
elif test "$mode" = 'uninstall'; then
229
if test -f "$FNAME"; then
230
echo "Cannot remove $FNAME. Does $USER have privileges? "
236
for f in $SRCDIR../docs/htmldocs/using_samba/*.gif; 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? "
257
for f in $SRCDIR../docs/htmldocs/using_samba/figs/*.gif; do
258
FNAME=$BOOKDIR/figs/`basename $f`
260
if test "$mode" = 'install'; then
262
if test ! -f "$FNAME"; then
263
echo "Cannot install $FNAME. Does $USER have privileges? "
267
elif test "$mode" = 'uninstall'; then
269
if test -f "$FNAME"; then
270
echo "Cannot remove $FNAME. Does $USER have privileges? "
278
if test "$mode" = 'install'; then
280
======================================================================
281
The SWAT files have been installed. Remember to read the documentation
282
for information on enabling and using SWAT
283
======================================================================
287
======================================================================
288
The SWAT files have been removed. You may restore these files using
289
the command "make installswat" or "make install" to install binaries,
290
man pages, modules, SWAT, and shell scripts.
291
======================================================================