3
3
# buildrpms.sh
4
4
# ---------------------
5
5
# Date : March 2014
6
- # Copyright : (C) 2014 by Matthias Kuhn
6
+ # Copyright : (C) 2014-2019 by Matthias Kuhn
7
7
# Email : matthias at opengis dot ch
8
+ # ---------------------
9
+ # Date : October 2017
10
+ # Copyright : (C) 2017-2019 by Daniele Viganò
11
+ # Email : daniele at vigano dot me
8
12
# ##########################################################################
9
13
# #
10
14
# This program is free software; you can redistribute it and/or modify #
14
18
# #
15
19
# ##########################################################################
16
20
21
+ if [ $_BUILDRPMS_DEBUG ]
22
+ then
23
+ set -x
24
+ fi
25
+
17
26
function print_info
18
27
{
19
28
echo -e " \e[0;32m$1 \033[0m"
40
49
41
50
function compress
42
51
{
43
- if command -v pbzip2 & > /dev/null; then
52
+ if command -v pbzip2 & > /dev/null
53
+ then
44
54
echo ' pbzip2'
45
55
else
46
56
echo ' bzip2'
142
152
143
153
print_info " Creating source tarball"
144
154
# Create source tarball
145
- git -C .. archive --format=tar --prefix=qgis-$version / HEAD | compress > sources/qgis-$version .tar.bz2
155
+ git -C .. archive --format=tar --prefix=qgis-$version / HEAD | $( compress) > sources/qgis-$version .tar.bz2
146
156
147
157
print_info " Creating source package"
148
158
# Build source package
@@ -156,12 +166,12 @@ then
156
166
exit 1
157
167
fi
158
168
159
- srpm=$( grep -e ' Wrote: .*\.src\.rpm' $OUTDIR /build.log |
160
- sed ' s_Wrote: /builddir/build/SRPMS/\(.*\)_\1_' )
161
-
162
169
print_info " Source package created: $srpm "
163
170
fi
164
171
172
+ srpm=" $( ls -t $OUTDIR /qgis-$version -$relver .* .src.rpm | head -n 1 ||
173
+ (print_error " Source package unavailable. Abort" ; exit 1)) "
174
+
165
175
if [ " $srpm_only " -eq " 1" ]
166
176
then
167
177
exit 0
171
181
for arch in " ${ARCHS[@]} "
172
182
do :
173
183
print_info " Building packages for $arch "
174
- if [ -f $OUTDIR /$arch /build.log ]
184
+ if [ -d $OUTDIR /$arch ]
175
185
then
176
- print_info " Cleaning log file"
177
- rm $OUTDIR /$arch /build.log
186
+ if [ -f $OUTDIR /$arch /build.log ]
187
+ then
188
+ print_info " Cleaning log file"
189
+ rm $OUTDIR /$arch /build.log
190
+ fi
191
+ else
192
+ mkdir $OUTDIR /$arch
178
193
fi
179
- mkdir $OUTDIR /$arch
180
194
181
- if ! mock -r $arch --rebuild $OUTDIR / $ srpm \
195
+ if ! mock -r $arch --rebuild $srpm \
182
196
--define " _relver $relver " \
183
197
--define " _version $version " \
184
198
--define " _timestamp $timestamp " \
0 commit comments