-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathrelease.sh
executable file
·286 lines (237 loc) · 7.51 KB
/
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
#!/bin/bash
echo "YATC Release Script"
echo "-------------------"
cat - << EOF
Copyright (c) 2008 Ivan Vucica.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the Author nor the names of any contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
EOF
echo ""
echo "Author: Ivan Vucica"
echo ""
echo "NOTE! This script should be used only for producing official release of"
echo "YATC by an authorized release manager. If you're not an authorized YATC"
echo "release manager, please use it ONLY for producing binaries for your"
echo "own fork of YATC."
echo ""
echo "Do you want to build source release? [Y]/n"
read srcrelease
echo "Do you want to build Debian release? [Y]/n"
read debrelease
echo "Do you want to build Win32 release? [Y]/n"
read win32release
echo "What version is this?"
read version
svn revert debian/changelog
svn revert product.h
svn revert README
sed s/0.3.3SVN/$version/g product.h > product.h.new
mv product.h.new product.h
sed s/0.3.3SVN/$version/g README > README.new
mv README.new README
svn revert configure.ac
sed s/0.3.3SVN/$version/g configure.ac > configure.ac.new
mv configure.ac.new configure.ac
echo "Building translations..."
cd translations
./build.sh
cd ..
if [ -z $srcrelease ]; then
srcrelease='y'
fi
if [ $srcrelease == 'y' ]; then
echo "Now building source release..."
echo ""
echo "Running autogen.sh..."
echo ""
./autogen.sh
echo "Running configure..."
echo ""
./configure
echo "Running make dist..."
echo ""
make dist
echo "Source release built!"
read
fi
if [ -z $win32release ]; then
win32release='y'
fi
if [ -z $debrelease ]; then
debrelease='y'
fi
if [ $win32release != "n" ]; then
echo "Now building Windows release..."
echo "Wiping config.h clean"
rm config.h
touch config.h
echo "Do you want full rebuild? y/[N]"
read win32rebuild
if [ -z $win32rebuild ]; then
win32rebuild='n'
fi
if [ $win32rebuild == 'y' ]; then
win32rebuild="--rebuild"
else
win32rebuild="--build"
fi
#codeblocks --target="Release MinGW32" $win32rebuild -ns yatc.cbp
wine "/mnt/hda1/Program Files/CodeBlocks/codeblocks.exe" --target="Release Windows" $win32rebuild -ns yatc.cbp
rm -rf "yatc-$version"
mkdir "yatc-$version"
cp AUTHORS "yatc-$version"
cp BUGS "yatc-$version"
cp COPYING "yatc-$version"
cp INSTALL "yatc-$version"
cp README "yatc-$version"
cp ROADMAP "yatc-$version"
cp SDL_gfx.dll "yatc-$version"
cp SDL.dll "yatc-$version"
cp exchndl.dll "yatc-$version"
cp charset.dll "yatc-$version"
cp gettextlib.dll "yatc-$version"
cp gettextpo.dll "yatc-$version"
cp gettextsrc.dll "yatc-$version"
cp iconv.dll "yatc-$version"
cp intl.dll "yatc-$version"
cp yatc.exe "yatc-$version"
mkdir "yatc-$version/translations/"
cp -R translations/hr_HR "yatc-$version/translations/hr_HR"
cp -R translations/pl_PL "yatc-$version/translations/pl_PL"
cp -R translations/pt_BR "yatc-$version/translations/pt_BR"
cp -R translations/sv_SE "yatc-$version/translations/sv_SE"
cp -R translations/es_ES "yatc-$version/translations/es_ES"
zip -r "yatc-$version.zip" "yatc-$version/"
echo "Windows release built!"
read
fi
if [ $debrelease != "n" ]; then
debtempdir="debtmp/"
debstartdir=`pwd`
echo "Now building Debian release..."
echo ""
echo "Modify source changelog? y/[N]"
read debchangelog
if [ -z $debchangelog ]; then
debchangelog='n'
fi
echo "Now enter your email and name, as entered when generating GPG key with gpg --gen-key"
echo "See more about building deb package in debian/README.Debian."
echo ""
echo "Your name and email? In form: 'Name Lastname <[email protected]>', omitting apostrophes"
read debianiser
debchangelogdate=`date -R`
cat - << EOF > .tmpdebchangelog
yatc (${version}-1) unstable; urgency=low
* New upstream release
-- ${debianiser} ${debchangelogdate}
EOF
echo ""
echo ""
echo "Press enter and then prepare to edit changelog entry using your sensible-editor"
echo "You MUST edit it or it will look quite silly"
echo "(at least remove: * Enter description here, perhaps this will suffice)"
echo ""
echo "Skip editing? (Always just press enter, only when running in a script enter Y!)"
echo ""
read skipedit
echo "You entered: "
echo $skipedit
if [ "$skipedit" != "y" ]; then
sensible-editor .tmpdebchangelog
else
echo "Command to run instead?"
read replacementcmd
if [ ! -z $replacementcmd ]; then
echo "Running $replacementcmd"
$replacementcmd
fi
fi
echo ""
echo ""
echo "I hope you edited it."
echo "Continuing."
echo ""
echo ""
if [ $debchangelog == 'y' ]; then
echo "Modifying original changelog"
cat .tmpdebchangelog debian/changelog > debian/changelog.new
mv debian/changelog.new debian/changelog
else
echo "Will modify a copy of changelog at later time"
fi
if [ $srcrelease == 'n' ]; then
echo "Source release was not built."
echo "First preparing for building source tarball."
echo "Running autogen.sh..."
echo ""
./autogen.sh
echo "Running configure..."
echo ""
./configure
echo "Let's move on."
fi
echo "Preparing a source tarball"
make dist
echo "Removing old tempdir"
rm -rf $debtempdir
echo "Creating new tempdir"
mkdir $debtempdir
echo "Copying tarball in debtempdir"
cp "yatc-$version.tar.gz" $debtempdir
echo "Entering tempdir"
cd $debtempdir
echo "Untarring"
tar xvvfz "yatc-$version.tar.gz"
echo "Entering build dir"
cd "yatc-$version"
echo "Copying debian/ dir"
cp -r ../../debian/ .
if [ $debchangelog == 'y' ]; then
echo "Already modified original changelog, not touching new version"
else
echo "Modifying copy of changelog now"
cat ../../.tmpdebchangelog debian/changelog > debian/changelog.new
mv debian/changelog.new debian/changelog
fi
echo "Running build process"
echo "Autogen"
./autogen.sh
echo "Configure"
./configure --prefix=/usr --bindir=/usr/games --mandir=/usr/share/man --datadir=/usr/games/share --datarootdir=/usr/games/share
echo "dpkg-buildpackage"
dpkg-buildpackage -d -rfakeroot
echo "Output files located in $debtempdir/."
echo "Named: "
echo " * yatc_$version-1.tar.gz"
echo " * yatc_$version-1.dsc"
echo " * yatc_$version-1_i386.changes"
echo " * yatc_$version-1_i386.deb"
echo ""
cd $debstartdir
echo "Debian release built!"
read
fi
echo "Reverting configure.ac and product.h"
svn revert configure.ac product.h README