]> dev.renevier.net Git - syp.git/blob - build.sh
d6c6a28138156a8b0e14fd6cd5071ad79877f132
[syp.git] / build.sh
1 #!/bin/sh
2
3 set -e
4
5 PROJVERS=0.1
6 PROJNAME=syp
7
8 BUILDDIR=${1:-build}
9 DESTDIR=${BUILDDIR}/${PROJNAME}-${PROJVERS}
10
11 rm -rf $BUILDDIR
12 mkdir -p $DESTDIR
13
14 # php includes
15 cp -RLp inc/ $DESTDIR/
16
17 # other php files
18 cp -p admin.*php index.*php wizard.*php news.php api.php items.php logout.php $DESTDIR/
19
20 # media
21 cp -RLp media/ $DESTDIR/
22
23 # openlayers
24 mkdir -p $DESTDIR/openlayers
25 cd openlayers/build/
26 python build.py ../../syp.cfg
27 cd ../../
28 cp -RLp openlayers/build/OpenLayers.js $DESTDIR/openlayers/
29
30 # openlayers images
31 mkdir $DESTDIR/openlayers/img
32 for file in east-mini.png \
33             marker-gold.png \
34             north-mini.png \
35             blank.gif \
36             west-mini.png \
37             zoom-plus-mini.png \
38             marker-blue.png \
39             marker-green.png \
40             south-mini.png \
41             zoom-minus-mini.png \
42             zoom-world-mini.png; do
43     cp -p openlayers/img/$file $DESTDIR/openlayers/img
44 done
45 # openlayers theme
46 mkdir -p $DESTDIR/openlayers/theme/default/img
47 cp -Lp openlayers/theme/default/style.css $DESTDIR/openlayers/theme/default/style.css
48 cp -RLp openlayers/theme/default/img/close.gif $DESTDIR/openlayers/theme/default/img
49
50 # other javascript
51 cp -RLp js/ $DESTDIR/
52
53 # replace jquery with minified version
54 for file in $DESTDIR/js/jquery-*.min.js; do
55     jversion=${file##$DESTDIR/js/jquery-}
56     jversion=${jversion%%\.min\.js}
57     mv $file $DESTDIR/js/jquery-$jversion.js
58 done
59
60 # copyright and readme files
61 cp -p license.txt README.txt COPYING.txt $DESTDIR/
62
63 # creates upload directory
64 mkdir $DESTDIR/upload
65 chmod a+wx $DESTDIR/upload
66
67 # generate sources
68 cd $BUILDDIR
69 tar -pczf ${PROJNAME}_${PROJVERS}.tar.gz ${PROJNAME}-${PROJVERS}
70 zip -r ${PROJNAME}_${PROJVERS}.zip ${PROJNAME}-${PROJVERS}
71 cd ..