-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-release.sh
executable file
·133 lines (110 loc) · 2.96 KB
/
make-release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash
rm -rf bin
if [ -e Harmonium.jar ]
then
rm Harmonium.jar
fi
#######################
# update from repo
#######################
hg pull $1
hg update --clean
#######################
# get version info
#######################
export VERSION=`grep "VERSION\s*=\s*" org/dazeend/harmonium/Harmonium.java | egrep -o "[0-9]+\.[0-9]+(\.[0-9]+)?"`
export rev=`hg log -l1|grep changeset|grep -o ":\([[:alnum:]]\+\)"|grep -o "\([[:alnum:]]\+\)"`
echo "Building release archives for version ${VERSION} (${rev})."
echo "Adding version number to source code..."
perl -pi -e 's/{REV}/'$rev'/g' org/dazeend/harmonium/Harmonium.java
#######################
# build source archive
#######################
echo "Building source archive..."
export SRCFILE=../harmonium-source-${VERSION}-${rev}.zip
if [ -e ${SRCFILE} ]
then
rm ${SRCFILE}
fi
zip -qr ${SRCFILE} .
#######################
# compile
#######################
echo "Compiling Harmonium..."
./build.sh
if [ -e Harmonium ]
then
rm -rf Harmonium
fi
#####################
# build linux tarball
#####################
echo "Building Linux installation archive..."
mkdir Harmonium
cp CHANGELOG Harmonium/
cp COPYING Harmonium/
cp linux-INSTALL Harmonium/INSTALL
cp linux-UNINSTALL Harmonium/UNINSTALL
cp linux-UPGRADE Harmonium/UPGRADE
cp README Harmonium/
cp USAGE Harmonium/
cp CONTRIBUTORS Harmonium
cd Harmonium
flip -u CHANGELOG COPYING INSTALL UNINSTALL UPGRADE README USAGE CONTRIBUTORS
cd ..
cp Harmonium.jar Harmonium/
mkdir Harmonium/bin
cp wrapper/harmonium Harmonium/bin/
cp wrapper/wrapper Harmonium/bin/
mkdir Harmonium/conf
cp conf/linux-wrapper.conf Harmonium/conf/wrapper.conf
mkdir Harmonium/lib
cp libs/* Harmonium/lib/
cp wrapper/libwrapper.so Harmonium/lib/
cp wrapper/linux-wrapper.jar Harmonium/lib/wrapper.jar
mkdir Harmonium/logs
export LINUXFILE=../harmonium-linux-${VERSION}-${rev}.tar.gz
if [ -f ${LINUXFILE} ]
then
rm ${LINUXFILE}
fi
tar czf ${LINUXFILE} Harmonium
rm -rf Harmonium
#####################
# build windows zip
#####################
echo "Building Windows installation archive..."
mkdir Harmonium
cp CHANGELOG Harmonium/
cp COPYING Harmonium/
cp win-INSTALL Harmonium/INSTALL
cp win-UNINSTALL Harmonium/UNINSTALL
cp win-UPGRADE Harmonium/UPGRADE
cp README Harmonium/
cp USAGE Harmonium/
cp CONTRIBUTORS Harmonium/
cd Harmonium
flip -m CHANGELOG COPYING INSTALL UNINSTALL UPGRADE README USAGE CONTRIBUTORS
cd ..
cp Harmonium.jar Harmonium/
mkdir Harmonium/bin
cp wrapper/*.bat Harmonium/bin/
cp wrapper/wrapper.exe Harmonium/bin/
mkdir Harmonium/conf
cp conf/win-wrapper.conf Harmonium/conf/wrapper.conf
mkdir Harmonium/lib
cp libs/* Harmonium/lib/
cp wrapper/wrapper.dll Harmonium/lib/
cp wrapper/win-wrapper.jar Harmonium/lib/wrapper.jar
mkdir Harmonium/logs
export WINFILE=../harmonium-windows-${VERSION}-${rev}.zip
if [ -f ${WINFILE} ]
then
rm ${WINFILE}
fi
zip -qr ${WINFILE} Harmonium
#echo "Cleaning up..."
#hg revert --no-backup org/dazeend/harmonium/Harmonium.java
#rm -rf Harmonium
#rm -rf bin
#rm srclist