Develop and Download Open Source Software

Browse CVS Repository

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

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


Revision 1.1 - (hide annotations) (download) (as text)
Fri Jun 4 05:56:40 2004 UTC (19 years, 10 months ago) by orrisroot
Branch: MAIN
File MIME type: text/x-sh
added UNIX version of build scripts.

1 orrisroot 1.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 ...
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=`basedir $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     echo -n [samurai-graph] deleting distdir $DISTDIRNAME ...
113     rm -rf $DISTDIRNAME
114     echo done
115     }
116    
117     clean_zip () {
118     echo -n [samurai-graph] deleting archive $DISTDIRNAME.zip ...
119     rm -f $DISTDIRNAME.zip
120     echo done
121     }
122    
123     case "$1" in
124     build)
125     build_lib
126     build_sub
127     build_dist
128     build_zip
129     ;;
130     rebuild)
131     rm -f $DONEFILE1 $DONEFILE2
132     rebuild_sub
133     build_dist
134     build_zip
135     ;;
136     rebuild-all)
137     rm -f $DONEFILE1 $DONEFILE2
138     rebuild_lib
139     rebuild_sub
140     build_dist
141     build_zip
142     ;;
143     clean)
144     rm -f $DONEFILE1 $DONEFILE2
145     clean_sub
146     clean_dist
147     clean_zip
148     ;;
149     distclean)
150     rm -f $DONEFILE1 $DONEFILE2
151     clean_lib
152     clean_sub
153     clean_dist
154     clean_zip
155     ;;
156     *)
157     echo "Usage: ${0##*/}: { build | rebuild | rebuild-all | clean | distclean }" 2>&1
158     exit 65
159     ;;
160     esac

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