File: mkdoc.sh

package info (click to toggle)
virtuoso-opensource 6.1.6+dfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 260,992 kB
  • ctags: 125,220
  • sloc: ansic: 652,748; sql: 458,419; xml: 282,834; java: 61,031; sh: 40,031; cpp: 36,890; cs: 25,240; php: 12,692; yacc: 9,523; lex: 7,018; makefile: 6,157; jsp: 4,484; awk: 1,643; perl: 1,013; ruby: 1,003; python: 326
file content (631 lines) | stat: -rwxr-xr-x 17,607 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
#!/bin/sh
#
#  mkdoc.sh
#
#  $Id$
#
#  Creates Virtuoso Documentation
#  
#  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
#  project.
#  
#  Copyright (C) 1998-2012 OpenLink Software
#  
#  This project is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by the
#  Free Software Foundation; only version 2 of the License, dated June 1991.
#  
#  This program is distributed in the hope that it will be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#  General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License along
#  with this program; if not, write to the Free Software Foundation, Inc.,
#  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#  
#  

# ----------------------------------------------------------------------
#  Fix issues with LOCALE
# ----------------------------------------------------------------------
LANG=C
LC_ALL=POSIX
export LANG LC_ALL


PORT=${PORT-1112}
_HTTPPORT=`expr $PORT + 10`
HTTPPORT=${HTTPPORT-$_HTTPPORT}
#PORT=1311
#HTTPPORT=8311
HOST=${HOST-localhost}
SERVER=${SERVER-}

DSN=$HOST:$PORT
SILENT=${SILENT-0}
MAKEDOCS=${MAKEDOCS-0}
HTMLDOCS=${HTMLDOCS-1}
DEMODB=${DEMODB}
LOGFILE=mkdoc.output
LOGDIR=`pwd`
ININAME=mkdemo.ini
ISQL=${ISQL-isql}

FEEDS_ADDRESS=$1

#echo "log file is: $LOGFILE";

STICKER_DAV="doc_vad_dav.xml"
STICKER_FS="doc_vad_filesystem.xml"
VAD_NAME="doc"
VAD_NAME_DEVEL="$VAD_NAME"_filesystem.vad
VAD_NAME_RELEASE="$VAD_NAME"_dav.vad
VERSION="1.1.18"
PACKDATE=`date +"%Y-%m-%d %H:%M"`

HOST_OS=`uname -s | grep WIN`
if [ "x$HOST_OS" != "x" ]
then
  TEMPFILE="`cygpath -m $TMP/isql.$$`"
  HOME="`cygpath -m $HOME`"
  LN="cp -rf"
  RM="rm -rf"
else
  TEMPFILE=/tmp/isql.$$
  LN="ln -f -s"
  RM="rm -f"
fi

CP="cp -f"

if [ "z$SERVER" = "z" ]  
then
    if [ "x$HOST_OS" != "x" ]
    then
	SERVER=virtuoso-odbc-t.exe
    else
	SERVER=virtuoso
    fi
fi

#. $HOME/binsrc/tests/suite/test_fn.sh

if [ -f /usr/xpg4/bin/rm ]
then
  myrm=/usr/xpg4/bin/rm
else
  myrm=$RM
fi

#==============================================================================
#  Standard functions
#==============================================================================
LOG()
{
    if test $SILENT -eq 1
    then
	echo "$*"	>> $LOGFILE
    else
	echo "$*"	| tee -a $LOGFILE
    fi
}

ECHO()
{
    echo "$*"		| tee -a $LOGDIR/$LOGFILE
}


RUN()
{
    echo "+ $*"		>> $LOGDIR/$LOGFILE

    STATUS=1
    if test $SILENT -eq 1
    then
	eval $*		>> $LOGDIR/$LOGFILE 2>/dev/null
    else
	eval $*		>> $LOGDIR/$LOGFILE
    fi
    STATUS=$?
}


LINE()
{
    ECHO "====================================================================="
}


BREAK()
{
    ECHO ""
    ECHO "---------------------------------------------------------------------"
    ECHO ""
}


BANNER()
{
    ECHO ""
    LINE
    ECHO "=  $*"
    ECHO "= " `date`
    LINE
    ECHO ""
}


START_SERVER()
{
   if [ "z$DEMODB" = "z" ]
   then
       timeout=180

       ECHO "Starting Virtuoso server ..."
       if [ "z$HOST_OS" != "z" ] 
       then
	   "$SERVER" +foreground &
       else
	   "$SERVER" +wait
       fi

       starth=`date | cut -f 2 -d :`
       starts=`date | cut -f 3 -d :|cut -f 1 -d " "`

       for i in $(seq 1 10)
       do
           sleep 6
           if (netstat -an | grep "$PORT" | grep LISTEN > /dev/null)
           then
       	ECHO "Virtuoso server started"
       	return 0
           fi
       done
       	ECHO "***WARNING: Could not start Virtuoso DOC Server within $timeout seconds"
       	return 1
   fi
}

STOP_SERVER()
{
    if [ "z$DEMODB" = "z" ]
    then
	RUN $ISQL $DSN dba dba '"EXEC=raw_exit();"' VERBOSE=OFF PROMPT=OFF ERRORS=STDOUT
    fi
}


DO_COMMAND()
{
  command=$1
  uid=${2-dba}
  passwd=${3-dba}
  $ISQL $DSN $uid $passwd ERRORS=stdout VERBOSE=OFF PROMPT=OFF "EXEC=$command" 	>> $LOGDIR/$LOGFILE
  if test $? -ne 0
  then
    ECHO "***FAILED: $command"
  else
    ECHO "PASSED: $command"
  fi
}

do_command_safe () {
  _dsn=$1
  command=$2
  shift
  shift
  echo "+ " $ISQL $_dsn dba dba ERRORS=STDOUT VERBOSE=OFF PROMPT=OFF "EXEC=$command" $*	>> $LOGFILE
  $ISQL $_dsn dba dba ERRORS=STDOUT VERBOSE=OFF PROMPT=OFF "EXEC=$command" $* 2>&1 > "${LOGFILE}.tmp"
  if test $? -ne 0
  then
    cat "${LOGFILE}.tmp" >> ${LOGFILE}
    LOG "***FAILED: starting $command"
  else
    if egrep '^\*\*\*' "${LOGFILE}.tmp" > /dev/null
    then
      LOG "***FAILED: execution of $command"
      msg=`cat ${LOGFILE}.tmp`
      echo "------------ SQL ERROR -------------"
      echo "$msg"
      echo "------------------------------------"
      echo "------------ SQL ERROR -------------"	>> $LOGFILE
      echo "$msg"	>> $LOGFILE
      echo "------------------------------------"	>> $LOGFILE
    else
      LOG "PASSED: $command"
    fi
  fi
  rm "${LOGFILE}.tmp" 2>/dev/null
}

CHECK_LOG()
{
    passed=`cat $LOGDIR/$LOGFILE | cut -b -200 | grep "PASSED:" | wc -l`
    failed=`cat $LOGDIR/$LOGFILE | cut -b -200 | grep "\*\*\*.*FAILED:" | wc -l`
    aborted=`cat $LOGDIR/$LOGFILE | cut -b -200 | grep "\*\*\*.*ABORTED:" | wc -l`

    ECHO ""
    LINE
    ECHO "=  Checking log file $LOGFILE for statistics:"
    ECHO "="
    ECHO "=  Total number of tests PASSED  : $passed"
    ECHO "=  Total number of tests FAILED  : $failed"
    ECHO "=  Total number of tests ABORTED : $aborted"
    LINE
    ECHO ""

    if (expr $failed + $aborted \> 0 > /dev/null)
    then
       ECHO "*** Not all tests completed successfully"
       ECHO "*** Check the file $LOGFILE for more information"
    fi
}


LOAD_SQL()
{
  sql=$1
  uid=${2-dba}
  passwd=${3-dba}

  RUN $ISQL $DSN $uid $passwd ERRORS=stdout VERBOSE=OFF PROMPT=OFF $sql
  if test $? -ne 0
  then
    ECHO "***FAILED: LOAD $sql"
  else
    ECHO "PASSED: LOAD $sql"
  fi
}

#
# make the whole documentation into an XPER
#


directory_clean () 
{
    LOG "Directory clean..."
    $myrm -rf vad 2>/dev/null
    $myrm -rf vad.* 2>/dev/null

    if [ "z$DEMODB" = "z" ]  
    then
	$myrm -rf mkdoc.log 2>/dev/null
	$myrm -rf doc.db 2>/dev/null
	$myrm -rf doc.trx 2>/dev/null
	$myrm -rf doc.tdb 2>/dev/null
	$myrm -rf doc.log 2>/dev/null
    fi
    # $myrm -rf virtuoso.ini 2>/dev/null
}

directory_init() {
LOG "Directory init..."
  mkdir vad
  mkdir vad/data
  mkdir vad/data/doc
#  mkdir vad/data/doc/html
  mkdir vad/data/doc/code
  mkdir vad/data/doc/images
  mkdir vad/data/doc/images/inst
  mkdir vad/data/doc/images/rth
  mkdir vad/data/doc/images/mac
  mkdir vad/data/doc/images/misc
  mkdir vad/data/doc/images/tree
  mkdir vad/data/doc/images/ui

  #mkdir vad/data/doc/pdf
  #$LN docsrc/pdf/*.html vad/data/doc/pdf/.

  $CP -f $HOME/binsrc/vsp/doc/* vad/data/doc/.
  $CP -f $HOME/docsrc/vsp/doc/* vad/data/doc/.
  # the later has latest stuff in and should be used.

#  $CP docsrc/html_virt/*.html vad/data/doc/html/.
#  $CP docsrc/html_virt/*.css vad/data/doc/html/.
#  $CP docsrc/html_virt/*.ico vad/data/doc/html/.
#  $CP docsrc/html_virt/*.rdf vad/data/doc/html/.
  $CP -R docsrc/html_virt vad/data/doc/html
  $CP docsrc/html_virt/*.css vad/data/doc/.

  $CP docsrc/images/*.jpg vad/data/doc/images/.
  $CP docsrc/images/*.gif vad/data/doc/images/.
  $CP docsrc/images/*.png vad/data/doc/images/.

  $CP docsrc/images/inst/*.png vad/data/doc/images/inst/.

  $CP docsrc/images/rth/*.jpg vad/data/doc/images/rth/.
  $CP docsrc/images/rth/*.png vad/data/doc/images/rth/.

  $CP docsrc/images/mac/*.jpg vad/data/doc/images/mac/.
  $CP docsrc/images/mac/*.gif vad/data/doc/images/mac/.
  $CP docsrc/images/mac/*.png vad/data/doc/images/mac/.

  $CP docsrc/images/misc/*.jpg vad/data/doc/images/misc/.
  $CP docsrc/images/misc/*.gif vad/data/doc/images/misc/.

  $CP docsrc/images/tree/*.gif vad/data/doc/images/tree/.

  $CP docsrc/images/ui/*.jpg vad/data/doc/images/ui/.
  $CP docsrc/images/ui/*.gif vad/data/doc/images/ui/.
  $CP docsrc/images/ui/*.png vad/data/doc/images/ui/.

  cp mksearch.sql vad/data/doc/code/.
  cp drop.sql vad/data/doc/code/.
  cp doc_sql_rdf.sql vad/data/doc/code/.
  #cp -f $HOME/binsrc/dav/DET_RDFData.sql vad/data/doc/code/.
}

sticker_init() {
  ISDAV=$1
  if [ "$ISDAV" = "1" ] ; then
    BASE_PATH="/DAV/VAD"
    TYPE="dav"
    STICKER=$STICKER_DAV
  else
    BASE_PATH="/vad/vsp"
    TYPE="http"
    STICKER=$STICKER_FS
  fi
  LOG "VAD Documentation sticker $STICKER creation..."
  echo "<?xml version=\"1.0\" encoding=\"ASCII\"?>" > $STICKER
  echo "<!DOCTYPE sticker SYSTEM \"vad_sticker.dtd\">" >> $STICKER
  echo "<sticker version=\"1.0.010505A\" xml:lang=\"en-UK\">" >> $STICKER
  echo "<caption>" >> $STICKER
  echo "  <name package=\"doc\">" >> $STICKER
  echo "    <prop name=\"Title\" value=\"Virtuoso Documentation\"/>" >> $STICKER
  echo "    <prop name=\"Developer\" value=\"OpenLink Software\"/>" >> $STICKER
  echo "    <prop name=\"Copyright\" value=\"(C) 1998-2012 OpenLink Software\"/>" >> $STICKER
  echo "    <prop name=\"Download\" value=\"http://www.openlinksw.com/virtuoso\"/>" >> $STICKER
  echo "    <prop name=\"Download\" value=\"http://www.openlinksw.co.uk/virtuoso\"/>" >> $STICKER
  echo "  </name>" >> $STICKER
  echo "  <version package=\"$VERSION\">" >> $STICKER
  echo "    <prop name=\"Release Date\" value=\""`date +"%Y-%m-%d %H:%M"`"\"/>" >> $STICKER
  echo "    <prop name=\"Build\" value=\"Release\"/>" >> $STICKER
  echo "  </version>" >> $STICKER
  echo "</caption>" >> $STICKER
  echo "<dependencies/>" >> $STICKER
  echo "<procedures uninstallation=\"supported\">" >> $STICKER
  echo "  <sql purpose=\"pre-install\"></sql>" >> $STICKER
  echo "  <sql purpose=\"post-install\"></sql>" >> $STICKER
  echo "</procedures>" >> $STICKER
  echo "<ddls>" >> $STICKER
  echo "  <sql purpose=\"pre-install\"></sql>" >> $STICKER
  echo "  <sql purpose=\"post-install\">" >> $STICKER
  echo "    <![CDATA[" >> $STICKER
  echo "      registry_set('_doc_path_', '"$BASE_PATH"/doc/');" >> $STICKER
  echo "      registry_set('_doc_version_', '$VERSION');" >> $STICKER
  echo "      registry_set('_doc_build_', '$PACKDATE');" >> $STICKER
  echo "      DB.DBA.VAD_LOAD_SQL_FILE('"$BASE_PATH"/doc/code/drop.sql', 1, 'report', $ISDAV);" >> $STICKER
  echo "      DB.DBA.VAD_LOAD_SQL_FILE('"$BASE_PATH"/doc/code/mksearch.sql', 1, 'report', $ISDAV);" >> $STICKER
  #echo "      DB.DBA.VAD_LOAD_SQL_FILE('"$BASE_PATH"/doc/code/DET_RDFData.sql', 1, 'report', $ISDAV);" >> $STICKER
  echo "      DB.DBA.VAD_LOAD_SQL_FILE('"$BASE_PATH"/doc/code/doc_sql_rdf.sql', 1, 'report', $ISDAV);" >> $STICKER
  echo "      DB.DBA.VHOST_REMOVE(lpath=>'/doc',del_vsps => 1);" >> $STICKER
  echo "      DB.DBA.VHOST_REMOVE(lpath=>'/doc/html',del_vsps => 1);" >> $STICKER
  echo "      DB.DBA.VHOST_REMOVE(lpath=>'/doc/pdf');" >> $STICKER
  echo "      DB.DBA.VHOST_REMOVE(lpath=>'/doc/images',del_vsps => 1);" >> $STICKER
  echo "      DB.DBA.VHOST_DEFINE(" >> $STICKER
  echo "        lpath    => '/doc'," >> $STICKER
  echo "        ppath    => '$BASE_PATH/doc/'," >> $STICKER
  echo "        is_dav   => $ISDAV," >> $STICKER
  echo "        vsp_user => 'dba'," >> $STICKER
  echo "        is_brws  => 0," >> $STICKER
  echo "        def_page => 'index.html'" >> $STICKER
  echo "      )" >> $STICKER
  echo "      ;" >> $STICKER
  echo "      DB.DBA.VHOST_DEFINE(lpath=>'/doc/pdf',ppath=>'/doc/pdf/');" >> $STICKER
#  echo "      DB.DBA.VHOST_DEFINE(" >> $STICKER
#  echo "        lpath    => '/doc/images'," >> $STICKER
#  echo "        ppath    => '$BASE_PATH/doc/images/'," >> $STICKER
#  echo "        is_dav   => $ISDAV," >> $STICKER
#  echo "        vsp_user => 'dba'," >> $STICKER
#  echo "        is_brws  => 0" >> $STICKER
#  echo "      )" >> $STICKER
#  echo "      ;" >> $STICKER
  echo "" >> $STICKER
  if [ "x$FEEDS_ADDRESS" != "x" ]
  then

    echo "  DELETE FROM DB.DBA.RDF_QUAD WHERE G = DB.DBA.RDF_MAKE_IID_OF_QNAME ('$FEEDS_ADDRESS');" >> $STICKER
    for file in `find vad -type f -name "*siocrdf.vsp" -print | LC_ALL=C sort`
    do
      name=`echo "$file" | cut -b10-`
      if [ "$TYPE" = "dav" ]
      then
        echo " SIOC_REMOVE_CHARS_MAIN('http://local.virt$BASE_PATH/$name','$FEEDS_ADDRESS');" >> $STICKER
      else
        echo " SIOC_REMOVE_CHARS_MAIN('file:/$BASE_PATH/$name','$FEEDS_ADDRESS');" >> $STICKER
      fi
    done

  fi
  echo "" >> $STICKER
  echo "    ]]>" >> $STICKER
  echo "  </sql>" >> $STICKER
  echo "  <sql purpose=\"pre-uninstall\"></sql>" >> $STICKER
  echo "</ddls>" >> $STICKER

  echo "<resources>" >> $STICKER

  for file in `find vad -type f -print | LC_ALL=C sort`
  do
    name=`echo "$file" | cut -b10-`
    perms='110100100NN'
    echo "$name" | egrep -e '.vspx$' > /dev/null && perms='111101101NN'
    echo "$name" | egrep -e '.vsp$' > /dev/null && perms='111101101NN'
    
    echo "  <file type=\"$TYPE\" overwrite=\"yes\" source=\"data\" target_uri=\"$name\" dav_owner=\"dav\" dav_grp=\"administrators\" dav_perm=\"$perms\" makepath=\"yes\"/>" >> $STICKER
  done

  echo "</resources>" >> $STICKER
  echo "<registry>" >> $STICKER
  echo "</registry>" >> $STICKER
  echo "</sticker>" >> $STICKER
}


vad_create() {
  STICKER=$1
  V_NAME=$2
  do_command_safe $DSN "DB.DBA.VAD_PACK('$STICKER', '.', '$V_NAME')"
  do_command_safe $DSN "commit work"
  do_command_safe $DSN "checkpoint"
}

#==============================================================================
#  MAIN ROUTINE
#==============================================================================

if [ "z$DEMODB" = "z" ] ; then
  rm -f doc.db doc.trx doc.log doc.lck mkdoc.output
  #virtuoso.ini
fi

BANNER "CREATING DOC DATABASE (mkdoc.sh)"

$ISQL -? 2>/dev/null 1>/dev/null 
if [ $? -eq 127 ] ; then
    LOG "***ABORTED: DOCUMENTATION PACKAGING, isql is not available"
    exit 1
fi
$SERVER -? 2>/dev/null 1>/dev/null 
if [ $? -eq 127 ] ; then
    LOG "***ABORTED: DOCUMENTATION PACKAGING, server is not available"
    exit 1
fi

curpwd=`pwd`
cd $HOME/binsrc/sqldoc
sh vspx_doc.sh
cd "$curpwd"

cat $ININAME | sed -e "s/1112/$PORT/g" | sed -e "s/1113/$HTTPPORT/g" | sed -e "s/demo\./doc\./g" > virtuoso.ini

STOP_SERVER
directory_clean
START_SERVER

BREAK

$RM vspx
$RM docsrc

ECHO "Copying from docsrc.."
$LN $HOME/docsrc docsrc
ECHO "Copying from vspx.."
$LN $HOME/binsrc/vspx vspx

if [ "x$HOST_OS" != "x" ]
then
    if [ -d docsrc/html_virt ]
    then 
      # too long arg list error under Cygwin, therefore go to the dir and erase with mask.  
      # rm -rf docsrc/html_virt/*.html
      cd docsrc/html_virt
      rm -f *.html
      cd "$curpwd"       
    else   
  mkdir docsrc/html_virt
    fi	
  cp $HOME/docsrc/stylesheets/sections/*.css docsrc/html_virt
else
  rm -rf $HOME/docsrc/html_virt/*html
  mkdir $HOME/docsrc/html_virt/
  cp $HOME/docsrc/stylesheets/sections/*.css $HOME/docsrc/html_virt
fi


if test $HTMLDOCS -eq 1
then
  ECHO "Producing vspx.."
  LOAD_SQL mkvspxdoc.sql dba dba
  ECHO "Producing html.."
  LOAD_SQL mkdoc_new.sql dba dba
  
  # Building routines - we make a temp sql and load it depending if we are making with/without feeds
  TEMP_SQL=temp.sql
  echo "" > $TEMP_SQL
  if [ "x$FEEDS_ADDRESS" = "x" ]
  then
    echo "MKDOC_DO_ALL('docsrc/xmlsource/virtdocs.xml', 'docsrc/html_virt', vector());" >> $TEMP_SQL
  else
    # We are going to need xsl files from binsrc/vsp/doc
    mkdir docsrc/doc
    cp $HOME/binsrc/vsp/doc/*.xsl docsrc/doc
    echo "MKDOC_DO_FEEDS('docsrc/xmlsource/virtdocs.xml', 'docsrc/html_virt', vector('serveraddr', '$FEEDS_ADDRESS'));" >> $TEMP_SQL
    echo "ECHO BOTH \$IF \$EQU \$STATE OK  \"PASSED\" \"***FAILED\";" >> $TEMP_SQL
    echo "ECHO BOTH \": Rendering FEEDS docs: STATE=\" \$STATE \" MESSAGE=\" \$MESSAGE \"\\n\";" >> $TEMP_SQL
    echo "MKDOC_DO_ALL('docsrc/xmlsource/virtdocs.xml', 'docsrc/html_virt', vector('rss', 'yes','serveraddr', '$FEEDS_ADDRESS'));" >> $TEMP_SQL
  fi
  echo "ECHO BOTH \$IF \$EQU \$STATE OK  \"PASSED\" \"***FAILED\";" >> $TEMP_SQL
  echo "ECHO BOTH \": Rendering HTML docs: STATE=\" \$STATE \" MESSAGE=\" \$MESSAGE \"\\n\";" >> $TEMP_SQL
  
  echo "MKDOC_PDF('docsrc/xmlsource/virtdocs.xml', 'docsrc/pdf', vector());" >> $TEMP_SQL
  echo "ECHO BOTH \$IF \$EQU \$STATE OK  \"PASSED\" \"***FAILED\";" >> $TEMP_SQL
  echo "ECHO BOTH \": Rendering PDF HTML source: STATE=\" \$STATE \" MESSAGE=\" \$MESSAGE \"\\n\";" >> $TEMP_SQL
  LOAD_SQL $TEMP_SQL dba dba
  rm -rf docsrc/doc
  rm -f $TEMP_SQL

  # under cygwin html_virt is a copy (see above LN)
  if [ "x$HOST_OS" != "x" ]
  then
    for _fil in `ls docsrc/html_virt`
    do
      chmod 644 docsrc/html_virt/$_fil
    done
    rm -rf $HOME/docsrc/html_virt
    cp -a docsrc/html_virt $HOME/docsrc/.
    cp docsrc/pdf/*.html $HOME/docsrc/pdf/.
  fi
fi

# Build the PDF docs if HTMLDOC is installed
if [ "z$VOS" = "z1" -a "z$HTMLDOC" != "z" -a -x "$HTMLDOC" ]
then
  ECHO "Building the PDF version"  
  cd $HOME/docsrc/pdf
  $HTMLDOC --batch htmldoc_pdf.book 2> /dev/null 1> /dev/null
  cd "$curpwd"
fi

ECHO '----------------------'
ECHO 'Documentation Application VAD create'
ECHO '----------------------'


directory_init
sticker_init 1
vad_create $STICKER_DAV $VAD_NAME_RELEASE

DO_COMMAND checkpoint
if [ "z$DEMODB" = "z" ]  
then
    DO_COMMAND shutdown
fi
STOP_SERVER

chmod 644 $VAD_NAME_RELEASE
$RM vspx
$RM docsrc
#
#  Checkpoint and shutdown the demo database
#

BREAK

BANNER "COMPLETED DOCUMENTATION demo (mkdoc.sh)"
CHECK_LOG
RUN egrep -q '"\*\*.*FAILED:|\*\*.*ABORTED:"' "$LOGFILE"
if test $STATUS -eq 0
then
	$myrm -f "$VAD_NAME_RELEASE"
	exit 1
fi

BANNER "COMPLETED VAD PACKAGING"
directory_clean

exit 0