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.4 - (show annotations) (download) (as text)
Sat Jul 10 21:09:41 2004 UTC (19 years, 9 months ago) by orrisroot
Branch: MAIN
CVS Tags: RELEASE_0_1_1, RELEASE_0_1
Changes since 1.3: +5 -0 lines
File MIME type: text/x-sh
added broken tag.

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

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