root/releases/bedework-3.8/build/quickstart/linux/bw

Revision 3353 (checked in by douglm, 2 years ago)

Missing dependency for davutil

  • Property svn:mergeinfo set to
  • Property svn:executable set to *
Line 
1 #! /bin/sh
2
3 #
4 # This file is included by the quickstart script file "bw" so that it can live
5 # within the svn repository.
6 #
7
8 ANT_HOME=`dirname "$PRG"`/apache-ant-1.7.0
9 ANT_HOME=`cd "$ANT_HOME" && pwd`
10
11 #ant_listener="-listener org.apache.tools.ant.listener.Log4jListener"
12 #ant_xmllogfile="-DXmlLogger.file=log.xml"
13 #ant_logger="-logger org.apache.tools.ant.XmlLogger"
14
15 ant_listener=
16 ant_xmllogfile=
17 ant_logger=
18
19 ant_loglevel="-quiet"
20 bw_loglevel=""
21
22 # Projects we need to update
23 updateProjects="bwxml rpiutil access davutil webdav caldav bedework bedework-carddav bwtzsvr cachedfeeder"
24
25 # Projects we will build - pkgdefault (bedework) is built if nothing specified
26 pkgdefault=yes
27 access=
28 bedework=
29 bwtools=
30 bwxml=
31 caldav=
32 caldavTest=
33 carddav=
34 catsvr=
35 client=
36 davutil=
37 monitor=
38 naming=
39 rpiutil=
40 synch=
41 testsuite=
42 tzsvr=
43 webdav=
44
45 # Special targets - avoiding dependencies
46
47 deploylog4j=
48 dirstart=
49
50 specialTarget=
51
52 echo ""
53 echo "  Bedework Calendar System"
54 echo "  ------------------------"
55 echo ""
56
57 PRG="$0"
58
59 usage() {
60   echo "  $PRG ACTION"
61   echo "  $PRG [CONFIG-SOURCE] [CONFIG] [PROJECT] [ -offline ] [LOG_LEVEL] [ target ] "
62   echo ""
63   echo " where:"
64   echo ""
65   echo "   ACTION defines an action to take usually in the context of the quickstart."
66   echo "    In a deployed system many of these actions are handled directly by a"
67   echo "    deployed application. ACTION may be one of"
68   echo "      -updateall  Does an svn update of all projects"
69   echo "      -zoneinfo   builds zoneinfo data for the timezones server"
70   echo "                  requires -version and -tzdata parameters.   "
71   echo "                  NOTE: build depends on glib2 and only works on Linux/Unix"
72   echo "      -buildwebcache     builds webcache"
73   echo "      -deploywebcache    deploys webcache"
74   echo "      -deployurlbuilder  deploys url/widget builder"
75   echo ""
76   echo "   CONFIG-SOURCE optionally defines the location of configurations and"
77   echo "                 is one or none of  "
78   echo "     -quickstart    to use the configurations within the quickstart"
79   echo "     -bwchome path  to specify the location of the bwbuild directory"
80   echo "   The default is to look in the user home for the bwbuild directory."
81   echo ""
82   echo "   CONFIG optionally defines the configuration to build"
83   echo "      -bwc configname"
84   echo ""
85   echo "   -offline     Build without attempting to retrieve library jars"
86   echo ""
87   echo "   LOG_LEVEL sets the level of logging and can be"
88   echo "      -log-silent   Nearly silent"
89   echo "      -log-quiet    The default"
90   echo "      -log-inform   A little more noisy"
91   echo "      -log-verbose  Noisier"
92   echo "      -ant-debug    Vast amounts of ant output"
93   echo "      -build-debug  Some bedework build debug output"
94   echo ""
95   echo "   target       Ant target to execute"
96   echo ""
97   echo "   PROJECT optionally defines the package to build and is one of"
98   echo "           the core, ancillary or experimental targets below:"
99   echo ""
100   echo "   Core projects: required for a functioning system"
101   echo "     -access      Target is for the access classes"
102   echo "     -bwxml       Target is for the Bedework XML schemas build"
103   echo "                       (usually built automatically be dependent projects"
104   echo "     -caldav      Target is for the CalDAV build"
105   echo "     -carddav     Target is for the CardDAV build"
106   echo "     -carddav deploy-addrbook    To deploy the Javascript Addressbook client."
107   echo "     -davutil     Target is for the Bedework dav util classes"
108   echo "     -rpiutil     Target is for the Bedework util classes"
109   echo "     -tzsvr       Target is for the timezones server build"
110   echo "     -webdav      Target is for the WebDAV build"
111   echo "   Ancillary projects: not required"
112   echo "     -bwtools     Target is for the Bedework tools build"
113   echo "     -caldavTest  Target is for the CalDAV Test build"
114   echo "     -monitor     Target is for the bedework monitor application"
115   echo "     -testsuite   Target is for the bedework test suite"
116   echo "   Experimental projects: no guarantees"
117   echo "     -catsvr      Target is for the Catsvr build"
118   echo "     -client      Target is for the bedework client application build"
119   echo "     -synch       Target is for the synch build"
120   echo "     -naming      Target is for the abstract naming api"
121   echo "     The default is a calendar build"
122   echo ""
123   echo "   Invokes ant to build or deploy the Bedework system. Uses a configuration"
124   echo "   directory which contains one directory per configuration."
125   echo ""
126   echo "   Within each configuration directory we expect a file called build.properties"
127   echo "   which should point to the property and options file needed for the deploy process"
128   echo ""
129   echo "   In general these files will be in the same directory as build.properties."
130   echo "   The environment variable BEDEWORK_CONFIG contains the path to the current"
131   echo "   configuration directory and can be used to build a path to the other files."
132   echo ""
133 }
134
135 errorUsage() {
136   echo "*******************************************************************************************"
137   echo "Error: $1"
138   echo "*******************************************************************************************"
139   echo
140   echo "Sleeping 5 seconds before displaying usage. Safe to ctrl-C."
141   sleep 5
142   echo ""
143   usage
144   exit 1
145 }
146
147 # ----------------------------------------------------------------------------
148 # Update the projects
149 # ----------------------------------------------------------------------------
150 actionUpdateall() {
151   for project in $updateProjects
152   do
153     echo "*********************************************************************"
154     echo "Updating project $project"
155     echo "*********************************************************************"
156     svn update $project
157   done
158  
159   exit 0
160 }
161
162 usageZoneinfo() {
163   echo ""
164   echo "$PRG -zoneinfo -version VERSION -tzdata path-to-data"
165   echo "for example:"
166   echo "$PRG -zoneinfo -version 2010m -tzdata /data/olson/tzdata2010m.tar.gz"
167   exit 1
168 }
169
170 # Change to the next project to build. Exit if we're done.
171 # The order below reflects the dependencies
172 setDirectory() {
173     specialTarget=
174    
175 #     Special targets
176         if [ "$dirstart" != "" ] ; then
177           cd $QUICKSTART_HOME
178           specialTarget=dirstart
179       dirstart=
180           return
181         fi
182
183         if [ "$deploylog4j" != "" ] ; then
184           cd $QUICKSTART_HOME
185           specialTarget=deploylog4j
186       deploylog4j=
187           return
188         fi
189        
190 #     projects
191         if [ "$bwxml" != "" ] ; then
192           cd $QUICKSTART_HOME/bwxml
193       bwxml=
194           return
195         fi
196        
197         if [ "$rpiutil" != "" ] ; then
198           cd $QUICKSTART_HOME/rpiutil
199       rpiutil=
200           return
201         fi
202        
203         if [ "$access" != "" ] ; then
204           cd $QUICKSTART_HOME/access
205       access=
206           return
207         fi
208        
209         if [ "$davutil" != "" ] ; then
210           cd $QUICKSTART_HOME/davutil
211       davutil=
212           return
213         fi
214        
215         if [ "$webdav" != "" ] ; then
216           cd $QUICKSTART_HOME/webdav
217       webdav=
218           return
219         fi
220        
221         if [ "$caldav" != "" ] ; then
222           cd $QUICKSTART_HOME/caldav
223       caldav=
224           return
225         fi
226        
227         if [ "$caldavTest" != "" ] ; then
228           cd $QUICKSTART_HOME/caldavTest
229       caldavTest=
230           return
231         fi
232        
233         if [ "$carddav" != "" ] ; then
234           cd $QUICKSTART_HOME/bedework-carddav
235       carddav=
236           return
237         fi
238        
239         if [ "$bedework" != "" ] ; then
240           cd $QUICKSTART_HOME
241       bedework=
242           return
243         fi
244        
245         if [ "$catsvr" != "" ] ; then
246           cd $QUICKSTART_HOME/catsvr
247       catsvr=
248           return
249         fi
250        
251         if [ "$client" != "" ] ; then
252           cd $QUICKSTART_HOME/bwclient
253       client=
254           return
255         fi
256        
257         if [ "$monitor" != "" ] ; then
258           cd $QUICKSTART_HOME/MonitorApp
259       monitor=
260           return
261         fi
262        
263         if [ "$naming" != "" ] ; then
264           cd $QUICKSTART_HOME/bwnaming
265       naming=
266           return
267         fi
268        
269         if [ "$synch" != "" ] ; then
270           cd $QUICKSTART_HOME/synch
271       synch=
272           return
273         fi
274        
275         if [ "$testsuite" != "" ] ; then
276           cd $QUICKSTART_HOME/testsuite
277       testsuite=
278           return
279         fi
280        
281         if [ "$tzsvr" != "" ] ; then
282           cd $QUICKSTART_HOME/bwtzsvr
283       tzsvr=
284           return
285         fi
286        
287         if [ "$bwtools" != "" ] ; then
288           cd $QUICKSTART_HOME/bwtools
289       bwtools=
290           return
291         fi
292        
293         exit 0;
294 }
295
296 # ----------------------------------------------------------------------------
297 # Build zoneinfo - require -version -tzdata
298 # tzdata file can be obtained via http://www.twinsun.com/tz/tz-link.htm or
299 # more directly from ftp://elsie.nci.nih.gov/pub/
300 # The version parameter value should be the version code from the tzdata name
301 # ----------------------------------------------------------------------------
302 actionZoneinfo() {
303   bwtzsvr="$QUICKSTART_HOME/bwtzsvr"
304   bwresources="$bwtzsvr/resources"
305
306   shift
307  
308   if [ "$1" != "-version" ] ; then
309     echo "got $1"
310     echo "Must supply -version parameter for -zoneinfo"
311     usageZoneinfo
312   fi
313  
314   shift
315     echo "got $1"
316 #  version="-Dorg.bedework.timezones.version=$1"
317   version=$1
318   shift
319  
320   if [ "$1" != "-tzdata" ] ; then
321     echo "Must supply -tzdata parameter for -zoneinfo"
322     usageZoneinfo
323   fi
324  
325   shift
326 #  tzdata="-Dorg.bedework.timezones.data=$1"
327   tzdata=$1
328   shift
329  
330   rm -rf /tmp/bedework
331   mkdir /tmp/bedework
332   mkdir /tmp/bedework/timezones
333  
334   cd /tmp/bedework/timezones
335  
336   wget http://bedework.org/downloads/lib/vzic-1.3.tgz
337   gunzip vzic-1.3.tgz
338   tar -xf vzic-1.3.tar
339
340 # copy and unpack the data
341   mkdir olsondata
342   cd olsondata
343   cp $tzdata tzdata.tar.gz
344   gunzip tzdata.tar.gz
345   tar -xf tzdata.tar
346   rm tzdata.tar
347   cd ..
348  
349 # Replace lines in the makefile. Sure real unix types can do better 
350  
351   cd vzic-1.3
352  
353   sed "s/\(^OLSON_DIR = \)\(..*$\)/\1\/tmp\/bedework\/timezones\/olsondata/" Makefile > Makefile1
354
355   sed "s/\(^PRODUCT_ID = \)\(..*$\)/\1\/bedework.org\/\/NONSGML Bedework\/\/EN/" Makefile1 > Makefile2
356
357   sed "s/\(^TZID_PREFIX = \)\(..*$\)/\1/" Makefile2 > Makefile
358  
359   make
360  
361 # omit the pure for allegedly better outlook compatability -
362 # but not altogether correct timezones 
363   ./vzic --pure
364
365   cd ..
366  
367   mkdir tzdata
368   cp -r vzic-1.3/zoneinfo tzdata
369   cp $bwresources/aliases.txt tzdata
370  
371   cd tzdata
372  
373   echo "version=$version" > info.txt
374 #  date +buildTime=%D-%T-%N >> info.txt
375   date --utc +buildTime=%Y%m%dT%H%M%SZ >> info.txt
376  
377   zip -r tzdata *
378  
379   cp tzdata.zip $bwtzsvr/dist
380  
381   echo ""
382   echo "------------------------------------------------------------------------------"
383   echo "tzdata.zip has been built and is at $bwtzsvr/tzdata.zip"
384   echo "------------------------------------------------------------------------------"
385   echo ""
386  
387   exit 0
388 }
389
390 if [ -z "$JAVA_HOME" -o ! -d "$JAVA_HOME" ] ; then
391   errorUsage "JAVA_HOME is not defined correctly for bedework."
392 fi
393
394 saveddir=`pwd`
395
396 trap 'cd $saveddir' 0
397 trap "exit 2" 1 2 3 15
398
399 export QUICKSTART_HOME=$saveddir
400
401 CLASSPATH=$ANT_HOME/lib/ant-launcher.jar
402 CLASSPATH=$CLASSPATH:$QUICKSTART_HOME/bedework/build/quickstart/antlib
403
404 # Default some parameters
405
406 BWCONFIGS=
407 bwc=default
408 BWCONFIG=
409 offline=
410 quickstart=
411
412 action=
413
414 if [ "$1" = "" ] ; then
415   usage
416   exit 1
417 fi
418
419 # look for actions first
420
421 if [ "$1" = "-updateall" ] ; then
422   actionUpdateall
423 fi
424
425 if [ "$1" = "-zoneinfo" ] ; then
426   actionZoneinfo $*
427 fi
428
429 if [ "$1" = "-buildwebcache" ] ; then
430   cd $QUICKSTART_HOME/cachedfeeder
431   ./buildWebCache
432   exit
433 fi
434
435 if [ "$1" = "-deploywebcache" ] ; then
436   cd $QUICKSTART_HOME/cachedfeeder
437   $JAVA_HOME/bin/java -classpath $CLASSPATH $ant_xmllogfile -Dant.home=$ANT_HOME org.apache.tools.ant.launch.Launcher \
438                  $BWCONFIG $ant_listener $ant_logger $ant_loglevel $bw_loglevel deploy-webcache
439   exit
440 fi
441
442 if [ "$1" = "-deployurlbuilder" ] ; then
443   cd $QUICKSTART_HOME/cachedfeeder
444   $JAVA_HOME/bin/java -classpath $CLASSPATH $ant_xmllogfile -Dant.home=$ANT_HOME org.apache.tools.ant.launch.Launcher \
445                  $BWCONFIG $ant_listener $ant_logger $ant_loglevel $bw_loglevel deploy-urlbuilder
446   exit
447 fi
448
449 while [ "$1" != "" ]
450 do
451   # Process the next arg
452   case $1       # Look at $1
453   in
454     -bwchome)         # Define location of configs
455       shift
456       BWCONFIGS="$1"
457       shift
458       ;;
459     -quickstart)
460       quickstart="yes"
461       shift
462       ;;
463     -usage | -help | -? | ?)
464       usage
465       exit
466       shift
467       ;;
468     -bwc)
469       shift
470       bwc="$1"
471       shift
472       ;;
473     -offline)
474       offline="-Dorg.bedework.offline.build=yes"
475       shift
476       ;;
477 # ----------------------- Log level       
478     -log-silent)
479       ant_loglevel="-quiet"
480       bw_loglevel="-Dorg.bedework.build.silent=true"
481       shift
482       ;;
483     -log-quiet)
484       ant_loglevel="-quiet"
485       bw_loglevel=""
486       shift
487       ;;
488     -log-inform)
489       ant_loglevel=""
490       bw_loglevel="-Dorg.bedework.build.inform=true"
491       shift
492       ;;
493     -log-verbose)
494       ant_loglevel="-verbose"
495       bw_loglevel="-Dorg.bedework.build.inform=true -Dorg.bedework.build.noisy=true"
496       shift
497       ;;
498     -ant-debug)
499       ant_loglevel="-debug"
500       shift
501       ;;
502     -build-debug)
503       bw_loglevel="-Dorg.bedework.build.inform=true -Dorg.bedework.build.noisy=true -Dorg.bedework.build.debug=true "
504       shift
505       ;;
506 # ------------------------Special targets
507         deploylog4j)
508           deploylog4j="yes"
509       pkgdefault=
510       shift
511       ;;
512         dirstart)
513           dirstart="yes"
514       pkgdefault=
515       shift
516       ;;
517 # ------------------------Projects
518     -access)
519       access="yes"
520      
521       bwxml="yes"
522       rpiutil="yes"
523       pkgdefault=
524       shift
525       ;;
526     -bwtools)
527       bwtools="yes"
528       pkgdefault=
529       shift
530       ;;
531     -bwxml)
532       bwxml="yes"
533       pkgdefault=
534       shift
535       ;;
536     -caldav)
537       caldav="yes"
538
539       access="yes"
540       bwxml="yes"
541       rpiutil="yes"
542       webdav="yes"
543       pkgdefault=
544       shift
545       ;;
546     -caldavTest)
547       caldavTest="yes"
548
549       access="yes"
550       bwxml="yes"
551       rpiutil="yes"
552       webdav="yes"
553       pkgdefault=
554       shift
555       ;;
556     -carddav)
557       carddav="yes"
558
559       access="yes"
560       bwxml="yes"
561       davutil="yes"
562       rpiutil="yes"
563       webdav="yes"
564       pkgdefault=
565       shift
566       ;;
567     -catsvr)
568       catsvr="yes"
569
570       access="yes"
571       bwxml="yes"
572       rpiutil="yes"
573       webdav="yes"
574       pkgdefault=
575       shift
576       ;;
577     -client)
578       client="yes"
579       pkgdefault=
580       shift
581       ;;
582     -davutil)
583       davutil="yes"
584
585       bwxml="yes"
586       rpiutil="yes"
587       pkgdefault=
588       shift
589       ;;
590     -monitor)
591       monitor="yes"
592       pkgdefault=
593       shift
594       ;;
595     -naming)
596       naming="yes"
597       pkgdefault=
598       shift
599       ;;
600     -rpiutil)
601       rpiutil="yes"
602
603       bwxml="yes"
604       pkgdefault=
605       shift
606       ;;
607     -synch)
608       synch="yes"
609      
610       access="yes"
611       bwxml="yes"
612       davutil="yes"
613       rpiutil="yes"
614       pkgdefault=
615       shift
616       ;;
617     -testsuite)
618       testsuite="yes"
619       pkgdefault=
620       shift
621       ;;
622     -tzsvr)
623       tzsvr="yes"
624       bwxml="yes"
625       rpiutil="yes"
626       pkgdefault=
627       shift
628       ;;
629     -webdav)
630       webdav="yes"
631
632       access="yes"
633       bwxml="yes"
634       rpiutil="yes"
635       pkgdefault=
636       shift
637       ;;
638     -*)
639       usage
640       exit 1
641       ;;
642     *)
643       # Assume we've reached the target(s)
644       break
645       ;;
646   esac
647 done
648
649 if [ "$pkgdefault" = "yes" ] ; then
650   bedework="yes"
651
652   access="yes"
653   bwxml="yes"
654   caldav="yes"
655   davutil="yes"
656   rpiutil="yes"
657   webdav="yes"
658 fi
659
660 if [ "$quickstart" != "" ] ; then
661   if [ "$BWCONFIGS" != "" ] ; then
662     errorUsage "Cannot specify both -quickstart and -bwchome"
663   fi
664   if [ "$bwc" = "jboss" ] ; then
665         errorUsage "The jboss configuration has been removed from the quickstart.  It is now the default.  Remove the '-bwc jboss' option."
666   fi
667
668   BWCONFIGS=$QUICKSTART_HOME/bedework/config/bwbuild
669 elif [ "$BWCONFIGS" = "" ] ; then
670   BWCONFIGS=$HOME/bwbuild
671 fi
672
673 export BEDEWORK_CONFIGS_HOME=$BWCONFIGS
674 export BEDEWORK_CONFIG=$BWCONFIGS/$bwc
675
676 if [ ! -d "$BEDEWORK_CONFIGS_HOME/.platform" ] ; then
677   errorUsage "Configurations directory $BEDEWORK_CONFIGS_HOME is missing directory '.platform'."
678 fi
679
680 if [ ! -d "$BEDEWORK_CONFIGS_HOME/.defaults" ] ; then
681   errorUsage "Configurations directory $BEDEWORK_CONFIGS_HOME is missing directory '.defaults'."
682 fi
683
684 if [ ! -f "$BEDEWORK_CONFIG/build.properties" ] ; then
685   errorUsage "Configuration $BEDEWORK_CONFIG does not exist or is not a bedework configuration."
686 fi
687
688 # Make available for ant
689 export BWCONFIG="-Dorg.bedework.build.properties=$BEDEWORK_CONFIG/build.properties"
690
691 echo "BWCONFIGS=$BWCONFIGS"
692 echo "BWCONFIG=$BWCONFIG"
693
694 javacmd="$JAVA_HOME/bin/java -classpath $CLASSPATH $ant_xmllogfile $offline -Dant.home=$ANT_HOME org.apache.tools.ant.launch.Launcher $BWCONFIG $ant_listener $ant_logger $ant_loglevel $bw_loglevel"
695
696 while true
697 do
698   setDirectory
699  
700   if [ "$specialTarget" != "" ] ; then
701     $javacmd $specialTarget
702   else 
703     $javacmd $*
704   fi
705 done
706  
Note: See TracBrowser for help on using the browser.