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/*.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@.*$//' > $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? "
126
# Install/ remove html documentation (if html documentation tree is here)
128
if [ -d $SRCDIR../docs/htmldocs/ ]; then
130
for dir in htmldocs/manpages htmldocs/Samba3-ByExample htmldocs/Samba3-Developers-Guide htmldocs/Samba3-HOWTO
133
if [ ! -d $SRCDIR../docs/$dir ]; then
137
INSTALLDIR="$DESTDIR/$SWATDIR/help/`echo $dir | sed 's/htmldocs\///g'`"
138
if test ! -d "$INSTALLDIR" -a "$mode" = 'install'; then
140
if test ! -d "$INSTALLDIR"; then
141
echo "Failed to make directory $INSTALLDIR, does $USER have privileges? "
146
for f in $SRCDIR../docs/$dir/*.html; do
147
FNAME=$INSTALLDIR/`basename $f`
149
if test "$mode" = 'install'; then
151
if test ! -f "$FNAME"; then
152
echo "Cannot install $FNAME. Does $USER have privileges? "
156
elif test "$mode" = 'uninstall'; then
158
if test -f "$FNAME"; then
159
echo "Cannot remove $FNAME. Does $USER have privileges? "
165
if test -d "$SRCDIR../docs/$dir/images/"; then
166
if test ! -d "$INSTALLDIR/images/" -a "$mode" = 'install'; then
167
mkdir "$INSTALLDIR/images"
168
if test ! -d "$INSTALLDIR/images/"; then
169
echo "Failed to make directory $INSTALLDIR/images, does $USER have privileges? "
173
for f in $SRCDIR../docs/$dir/images/*.png; do
174
FNAME=$INSTALLDIR/images/`basename $f`
176
if test "$mode" = 'install'; then
178
if test ! -f "$FNAME"; then
179
echo "Cannot install $FNAME. Does $USER have privileges? "
183
elif test "$mode" = 'uninstall'; then
185
if test -f "$FNAME"; then
186
echo "Cannot remove $FNAME. Does $USER have privileges? "
195
# Install/ remove Using Samba book (but only if it is there)
197
if [ "x$BOOKDIR" != "x" -a -f $SRCDIR../docs/htmldocs/using_samba/toc.html ]; then
201
for d in $BOOKDIR $BOOKDIR/figs ; do
202
if test ! -d "$d" -a "$mode" = 'install'; then
204
if test ! -d "$d"; then
205
echo "Failed to make directory $d, does $USER have privileges? "
213
for f in $SRCDIR../docs/htmldocs/using_samba/*.html; do
214
FNAME=$BOOKDIR/`basename $f`
216
if test "$mode" = 'install'; then
218
if test ! -f "$FNAME"; then
219
echo "Cannot install $FNAME. Does $USER have privileges? "
223
elif test "$mode" = 'uninstall'; then
225
if test -f "$FNAME"; then
226
echo "Cannot remove $FNAME. Does $USER have privileges? "
232
for f in $SRCDIR../docs/htmldocs/using_samba/*.gif; do
233
FNAME=$BOOKDIR/`basename $f`
235
if test "$mode" = 'install'; then
237
if test ! -f "$FNAME"; then
238
echo "Cannot install $FNAME. Does $USER have privileges? "
242
elif test "$mode" = 'uninstall'; then
244
if test -f "$FNAME"; then
245
echo "Cannot remove $FNAME. Does $USER have privileges? "
253
for f in $SRCDIR../docs/htmldocs/using_samba/figs/*.gif; do
254
FNAME=$BOOKDIR/figs/`basename $f`
256
if test "$mode" = 'install'; then
258
if test ! -f "$FNAME"; then
259
echo "Cannot install $FNAME. Does $USER have privileges? "
263
elif test "$mode" = 'uninstall'; then
265
if test -f "$FNAME"; then
266
echo "Cannot remove $FNAME. Does $USER have privileges? "
274
if test "$mode" = 'install'; then
276
======================================================================
277
The SWAT files have been installed. Remember to read the documentation
278
for information on enabling and using SWAT
279
======================================================================
283
======================================================================
284
The SWAT files have been removed. You may restore these files using
285
the command "make installswat" or "make install" to install binaries,
286
man pages, modules, SWAT, and shell scripts.
287
======================================================================