Develop and Download Open Source Software

Browse CVS Repository

Contents of /samurai-graph/samurai-graph/build.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Wed Jun 23 05:04:31 2004 UTC (19 years, 9 months ago) by orrisroot
Branch: MAIN
Changes since 1.2: +15 -8 lines
File MIME type: text/x-sh
modified crean_dist() and clean_zip() function.
  it is suppted past date files.

1 #!/bin/sh
2 PWD=`dirname $0`
3 cd $PWD
4
5 DONEFILE1=$PWD/.bulid.dist.done
6 DONEFILE2=$PWD/.bulid.zip.done
7 DATE=`date "+%Y%m%d"`
8 DISTDIRNAME=samurai-graph-$DATE
9 DISTDIR=$DISTDIRNAME
10 LIBDIR=$DISTDIR/lib
11 DOCDIR=$DISTDIR/doc
12 VGDIR=$LIBDIR
13 VGDOCDIR=$DOCDIR/vectorgraphics
14
15 VGSRCDIR=contrib/vectorgraphics
16 VGSRCDOCDIR=contrib/vectorgraphics/web/freehep/vectorgraphics
17 VGSRCJARDIR=$VGSRCDIR/lib
18
19 VGJARFILES="base graphics2d graphicsio graphicsio-cgm graphicsio-emf graphicsio-gif graphicsio-java graphicsio-pdf graphicsio-ppm graphicsio-ps graphicsio-svg graphicsio-swf"
20 VGEXTRAFILES="LGPL.txt LICENSE.txt"
21 VGRELEASENOTE="ReleaseNotes-1.2.2.xhtml"
22
23 EXTRAFILES="COPYING.txt LICENSE.txt samurai-graph.ico"
24
25 build_sub () {
26 # do compile
27 src/build.sh build
28 }
29
30 build_lib () {
31 # do compile
32 contrib/build.sh build
33 }
34
35 rebuild_sub () {
36 # do rebuild
37 src/build.sh rebuild
38 }
39
40 rebuild_lib() {
41 # do rebuild
42 contrib/build.sh rebuild
43 }
44
45 clean_sub () {
46 # do clean
47 src/build.sh clean
48 }
49
50 clean_lib () {
51 # do clean
52 contrib/build.sh clean
53 }
54
55 build_dist () {
56 if [ ! -f $DONEFILE1 ]; then
57 echo -n [samurai-graph] copying distfiles to $DISTDIRNAME ...
58 rm -rf $DISTDIR
59 # create dist directory
60 mkdir -p $DISTDIR
61 mkdir -p $LIBDIR
62 mkdir -p $VGDIR
63 mkdir -p $DOCDIR
64 mkdir -p $VGDOCDIR
65
66 # copy allfiles to dist directory
67 for i in $VGJARFILES; do
68 cp $VGSRCJARDIR/freehep-$i.jar $VGDIR
69 done
70 for i in $EXTRAFILES; do
71 cp $i $DISTDIR
72 done
73 cp src/samurai-graph.jar $DISTDIR
74 cp src/samurai-graph-client.jar $DISTDIR
75
76 for i in $VGEXTRAFILES; do
77 cp $VGSRCDIR/$i $VGDOCDIR
78 done
79 cp $VGSRCDOCDIR/$VGRELEASENOTE $VGDOCDIR/ReleaseNotes-1.2.2.html
80
81 cp -r examples $DISTDIR
82 rm -rf $DISTDIR/examples/CVS
83 rm -rf $DISTDIR/examples/data/CVS
84
85 echo '#!/bin/sh' > $DISTDIR/samurai-graph
86 echo 'JAVAVM=javavm' >> $DISTDIR/samurai-graph
87 echo 'if [ ! -x $JAVAVM ]; then' >> $DISTDIR/samurai-graph
88 echo ' JAVAVM=javaw' >> $DISTDIR/samurai-graph
89 echo 'fi' >> $DISTDIR/samurai-graph
90 echo 'if [ ! -x $JAVAVM ]; then' >> $DISTDIR/samurai-graph
91 echo ' JAVAVM=java' >> $DISTDIR/samurai-graph
92 echo 'fi' >> $DISTDIR/samurai-graph
93 echo 'BASEDIR=`dirname $0`' >> $DISTDIR/samurai-graph
94 echo 'exec $JAVAVM -jar $BASEDIR/samurai-graph.jar' >> $DISTDIR/samurai-graph
95 chmod 755 $DISTDIR/samurai-graph
96 touch $DONEFILE1
97 echo 'done'
98 fi
99 }
100
101 build_zip () {
102 if [ ! -f $DONEFILE2 ]; then
103 rm -f $DISTDIRNAME.zip
104 echo -n [samurai-graph] archiving $DISTDIRNAME.zip ...
105 zip -r $DISTDIRNAME $DISTDIRNAME >/dev/null 2>&1
106 touch $DONEFILE2
107 echo done
108 fi
109 }
110
111 clean_dist () {
112 DIR=`find . -name 'samurai-graph-*' -type d`
113 for i in $DIR; do
114 echo -n [samurai-graph] deleting distdir `basename $i` ...
115 rm -rf $i
116 echo done
117 done
118 rm -f $DONEFILE1
119 }
120
121 clean_zip () {
122 DIR=`find . -name 'samurai-graph-*.zip' -type f`
123 for i in $DIR; do
124 echo -n [samurai-graph] deleting archive `basename $i` ...
125 rm -rf $i
126 echo done
127 done
128 rm -f $DONEFILE2
129 }
130
131 case "$1" in
132 build)
133 build_lib
134 build_sub
135 build_dist
136 build_zip
137 ;;
138 rebuild)
139 rm -f $DONEFILE1 $DONEFILE2
140 rebuild_sub
141 build_dist
142 build_zip
143 ;;
144 rebuild-all)
145 rm -f $DONEFILE1 $DONEFILE2
146 rebuild_lib
147 rebuild_sub
148 build_dist
149 build_zip
150 ;;
151 clean)
152 clean_sub
153 clean_dist
154 clean_zip
155 ;;
156 distclean)
157 rm -f $DONEFILE1 $DONEFILE2
158 clean_lib
159 clean_sub
160 clean_dist
161 clean_zip
162 ;;
163 *)
164 echo "Usage: ${0##*/}: { build | rebuild | rebuild-all | clean | distclean }" 2>&1
165 exit 65
166 ;;
167 esac

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26