Merge lp:~roel11/percona-server/bug-1144059-5.6 into lp:percona-server/5.6
- bug-1144059-5.6
- Merge into 5.6
Proposed by
Roel Van de Paar
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Laurynas Biveinis | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 334 | ||||
Proposed branch: | lp:~roel11/percona-server/bug-1144059-5.6 | ||||
Merge into: | lp:percona-server/5.6 | ||||
Diff against target: |
1205 lines (+0/-583) 4 files modified
build/build-binary.sh (+0/-162) build/build-dpkg.sh (+0/-115) build/build-rpm.sh (+0/-154) build/build-shared-compat-rpm.sh (+0/-152) |
||||
To merge this branch: | bzr merge lp:~roel11/percona-server/bug-1144059-5.6 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Laurynas Biveinis (community) | Approve | ||
Registry Administrators | Pending | ||
Review via email: mp+151937@code.launchpad.net |
Commit message
Description of the change
Bug 1144059. Patch corrects executable flag properties for several ./build/*.sh scripts (chmod +x on build scripts)
And
Fixing up file-id's for build scripts.
To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'build/build-binary.sh' | |||
2 | --- build/build-binary.sh 1970-01-01 00:00:00 +0000 | |||
3 | +++ build/build-binary.sh 2013-03-06 12:02:24 +0000 | |||
4 | @@ -0,0 +1,162 @@ | |||
5 | 1 | #!/bin/sh | ||
6 | 2 | # | ||
7 | 3 | # Execute this tool to setup the environment and build binary releases | ||
8 | 4 | # for Percona-Server starting from a fresh tree. | ||
9 | 5 | # | ||
10 | 6 | # Usage: build-binary.sh [target dir] | ||
11 | 7 | # The default target directory is the current directory. If it is not | ||
12 | 8 | # supplied and the current directory is not empty, it will issue an error in | ||
13 | 9 | # order to avoid polluting the current directory after a test run. | ||
14 | 10 | # | ||
15 | 11 | |||
16 | 12 | # Bail out on errors, be strict | ||
17 | 13 | set -ue | ||
18 | 14 | |||
19 | 15 | # Examine parameters | ||
20 | 16 | TARGET="$(uname -m)" | ||
21 | 17 | TARGET_CFLAGS='' | ||
22 | 18 | QUIET='VERBOSE=1' | ||
23 | 19 | |||
24 | 20 | # Some programs that may be overriden | ||
25 | 21 | TAR=${TAR:-tar} | ||
26 | 22 | |||
27 | 23 | # Check if we have a functional getopt(1) | ||
28 | 24 | if ! getopt --test | ||
29 | 25 | then | ||
30 | 26 | go_out="$(getopt --options="iqdv" --longoptions=i686,quiet,debug,valgrind \ | ||
31 | 27 | --name="$(basename "$0")" -- "$@")" | ||
32 | 28 | test $? -eq 0 || exit 1 | ||
33 | 29 | eval set -- $go_out | ||
34 | 30 | fi | ||
35 | 31 | |||
36 | 32 | for arg | ||
37 | 33 | do | ||
38 | 34 | case "$arg" in | ||
39 | 35 | -- ) shift; break;; | ||
40 | 36 | -i | --i686 ) | ||
41 | 37 | shift | ||
42 | 38 | TARGET="i686" | ||
43 | 39 | TARGET_CFLAGS="-m32 -march=i686" | ||
44 | 40 | ;; | ||
45 | 41 | -q | --quiet ) | ||
46 | 42 | shift | ||
47 | 43 | QUIET='' | ||
48 | 44 | ;; | ||
49 | 45 | -d | --debug ) | ||
50 | 46 | shift | ||
51 | 47 | BUILD_COMMENT="${BUILD_COMMENT:-}-debug" | ||
52 | 48 | CMAKE_BUILD_TYPE='Debug' | ||
53 | 49 | ;; | ||
54 | 50 | -v | --valgrind ) | ||
55 | 51 | shift | ||
56 | 52 | CMAKE_OPTS="${CMAKE_OPTS:-} -DWITH_VALGRIND=ON" | ||
57 | 53 | BUILD_COMMENT="${BUILD_COMMENT:-}-valgrind" | ||
58 | 54 | ;; | ||
59 | 55 | esac | ||
60 | 56 | done | ||
61 | 57 | |||
62 | 58 | # Working directory | ||
63 | 59 | if test "$#" -eq 0 | ||
64 | 60 | then | ||
65 | 61 | WORKDIR="$(pwd)" | ||
66 | 62 | |||
67 | 63 | # Check that the current directory is not empty | ||
68 | 64 | if test "x$(echo *)" != "x*" | ||
69 | 65 | then | ||
70 | 66 | echo >&2 \ | ||
71 | 67 | "Current directory is not empty. Use $0 . to force build in ." | ||
72 | 68 | exit 1 | ||
73 | 69 | fi | ||
74 | 70 | |||
75 | 71 | elif test "$#" -eq 1 | ||
76 | 72 | then | ||
77 | 73 | WORKDIR="$1" | ||
78 | 74 | |||
79 | 75 | # Check that the provided directory exists and is a directory | ||
80 | 76 | if ! test -d "$WORKDIR" | ||
81 | 77 | then | ||
82 | 78 | echo >&2 "$WORKDIR is not a directory" | ||
83 | 79 | exit 1 | ||
84 | 80 | fi | ||
85 | 81 | |||
86 | 82 | WORKDIR_ABS="$(cd "$WORKDIR"; pwd)" | ||
87 | 83 | |||
88 | 84 | else | ||
89 | 85 | echo >&2 "Usage: $0 [target dir]" | ||
90 | 86 | exit 1 | ||
91 | 87 | |||
92 | 88 | fi | ||
93 | 89 | |||
94 | 90 | SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)" | ||
95 | 91 | test -e "$SOURCEDIR/Makefile" || exit 2 | ||
96 | 92 | |||
97 | 93 | # Extract version from the Makefile | ||
98 | 94 | MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \ | ||
99 | 95 | | cut -d = -f 2)" | ||
100 | 96 | PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \ | ||
101 | 97 | "$SOURCEDIR/Makefile" | cut -d = -f 2)" | ||
102 | 98 | PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" | ||
103 | 99 | |||
104 | 100 | # Build information | ||
105 | 101 | REVISION="$(cd "$SOURCEDIR"; bzr revno)" | ||
106 | 102 | PRODUCT_FULL="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" | ||
107 | 103 | PRODUCT_FULL="$PRODUCT_FULL-$REVISION${BUILD_COMMENT:-}.$(uname -s).$TARGET" | ||
108 | 104 | COMMENT="Percona Server with XtraDB (GPL), Release $PERCONA_SERVER_VERSION" | ||
109 | 105 | COMMENT="$COMMENT, Revision $REVISION${BUILD_COMMENT:-}" | ||
110 | 106 | |||
111 | 107 | # Compilation flags | ||
112 | 108 | export CC=${CC:-gcc} | ||
113 | 109 | export CXX=${CXX:-g++} | ||
114 | 110 | export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CFLAGS:-}" | ||
115 | 111 | export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CXXFLAGS:-}" | ||
116 | 112 | export MAKE_JFLAG=-j4 | ||
117 | 113 | |||
118 | 114 | # Create a temporary working directory | ||
119 | 115 | INSTALLDIR="$(cd "$WORKDIR" && TMPDIR="$WORKDIR_ABS" mktemp -d percona-build.XXXXXX)" | ||
120 | 116 | INSTALLDIR="$WORKDIR_ABS/$INSTALLDIR" # Make it absolute | ||
121 | 117 | |||
122 | 118 | # Build | ||
123 | 119 | ( | ||
124 | 120 | cd "$SOURCEDIR" | ||
125 | 121 | |||
126 | 122 | # Execute clean and download mysql, apply patches | ||
127 | 123 | make clean all | ||
128 | 124 | |||
129 | 125 | cd "$PRODUCT" | ||
130 | 126 | cmake . ${CMAKE_OPTS:-} -DBUILD_CONFIG=mysql_release \ | ||
131 | 127 | -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-RelWithDebInfo} \ | ||
132 | 128 | -DWITH_EMBEDDED_SERVER=OFF \ | ||
133 | 129 | -DFEATURE_SET=community \ | ||
134 | 130 | -DENABLE_DTRACE=OFF \ | ||
135 | 131 | -DCMAKE_INSTALL_PREFIX="/usr/local/$PRODUCT_FULL" \ | ||
136 | 132 | -DMYSQL_DATADIR="/usr/local/$PRODUCT_FULL/data" \ | ||
137 | 133 | -DMYSQL_SERVER_SUFFIX="-$PERCONA_SERVER_VERSION" \ | ||
138 | 134 | -DCOMPILATION_COMMENT="$COMMENT" | ||
139 | 135 | |||
140 | 136 | make $MAKE_JFLAG $QUIET | ||
141 | 137 | make DESTDIR="$INSTALLDIR" install | ||
142 | 138 | |||
143 | 139 | # Build UDF | ||
144 | 140 | ( | ||
145 | 141 | cd "UDF" | ||
146 | 142 | CXX=${UDF_CXX:-g++} ./configure --includedir="$SOURCEDIR/$PRODUCT/include" \ | ||
147 | 143 | --libdir="/usr/local/$PRODUCT_FULL/mysql/plugin" | ||
148 | 144 | make | ||
149 | 145 | make DESTDIR="$INSTALLDIR" install | ||
150 | 146 | |||
151 | 147 | ) | ||
152 | 148 | |||
153 | 149 | ) | ||
154 | 150 | |||
155 | 151 | # Package the archive | ||
156 | 152 | ( | ||
157 | 153 | cd "$INSTALLDIR/usr/local/" | ||
158 | 154 | |||
159 | 155 | $TAR czf "$WORKDIR_ABS/$PRODUCT_FULL.tar.gz" \ | ||
160 | 156 | --owner=0 --group=0 "$PRODUCT_FULL/" | ||
161 | 157 | |||
162 | 158 | ) | ||
163 | 159 | |||
164 | 160 | # Clean up | ||
165 | 161 | rm -rf "$INSTALLDIR" | ||
166 | 162 | |||
167 | 0 | 163 | ||
168 | === removed file 'build/build-binary.sh' | |||
169 | --- build/build-binary.sh 2013-02-19 08:20:59 +0000 | |||
170 | +++ build/build-binary.sh 1970-01-01 00:00:00 +0000 | |||
171 | @@ -1,162 +0,0 @@ | |||
172 | 1 | #!/bin/sh | ||
173 | 2 | # | ||
174 | 3 | # Execute this tool to setup the environment and build binary releases | ||
175 | 4 | # for Percona-Server starting from a fresh tree. | ||
176 | 5 | # | ||
177 | 6 | # Usage: build-binary.sh [target dir] | ||
178 | 7 | # The default target directory is the current directory. If it is not | ||
179 | 8 | # supplied and the current directory is not empty, it will issue an error in | ||
180 | 9 | # order to avoid polluting the current directory after a test run. | ||
181 | 10 | # | ||
182 | 11 | |||
183 | 12 | # Bail out on errors, be strict | ||
184 | 13 | set -ue | ||
185 | 14 | |||
186 | 15 | # Examine parameters | ||
187 | 16 | TARGET="$(uname -m)" | ||
188 | 17 | TARGET_CFLAGS='' | ||
189 | 18 | QUIET='VERBOSE=1' | ||
190 | 19 | |||
191 | 20 | # Some programs that may be overriden | ||
192 | 21 | TAR=${TAR:-tar} | ||
193 | 22 | |||
194 | 23 | # Check if we have a functional getopt(1) | ||
195 | 24 | if ! getopt --test | ||
196 | 25 | then | ||
197 | 26 | go_out="$(getopt --options="iqdv" --longoptions=i686,quiet,debug,valgrind \ | ||
198 | 27 | --name="$(basename "$0")" -- "$@")" | ||
199 | 28 | test $? -eq 0 || exit 1 | ||
200 | 29 | eval set -- $go_out | ||
201 | 30 | fi | ||
202 | 31 | |||
203 | 32 | for arg | ||
204 | 33 | do | ||
205 | 34 | case "$arg" in | ||
206 | 35 | -- ) shift; break;; | ||
207 | 36 | -i | --i686 ) | ||
208 | 37 | shift | ||
209 | 38 | TARGET="i686" | ||
210 | 39 | TARGET_CFLAGS="-m32 -march=i686" | ||
211 | 40 | ;; | ||
212 | 41 | -q | --quiet ) | ||
213 | 42 | shift | ||
214 | 43 | QUIET='' | ||
215 | 44 | ;; | ||
216 | 45 | -d | --debug ) | ||
217 | 46 | shift | ||
218 | 47 | BUILD_COMMENT="${BUILD_COMMENT:-}-debug" | ||
219 | 48 | CMAKE_BUILD_TYPE='Debug' | ||
220 | 49 | ;; | ||
221 | 50 | -v | --valgrind ) | ||
222 | 51 | shift | ||
223 | 52 | CMAKE_OPTS="${CMAKE_OPTS:-} -DWITH_VALGRIND=ON" | ||
224 | 53 | BUILD_COMMENT="${BUILD_COMMENT:-}-valgrind" | ||
225 | 54 | ;; | ||
226 | 55 | esac | ||
227 | 56 | done | ||
228 | 57 | |||
229 | 58 | # Working directory | ||
230 | 59 | if test "$#" -eq 0 | ||
231 | 60 | then | ||
232 | 61 | WORKDIR="$(pwd)" | ||
233 | 62 | |||
234 | 63 | # Check that the current directory is not empty | ||
235 | 64 | if test "x$(echo *)" != "x*" | ||
236 | 65 | then | ||
237 | 66 | echo >&2 \ | ||
238 | 67 | "Current directory is not empty. Use $0 . to force build in ." | ||
239 | 68 | exit 1 | ||
240 | 69 | fi | ||
241 | 70 | |||
242 | 71 | elif test "$#" -eq 1 | ||
243 | 72 | then | ||
244 | 73 | WORKDIR="$1" | ||
245 | 74 | |||
246 | 75 | # Check that the provided directory exists and is a directory | ||
247 | 76 | if ! test -d "$WORKDIR" | ||
248 | 77 | then | ||
249 | 78 | echo >&2 "$WORKDIR is not a directory" | ||
250 | 79 | exit 1 | ||
251 | 80 | fi | ||
252 | 81 | |||
253 | 82 | WORKDIR_ABS="$(cd "$WORKDIR"; pwd)" | ||
254 | 83 | |||
255 | 84 | else | ||
256 | 85 | echo >&2 "Usage: $0 [target dir]" | ||
257 | 86 | exit 1 | ||
258 | 87 | |||
259 | 88 | fi | ||
260 | 89 | |||
261 | 90 | SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)" | ||
262 | 91 | test -e "$SOURCEDIR/Makefile" || exit 2 | ||
263 | 92 | |||
264 | 93 | # Extract version from the Makefile | ||
265 | 94 | MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \ | ||
266 | 95 | | cut -d = -f 2)" | ||
267 | 96 | PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \ | ||
268 | 97 | "$SOURCEDIR/Makefile" | cut -d = -f 2)" | ||
269 | 98 | PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" | ||
270 | 99 | |||
271 | 100 | # Build information | ||
272 | 101 | REVISION="$(cd "$SOURCEDIR"; bzr revno)" | ||
273 | 102 | PRODUCT_FULL="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" | ||
274 | 103 | PRODUCT_FULL="$PRODUCT_FULL-$REVISION${BUILD_COMMENT:-}.$(uname -s).$TARGET" | ||
275 | 104 | COMMENT="Percona Server with XtraDB (GPL), Release $PERCONA_SERVER_VERSION" | ||
276 | 105 | COMMENT="$COMMENT, Revision $REVISION${BUILD_COMMENT:-}" | ||
277 | 106 | |||
278 | 107 | # Compilation flags | ||
279 | 108 | export CC=${CC:-gcc} | ||
280 | 109 | export CXX=${CXX:-g++} | ||
281 | 110 | export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CFLAGS:-}" | ||
282 | 111 | export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CXXFLAGS:-}" | ||
283 | 112 | export MAKE_JFLAG=-j4 | ||
284 | 113 | |||
285 | 114 | # Create a temporary working directory | ||
286 | 115 | INSTALLDIR="$(cd "$WORKDIR" && TMPDIR="$WORKDIR_ABS" mktemp -d percona-build.XXXXXX)" | ||
287 | 116 | INSTALLDIR="$WORKDIR_ABS/$INSTALLDIR" # Make it absolute | ||
288 | 117 | |||
289 | 118 | # Build | ||
290 | 119 | ( | ||
291 | 120 | cd "$SOURCEDIR" | ||
292 | 121 | |||
293 | 122 | # Execute clean and download mysql, apply patches | ||
294 | 123 | make clean all | ||
295 | 124 | |||
296 | 125 | cd "$PRODUCT" | ||
297 | 126 | cmake . ${CMAKE_OPTS:-} -DBUILD_CONFIG=mysql_release \ | ||
298 | 127 | -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-RelWithDebInfo} \ | ||
299 | 128 | -DWITH_EMBEDDED_SERVER=OFF \ | ||
300 | 129 | -DFEATURE_SET=community \ | ||
301 | 130 | -DENABLE_DTRACE=OFF \ | ||
302 | 131 | -DCMAKE_INSTALL_PREFIX="/usr/local/$PRODUCT_FULL" \ | ||
303 | 132 | -DMYSQL_DATADIR="/usr/local/$PRODUCT_FULL/data" \ | ||
304 | 133 | -DMYSQL_SERVER_SUFFIX="-$PERCONA_SERVER_VERSION" \ | ||
305 | 134 | -DCOMPILATION_COMMENT="$COMMENT" | ||
306 | 135 | |||
307 | 136 | make $MAKE_JFLAG $QUIET | ||
308 | 137 | make DESTDIR="$INSTALLDIR" install | ||
309 | 138 | |||
310 | 139 | # Build UDF | ||
311 | 140 | ( | ||
312 | 141 | cd "UDF" | ||
313 | 142 | CXX=${UDF_CXX:-g++} ./configure --includedir="$SOURCEDIR/$PRODUCT/include" \ | ||
314 | 143 | --libdir="/usr/local/$PRODUCT_FULL/mysql/plugin" | ||
315 | 144 | make | ||
316 | 145 | make DESTDIR="$INSTALLDIR" install | ||
317 | 146 | |||
318 | 147 | ) | ||
319 | 148 | |||
320 | 149 | ) | ||
321 | 150 | |||
322 | 151 | # Package the archive | ||
323 | 152 | ( | ||
324 | 153 | cd "$INSTALLDIR/usr/local/" | ||
325 | 154 | |||
326 | 155 | $TAR czf "$WORKDIR_ABS/$PRODUCT_FULL.tar.gz" \ | ||
327 | 156 | --owner=0 --group=0 "$PRODUCT_FULL/" | ||
328 | 157 | |||
329 | 158 | ) | ||
330 | 159 | |||
331 | 160 | # Clean up | ||
332 | 161 | rm -rf "$INSTALLDIR" | ||
333 | 162 | |||
334 | 163 | 0 | ||
335 | === added file 'build/build-dpkg.sh' | |||
336 | --- build/build-dpkg.sh 1970-01-01 00:00:00 +0000 | |||
337 | +++ build/build-dpkg.sh 2013-03-06 12:02:24 +0000 | |||
338 | @@ -0,0 +1,115 @@ | |||
339 | 1 | #!/bin/sh | ||
340 | 2 | # Usage: build-dpkg.sh [target dir] | ||
341 | 3 | # The default target directory is the current directory. If it is not | ||
342 | 4 | # supplied and the current directory is not empty, it will issue an error in | ||
343 | 5 | # order to avoid polluting the current directory after a test run. | ||
344 | 6 | # | ||
345 | 7 | # The program will setup the dpkg building environment and ultimately call | ||
346 | 8 | # dpkg-buildpackage with the appropiate parameters. | ||
347 | 9 | # | ||
348 | 10 | |||
349 | 11 | # Bail out on errors, be strict | ||
350 | 12 | set -ue | ||
351 | 13 | |||
352 | 14 | # Examine parameters | ||
353 | 15 | go_out="$(getopt --options "kK:bH" --longoptions key:,nosign,binary \ | ||
354 | 16 | --name "$(basename "$0")" -- "$@")" | ||
355 | 17 | test $? -eq 0 || exit 1 | ||
356 | 18 | eval set -- $go_out | ||
357 | 19 | |||
358 | 20 | BUILDPKG_KEY='' | ||
359 | 21 | BINARY='' | ||
360 | 22 | |||
361 | 23 | for arg | ||
362 | 24 | do | ||
363 | 25 | case "$arg" in | ||
364 | 26 | -- ) shift; break;; | ||
365 | 27 | -k | --key ) shift; BUILDPKG_KEY="-pgpg -k$1"; shift;; | ||
366 | 28 | -K | --nosign ) shift; BUILDPKG_KEY="-uc -us";; | ||
367 | 29 | -b | --binary ) shift; BINARY='-b';; | ||
368 | 30 | esac | ||
369 | 31 | done | ||
370 | 32 | |||
371 | 33 | # Working directory | ||
372 | 34 | if test "$#" -eq 0 | ||
373 | 35 | then | ||
374 | 36 | WORKDIR="$(pwd)" | ||
375 | 37 | |||
376 | 38 | # Check that the current directory is not empty | ||
377 | 39 | if test "x$(echo *)" != "x*" | ||
378 | 40 | then | ||
379 | 41 | echo >&2 \ | ||
380 | 42 | "Current directory is not empty. Use $0 . to force build in ." | ||
381 | 43 | exit 1 | ||
382 | 44 | fi | ||
383 | 45 | |||
384 | 46 | elif test "$#" -eq 1 | ||
385 | 47 | then | ||
386 | 48 | WORKDIR="$1" | ||
387 | 49 | |||
388 | 50 | # Check that the provided directory exists and is a directory | ||
389 | 51 | if ! test -d "$WORKDIR" | ||
390 | 52 | then | ||
391 | 53 | echo >&2 "$WORKDIR is not a directory" | ||
392 | 54 | exit 1 | ||
393 | 55 | fi | ||
394 | 56 | |||
395 | 57 | else | ||
396 | 58 | echo >&2 "Usage: $0 [target dir]" | ||
397 | 59 | exit 1 | ||
398 | 60 | |||
399 | 61 | fi | ||
400 | 62 | |||
401 | 63 | SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)" | ||
402 | 64 | test -e "$SOURCEDIR/Makefile" || exit 2 | ||
403 | 65 | |||
404 | 66 | # Extract version from the Makefile | ||
405 | 67 | MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \ | ||
406 | 68 | | cut -d = -f 2)" | ||
407 | 69 | PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= "$SOURCEDIR/Makefile" | cut -d = -f 2)" | ||
408 | 70 | PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" | ||
409 | 71 | DEBIAN_VERSION="$(lsb_release -sc)" | ||
410 | 72 | |||
411 | 73 | |||
412 | 74 | # Build information | ||
413 | 75 | export BB_PERCONA_REVISION="$(cd "$SOURCEDIR"; bzr revno)" | ||
414 | 76 | export DEB_BUILD_OPTIONS='nostrip debug nocheck' | ||
415 | 77 | |||
416 | 78 | # Compilation flags | ||
417 | 79 | export CC=${CC:-gcc} | ||
418 | 80 | export CXX=${CXX:-g++} | ||
419 | 81 | export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION ${CFLAGS:-}" | ||
420 | 82 | export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION ${CXXFLAGS:-}" | ||
421 | 83 | export MAKE_JFLAG=-j4 | ||
422 | 84 | |||
423 | 85 | # Prepare sources | ||
424 | 86 | ( | ||
425 | 87 | cd "$SOURCEDIR" | ||
426 | 88 | make clean all | ||
427 | 89 | ) | ||
428 | 90 | |||
429 | 91 | # Build | ||
430 | 92 | ( | ||
431 | 93 | # Make a copy in workdir and copy debian files | ||
432 | 94 | cd "$WORKDIR" | ||
433 | 95 | |||
434 | 96 | rm -rf "$PRODUCT/" | ||
435 | 97 | cp -a "$SOURCEDIR/$PRODUCT/" . | ||
436 | 98 | ( | ||
437 | 99 | cd "$PRODUCT/" | ||
438 | 100 | |||
439 | 101 | # Copy debian files from source | ||
440 | 102 | cp -R "$SOURCEDIR/build/debian" . | ||
441 | 103 | chmod +x debian/rules | ||
442 | 104 | |||
443 | 105 | # Update distribution name | ||
444 | 106 | dch -m -D "$DEBIAN_VERSION" --force-distribution -v "$MYSQL_VERSION-$PERCONA_SERVER_VERSION-$BB_PERCONA_REVISION.$DEBIAN_VERSION" 'Update distribution' | ||
445 | 107 | |||
446 | 108 | DEB_CFLAGS_APPEND="$CFLAGS" DEB_CXXFLAGS_APPEND="$CXXFLAGS" \ | ||
447 | 109 | dpkg-buildpackage $BINARY -rfakeroot $BUILDPKG_KEY | ||
448 | 110 | |||
449 | 111 | ) | ||
450 | 112 | |||
451 | 113 | rm -rf "$PRODUCT" | ||
452 | 114 | |||
453 | 115 | ) | ||
454 | 0 | 116 | ||
455 | === removed file 'build/build-dpkg.sh' | |||
456 | --- build/build-dpkg.sh 2012-08-21 07:35:48 +0000 | |||
457 | +++ build/build-dpkg.sh 1970-01-01 00:00:00 +0000 | |||
458 | @@ -1,115 +0,0 @@ | |||
459 | 1 | #!/bin/sh | ||
460 | 2 | # Usage: build-dpkg.sh [target dir] | ||
461 | 3 | # The default target directory is the current directory. If it is not | ||
462 | 4 | # supplied and the current directory is not empty, it will issue an error in | ||
463 | 5 | # order to avoid polluting the current directory after a test run. | ||
464 | 6 | # | ||
465 | 7 | # The program will setup the dpkg building environment and ultimately call | ||
466 | 8 | # dpkg-buildpackage with the appropiate parameters. | ||
467 | 9 | # | ||
468 | 10 | |||
469 | 11 | # Bail out on errors, be strict | ||
470 | 12 | set -ue | ||
471 | 13 | |||
472 | 14 | # Examine parameters | ||
473 | 15 | go_out="$(getopt --options "kK:bH" --longoptions key:,nosign,binary \ | ||
474 | 16 | --name "$(basename "$0")" -- "$@")" | ||
475 | 17 | test $? -eq 0 || exit 1 | ||
476 | 18 | eval set -- $go_out | ||
477 | 19 | |||
478 | 20 | BUILDPKG_KEY='' | ||
479 | 21 | BINARY='' | ||
480 | 22 | |||
481 | 23 | for arg | ||
482 | 24 | do | ||
483 | 25 | case "$arg" in | ||
484 | 26 | -- ) shift; break;; | ||
485 | 27 | -k | --key ) shift; BUILDPKG_KEY="-pgpg -k$1"; shift;; | ||
486 | 28 | -K | --nosign ) shift; BUILDPKG_KEY="-uc -us";; | ||
487 | 29 | -b | --binary ) shift; BINARY='-b';; | ||
488 | 30 | esac | ||
489 | 31 | done | ||
490 | 32 | |||
491 | 33 | # Working directory | ||
492 | 34 | if test "$#" -eq 0 | ||
493 | 35 | then | ||
494 | 36 | WORKDIR="$(pwd)" | ||
495 | 37 | |||
496 | 38 | # Check that the current directory is not empty | ||
497 | 39 | if test "x$(echo *)" != "x*" | ||
498 | 40 | then | ||
499 | 41 | echo >&2 \ | ||
500 | 42 | "Current directory is not empty. Use $0 . to force build in ." | ||
501 | 43 | exit 1 | ||
502 | 44 | fi | ||
503 | 45 | |||
504 | 46 | elif test "$#" -eq 1 | ||
505 | 47 | then | ||
506 | 48 | WORKDIR="$1" | ||
507 | 49 | |||
508 | 50 | # Check that the provided directory exists and is a directory | ||
509 | 51 | if ! test -d "$WORKDIR" | ||
510 | 52 | then | ||
511 | 53 | echo >&2 "$WORKDIR is not a directory" | ||
512 | 54 | exit 1 | ||
513 | 55 | fi | ||
514 | 56 | |||
515 | 57 | else | ||
516 | 58 | echo >&2 "Usage: $0 [target dir]" | ||
517 | 59 | exit 1 | ||
518 | 60 | |||
519 | 61 | fi | ||
520 | 62 | |||
521 | 63 | SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)" | ||
522 | 64 | test -e "$SOURCEDIR/Makefile" || exit 2 | ||
523 | 65 | |||
524 | 66 | # Extract version from the Makefile | ||
525 | 67 | MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \ | ||
526 | 68 | | cut -d = -f 2)" | ||
527 | 69 | PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= "$SOURCEDIR/Makefile" | cut -d = -f 2)" | ||
528 | 70 | PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" | ||
529 | 71 | DEBIAN_VERSION="$(lsb_release -sc)" | ||
530 | 72 | |||
531 | 73 | |||
532 | 74 | # Build information | ||
533 | 75 | export BB_PERCONA_REVISION="$(cd "$SOURCEDIR"; bzr revno)" | ||
534 | 76 | export DEB_BUILD_OPTIONS='nostrip debug nocheck' | ||
535 | 77 | |||
536 | 78 | # Compilation flags | ||
537 | 79 | export CC=${CC:-gcc} | ||
538 | 80 | export CXX=${CXX:-g++} | ||
539 | 81 | export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION ${CFLAGS:-}" | ||
540 | 82 | export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION ${CXXFLAGS:-}" | ||
541 | 83 | export MAKE_JFLAG=-j4 | ||
542 | 84 | |||
543 | 85 | # Prepare sources | ||
544 | 86 | ( | ||
545 | 87 | cd "$SOURCEDIR" | ||
546 | 88 | make clean all | ||
547 | 89 | ) | ||
548 | 90 | |||
549 | 91 | # Build | ||
550 | 92 | ( | ||
551 | 93 | # Make a copy in workdir and copy debian files | ||
552 | 94 | cd "$WORKDIR" | ||
553 | 95 | |||
554 | 96 | rm -rf "$PRODUCT/" | ||
555 | 97 | cp -a "$SOURCEDIR/$PRODUCT/" . | ||
556 | 98 | ( | ||
557 | 99 | cd "$PRODUCT/" | ||
558 | 100 | |||
559 | 101 | # Copy debian files from source | ||
560 | 102 | cp -R "$SOURCEDIR/build/debian" . | ||
561 | 103 | chmod +x debian/rules | ||
562 | 104 | |||
563 | 105 | # Update distribution name | ||
564 | 106 | dch -m -D "$DEBIAN_VERSION" --force-distribution -v "$MYSQL_VERSION-$PERCONA_SERVER_VERSION-$BB_PERCONA_REVISION.$DEBIAN_VERSION" 'Update distribution' | ||
565 | 107 | |||
566 | 108 | DEB_CFLAGS_APPEND="$CFLAGS" DEB_CXXFLAGS_APPEND="$CXXFLAGS" \ | ||
567 | 109 | dpkg-buildpackage $BINARY -rfakeroot $BUILDPKG_KEY | ||
568 | 110 | |||
569 | 111 | ) | ||
570 | 112 | |||
571 | 113 | rm -rf "$PRODUCT" | ||
572 | 114 | |||
573 | 115 | ) | ||
574 | 116 | 0 | ||
575 | === added file 'build/build-rpm.sh' | |||
576 | --- build/build-rpm.sh 1970-01-01 00:00:00 +0000 | |||
577 | +++ build/build-rpm.sh 2013-03-06 12:02:24 +0000 | |||
578 | @@ -0,0 +1,154 @@ | |||
579 | 1 | #!/bin/sh | ||
580 | 2 | # | ||
581 | 3 | # Execute this tool to setup and build RPMs for Percona-Server starting | ||
582 | 4 | # from a fresh tree | ||
583 | 5 | # | ||
584 | 6 | # Usage: build-rpm.sh [target dir] | ||
585 | 7 | # The default target directory is the current directory. If it is not | ||
586 | 8 | # supplied and the current directory is not empty, it will issue an error in | ||
587 | 9 | # order to avoid polluting the current directory after a test run. | ||
588 | 10 | # | ||
589 | 11 | # The program will setup the rpm building environment and ultimately call | ||
590 | 12 | # rpmbuild with the appropiate parameters. | ||
591 | 13 | # | ||
592 | 14 | |||
593 | 15 | # Bail out on errors, be strict | ||
594 | 16 | set -ue | ||
595 | 17 | |||
596 | 18 | # Examine parameters | ||
597 | 19 | TARGET='' | ||
598 | 20 | TARGET_CFLAGS='' | ||
599 | 21 | SIGN='--sign' # We sign by default | ||
600 | 22 | QUIET='' | ||
601 | 23 | |||
602 | 24 | # Check if we have a functional getopt(1) | ||
603 | 25 | if ! getopt --test | ||
604 | 26 | then | ||
605 | 27 | go_out="$(getopt --options="iKqH" --longoptions=i686,nosign,quiet \ | ||
606 | 28 | --name="$(basename "$0")" -- "$@")" | ||
607 | 29 | test $? -eq 0 || exit 1 | ||
608 | 30 | eval set -- $go_out | ||
609 | 31 | fi | ||
610 | 32 | |||
611 | 33 | for arg | ||
612 | 34 | do | ||
613 | 35 | case "$arg" in | ||
614 | 36 | -- ) shift; break;; | ||
615 | 37 | -i | --i686 ) | ||
616 | 38 | shift | ||
617 | 39 | TARGET="--target i686" | ||
618 | 40 | TARGET_CFLAGS="-m32 -march=i686" | ||
619 | 41 | ;; | ||
620 | 42 | -K | --nosign ) | ||
621 | 43 | shift | ||
622 | 44 | SIGN='' | ||
623 | 45 | ;; | ||
624 | 46 | -q | --quiet ) | ||
625 | 47 | shift | ||
626 | 48 | QUIET='--quiet' | ||
627 | 49 | ;; | ||
628 | 50 | esac | ||
629 | 51 | done | ||
630 | 52 | |||
631 | 53 | # Working directory | ||
632 | 54 | if test "$#" -eq 0 | ||
633 | 55 | then | ||
634 | 56 | WORKDIR="$(pwd)" | ||
635 | 57 | |||
636 | 58 | # Check that the current directory is not empty | ||
637 | 59 | if test "x$(echo *)" != "x*" | ||
638 | 60 | then | ||
639 | 61 | echo >&2 \ | ||
640 | 62 | "Current directory is not empty. Use $0 . to force build in ." | ||
641 | 63 | exit 1 | ||
642 | 64 | fi | ||
643 | 65 | |||
644 | 66 | WORKDIR_ABS="$(cd "$WORKDIR"; pwd)" | ||
645 | 67 | |||
646 | 68 | elif test "$#" -eq 1 | ||
647 | 69 | then | ||
648 | 70 | WORKDIR="$1" | ||
649 | 71 | |||
650 | 72 | # Check that the provided directory exists and is a directory | ||
651 | 73 | if ! test -d "$WORKDIR" | ||
652 | 74 | then | ||
653 | 75 | echo >&2 "$WORKDIR is not a directory" | ||
654 | 76 | exit 1 | ||
655 | 77 | fi | ||
656 | 78 | |||
657 | 79 | WORKDIR_ABS="$(cd "$WORKDIR"; pwd)" | ||
658 | 80 | |||
659 | 81 | else | ||
660 | 82 | echo >&2 "Usage: $0 [target dir]" | ||
661 | 83 | exit 1 | ||
662 | 84 | |||
663 | 85 | fi | ||
664 | 86 | |||
665 | 87 | # If we're in 32 bits, ensure that we're compiling for i686. | ||
666 | 88 | if test "x$TARGET" == "x" | ||
667 | 89 | then | ||
668 | 90 | if test "x$(uname -m)" != "xx86_64" | ||
669 | 91 | then | ||
670 | 92 | TARGET='--target i686' | ||
671 | 93 | TARGET_CFLAGS='-m32 -march=i686' | ||
672 | 94 | fi | ||
673 | 95 | |||
674 | 96 | fi | ||
675 | 97 | |||
676 | 98 | SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)" | ||
677 | 99 | test -e "$SOURCEDIR/Makefile" || exit 2 | ||
678 | 100 | |||
679 | 101 | # Extract version from the Makefile | ||
680 | 102 | MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \ | ||
681 | 103 | | cut -d = -f 2)" | ||
682 | 104 | PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \ | ||
683 | 105 | "$SOURCEDIR/Makefile" | cut -d = -f 2)" | ||
684 | 106 | PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" | ||
685 | 107 | |||
686 | 108 | # Build information | ||
687 | 109 | REDHAT_RELEASE="$(grep -o 'release [0-9][0-9]*' /etc/redhat-release | \ | ||
688 | 110 | cut -d ' ' -f 2)" | ||
689 | 111 | REVISION="$(cd "$SOURCEDIR"; bzr revno)" | ||
690 | 112 | |||
691 | 113 | # Compilation flags | ||
692 | 114 | export CC="${CC:-gcc}" | ||
693 | 115 | export CXX="${CXX:-g++}" | ||
694 | 116 | export HS_CXX="${HS_CXX:-g++}" | ||
695 | 117 | export UDF_CXX="${UDF_CXX:-g++}" | ||
696 | 118 | export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CFLAGS:-}" | ||
697 | 119 | export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CXXFLAGS:-}" | ||
698 | 120 | export MAKE_JFLAG=-j4 | ||
699 | 121 | |||
700 | 122 | # Create directories for rpmbuild if these don't exist | ||
701 | 123 | (cd "$WORKDIR" && mkdir -p BUILD RPMS SOURCES SPECS SRPMS) | ||
702 | 124 | |||
703 | 125 | ( | ||
704 | 126 | cd "$SOURCEDIR" | ||
705 | 127 | |||
706 | 128 | # Execute clean and download mysql, apply patches | ||
707 | 129 | make clean all | ||
708 | 130 | |||
709 | 131 | # "Fix" cmake destdirs, since we cannot alter SYSTEM_PROCESSOR | ||
710 | 132 | if test "x$TARGET" != "x" | ||
711 | 133 | then | ||
712 | 134 | sed -i 's/lib64/lib/' "$PRODUCT/cmake/install_layout.cmake" | ||
713 | 135 | fi | ||
714 | 136 | |||
715 | 137 | # Create tarball for build | ||
716 | 138 | tar czf "$WORKDIR_ABS/SOURCES/$PRODUCT.tar.gz" "$PRODUCT/"* | ||
717 | 139 | |||
718 | 140 | ) | ||
719 | 141 | |||
720 | 142 | # Issue rpmbuild command | ||
721 | 143 | ( | ||
722 | 144 | cd "$WORKDIR" | ||
723 | 145 | |||
724 | 146 | # Issue RPM command | ||
725 | 147 | rpmbuild -ba --clean --with yassl $TARGET $SIGN $QUIET \ | ||
726 | 148 | "$SOURCEDIR/build/percona-server.spec" \ | ||
727 | 149 | --define "_topdir $WORKDIR_ABS" \ | ||
728 | 150 | --define "redhat_version $REDHAT_RELEASE" \ | ||
729 | 151 | --define "gotrevision $REVISION" | ||
730 | 152 | |||
731 | 153 | ) | ||
732 | 154 | |||
733 | 0 | 155 | ||
734 | === removed file 'build/build-rpm.sh' | |||
735 | --- build/build-rpm.sh 2012-08-21 07:35:48 +0000 | |||
736 | +++ build/build-rpm.sh 1970-01-01 00:00:00 +0000 | |||
737 | @@ -1,154 +0,0 @@ | |||
738 | 1 | #!/bin/sh | ||
739 | 2 | # | ||
740 | 3 | # Execute this tool to setup and build RPMs for Percona-Server starting | ||
741 | 4 | # from a fresh tree | ||
742 | 5 | # | ||
743 | 6 | # Usage: build-rpm.sh [target dir] | ||
744 | 7 | # The default target directory is the current directory. If it is not | ||
745 | 8 | # supplied and the current directory is not empty, it will issue an error in | ||
746 | 9 | # order to avoid polluting the current directory after a test run. | ||
747 | 10 | # | ||
748 | 11 | # The program will setup the rpm building environment and ultimately call | ||
749 | 12 | # rpmbuild with the appropiate parameters. | ||
750 | 13 | # | ||
751 | 14 | |||
752 | 15 | # Bail out on errors, be strict | ||
753 | 16 | set -ue | ||
754 | 17 | |||
755 | 18 | # Examine parameters | ||
756 | 19 | TARGET='' | ||
757 | 20 | TARGET_CFLAGS='' | ||
758 | 21 | SIGN='--sign' # We sign by default | ||
759 | 22 | QUIET='' | ||
760 | 23 | |||
761 | 24 | # Check if we have a functional getopt(1) | ||
762 | 25 | if ! getopt --test | ||
763 | 26 | then | ||
764 | 27 | go_out="$(getopt --options="iKqH" --longoptions=i686,nosign,quiet \ | ||
765 | 28 | --name="$(basename "$0")" -- "$@")" | ||
766 | 29 | test $? -eq 0 || exit 1 | ||
767 | 30 | eval set -- $go_out | ||
768 | 31 | fi | ||
769 | 32 | |||
770 | 33 | for arg | ||
771 | 34 | do | ||
772 | 35 | case "$arg" in | ||
773 | 36 | -- ) shift; break;; | ||
774 | 37 | -i | --i686 ) | ||
775 | 38 | shift | ||
776 | 39 | TARGET="--target i686" | ||
777 | 40 | TARGET_CFLAGS="-m32 -march=i686" | ||
778 | 41 | ;; | ||
779 | 42 | -K | --nosign ) | ||
780 | 43 | shift | ||
781 | 44 | SIGN='' | ||
782 | 45 | ;; | ||
783 | 46 | -q | --quiet ) | ||
784 | 47 | shift | ||
785 | 48 | QUIET='--quiet' | ||
786 | 49 | ;; | ||
787 | 50 | esac | ||
788 | 51 | done | ||
789 | 52 | |||
790 | 53 | # Working directory | ||
791 | 54 | if test "$#" -eq 0 | ||
792 | 55 | then | ||
793 | 56 | WORKDIR="$(pwd)" | ||
794 | 57 | |||
795 | 58 | # Check that the current directory is not empty | ||
796 | 59 | if test "x$(echo *)" != "x*" | ||
797 | 60 | then | ||
798 | 61 | echo >&2 \ | ||
799 | 62 | "Current directory is not empty. Use $0 . to force build in ." | ||
800 | 63 | exit 1 | ||
801 | 64 | fi | ||
802 | 65 | |||
803 | 66 | WORKDIR_ABS="$(cd "$WORKDIR"; pwd)" | ||
804 | 67 | |||
805 | 68 | elif test "$#" -eq 1 | ||
806 | 69 | then | ||
807 | 70 | WORKDIR="$1" | ||
808 | 71 | |||
809 | 72 | # Check that the provided directory exists and is a directory | ||
810 | 73 | if ! test -d "$WORKDIR" | ||
811 | 74 | then | ||
812 | 75 | echo >&2 "$WORKDIR is not a directory" | ||
813 | 76 | exit 1 | ||
814 | 77 | fi | ||
815 | 78 | |||
816 | 79 | WORKDIR_ABS="$(cd "$WORKDIR"; pwd)" | ||
817 | 80 | |||
818 | 81 | else | ||
819 | 82 | echo >&2 "Usage: $0 [target dir]" | ||
820 | 83 | exit 1 | ||
821 | 84 | |||
822 | 85 | fi | ||
823 | 86 | |||
824 | 87 | # If we're in 32 bits, ensure that we're compiling for i686. | ||
825 | 88 | if test "x$TARGET" == "x" | ||
826 | 89 | then | ||
827 | 90 | if test "x$(uname -m)" != "xx86_64" | ||
828 | 91 | then | ||
829 | 92 | TARGET='--target i686' | ||
830 | 93 | TARGET_CFLAGS='-m32 -march=i686' | ||
831 | 94 | fi | ||
832 | 95 | |||
833 | 96 | fi | ||
834 | 97 | |||
835 | 98 | SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)" | ||
836 | 99 | test -e "$SOURCEDIR/Makefile" || exit 2 | ||
837 | 100 | |||
838 | 101 | # Extract version from the Makefile | ||
839 | 102 | MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \ | ||
840 | 103 | | cut -d = -f 2)" | ||
841 | 104 | PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \ | ||
842 | 105 | "$SOURCEDIR/Makefile" | cut -d = -f 2)" | ||
843 | 106 | PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" | ||
844 | 107 | |||
845 | 108 | # Build information | ||
846 | 109 | REDHAT_RELEASE="$(grep -o 'release [0-9][0-9]*' /etc/redhat-release | \ | ||
847 | 110 | cut -d ' ' -f 2)" | ||
848 | 111 | REVISION="$(cd "$SOURCEDIR"; bzr revno)" | ||
849 | 112 | |||
850 | 113 | # Compilation flags | ||
851 | 114 | export CC="${CC:-gcc}" | ||
852 | 115 | export CXX="${CXX:-g++}" | ||
853 | 116 | export HS_CXX="${HS_CXX:-g++}" | ||
854 | 117 | export UDF_CXX="${UDF_CXX:-g++}" | ||
855 | 118 | export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CFLAGS:-}" | ||
856 | 119 | export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CXXFLAGS:-}" | ||
857 | 120 | export MAKE_JFLAG=-j4 | ||
858 | 121 | |||
859 | 122 | # Create directories for rpmbuild if these don't exist | ||
860 | 123 | (cd "$WORKDIR" && mkdir -p BUILD RPMS SOURCES SPECS SRPMS) | ||
861 | 124 | |||
862 | 125 | ( | ||
863 | 126 | cd "$SOURCEDIR" | ||
864 | 127 | |||
865 | 128 | # Execute clean and download mysql, apply patches | ||
866 | 129 | make clean all | ||
867 | 130 | |||
868 | 131 | # "Fix" cmake destdirs, since we cannot alter SYSTEM_PROCESSOR | ||
869 | 132 | if test "x$TARGET" != "x" | ||
870 | 133 | then | ||
871 | 134 | sed -i 's/lib64/lib/' "$PRODUCT/cmake/install_layout.cmake" | ||
872 | 135 | fi | ||
873 | 136 | |||
874 | 137 | # Create tarball for build | ||
875 | 138 | tar czf "$WORKDIR_ABS/SOURCES/$PRODUCT.tar.gz" "$PRODUCT/"* | ||
876 | 139 | |||
877 | 140 | ) | ||
878 | 141 | |||
879 | 142 | # Issue rpmbuild command | ||
880 | 143 | ( | ||
881 | 144 | cd "$WORKDIR" | ||
882 | 145 | |||
883 | 146 | # Issue RPM command | ||
884 | 147 | rpmbuild -ba --clean --with yassl $TARGET $SIGN $QUIET \ | ||
885 | 148 | "$SOURCEDIR/build/percona-server.spec" \ | ||
886 | 149 | --define "_topdir $WORKDIR_ABS" \ | ||
887 | 150 | --define "redhat_version $REDHAT_RELEASE" \ | ||
888 | 151 | --define "gotrevision $REVISION" | ||
889 | 152 | |||
890 | 153 | ) | ||
891 | 154 | |||
892 | 155 | 0 | ||
893 | === added file 'build/build-shared-compat-rpm.sh' | |||
894 | --- build/build-shared-compat-rpm.sh 1970-01-01 00:00:00 +0000 | |||
895 | +++ build/build-shared-compat-rpm.sh 2013-03-06 12:02:24 +0000 | |||
896 | @@ -0,0 +1,152 @@ | |||
897 | 1 | #!/bin/sh | ||
898 | 2 | # | ||
899 | 3 | # Execute this tool to setup and build the shared-compat RPM starting | ||
900 | 4 | # from a fresh tree | ||
901 | 5 | # | ||
902 | 6 | # Usage: build-shared-compat-rpm.sh [target dir] | ||
903 | 7 | # The default target directory is the current directory. If it is not | ||
904 | 8 | # supplied and the current directory is not empty, it will issue an error in | ||
905 | 9 | # order to avoid polluting the current directory after a test run. | ||
906 | 10 | # | ||
907 | 11 | # The program will setup the rpm building environment, download the sources | ||
908 | 12 | # and ultimately call rpmbuild with the appropiate parameters. | ||
909 | 13 | # | ||
910 | 14 | |||
911 | 15 | # Bail out on errors, be strict | ||
912 | 16 | set -ue | ||
913 | 17 | |||
914 | 18 | # Examine parameters | ||
915 | 19 | TARGET='' | ||
916 | 20 | TARGET_ARG='' | ||
917 | 21 | TARGET_CFLAGS='' | ||
918 | 22 | SIGN='--sign' | ||
919 | 23 | |||
920 | 24 | # Check if we have a functional getopt(1) | ||
921 | 25 | if ! getopt --test | ||
922 | 26 | then | ||
923 | 27 | go_out="$(getopt --options="iK" --longoptions=i686,nosign \ | ||
924 | 28 | --name="$(basename "$0")" -- "$@")" | ||
925 | 29 | test $? -eq 0 || exit 1 | ||
926 | 30 | eval set -- $go_out | ||
927 | 31 | fi | ||
928 | 32 | |||
929 | 33 | for arg | ||
930 | 34 | do | ||
931 | 35 | case "$arg" in | ||
932 | 36 | -- ) shift; break;; | ||
933 | 37 | -i | --i686 ) | ||
934 | 38 | shift | ||
935 | 39 | TARGET='i686' | ||
936 | 40 | TARGET_ARG="--target i686" | ||
937 | 41 | TARGET_CFLAGS="-m32 -march=i686" | ||
938 | 42 | ;; | ||
939 | 43 | -K | --nosign ) | ||
940 | 44 | shift | ||
941 | 45 | SIGN='' | ||
942 | 46 | ;; | ||
943 | 47 | esac | ||
944 | 48 | done | ||
945 | 49 | |||
946 | 50 | # Working directory | ||
947 | 51 | if test "$#" -eq 0 | ||
948 | 52 | then | ||
949 | 53 | WORKDIR="$(pwd)" | ||
950 | 54 | |||
951 | 55 | # Check that the current directory is not empty | ||
952 | 56 | if test "x$(echo *)" != "x*" | ||
953 | 57 | then | ||
954 | 58 | echo >&2 \ | ||
955 | 59 | "Current directory is not empty. Use $0 . to force build in ." | ||
956 | 60 | exit 1 | ||
957 | 61 | fi | ||
958 | 62 | |||
959 | 63 | elif test "$#" -eq 1 | ||
960 | 64 | then | ||
961 | 65 | WORKDIR="$1" | ||
962 | 66 | |||
963 | 67 | # Check that the provided directory exists and is a directory | ||
964 | 68 | if ! test -d "$WORKDIR" | ||
965 | 69 | then | ||
966 | 70 | echo >&2 "$WORKDIR is not a directory" | ||
967 | 71 | exit 1 | ||
968 | 72 | fi | ||
969 | 73 | |||
970 | 74 | else | ||
971 | 75 | echo >&2 "Usage: $0 [target dir]" | ||
972 | 76 | exit 1 | ||
973 | 77 | |||
974 | 78 | fi | ||
975 | 79 | |||
976 | 80 | WORKDIR_ABS="$(cd "$WORKDIR"; pwd)" | ||
977 | 81 | |||
978 | 82 | # If we're in 32 bits, ensure that we're compiling for i686. | ||
979 | 83 | if test "x$TARGET" == "x" | ||
980 | 84 | then | ||
981 | 85 | if test "x$(uname -m)" != "xx86_64" | ||
982 | 86 | then | ||
983 | 87 | TARGET='i686' | ||
984 | 88 | TARGET_ARG="--target i686" | ||
985 | 89 | TARGET_CFLAGS='-m32 -march=i686' | ||
986 | 90 | fi | ||
987 | 91 | |||
988 | 92 | fi | ||
989 | 93 | |||
990 | 94 | SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)" | ||
991 | 95 | test -e "$SOURCEDIR/Makefile" || exit 2 | ||
992 | 96 | |||
993 | 97 | # Extract version from the Makefile | ||
994 | 98 | MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \ | ||
995 | 99 | | cut -d = -f 2)" | ||
996 | 100 | PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \ | ||
997 | 101 | "$SOURCEDIR/Makefile" | cut -d = -f 2)" | ||
998 | 102 | PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" | ||
999 | 103 | |||
1000 | 104 | # Build information | ||
1001 | 105 | REDHAT_RELEASE="$(grep -o 'release [0-9][0-9]*' /etc/redhat-release | \ | ||
1002 | 106 | cut -d ' ' -f 2)" | ||
1003 | 107 | REVISION="$(cd "$SOURCEDIR"; bzr log -r-1 | grep ^revno: | cut -d ' ' -f 2)" | ||
1004 | 108 | |||
1005 | 109 | # Compilation flags | ||
1006 | 110 | export CC=gcc | ||
1007 | 111 | export CXX=gcc | ||
1008 | 112 | export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer $TARGET_CFLAGS" | ||
1009 | 113 | export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions $TARGET_CFLAGS" | ||
1010 | 114 | export MAKE_JFLAG=-j4 | ||
1011 | 115 | |||
1012 | 116 | # Create directories for rpmbuild if these don't exist | ||
1013 | 117 | (cd "$WORKDIR" && mkdir -p BUILD RPMS SOURCES SPECS SRPMS) | ||
1014 | 118 | |||
1015 | 119 | # Prepare sources | ||
1016 | 120 | ( | ||
1017 | 121 | cd "$WORKDIR/SOURCES/" | ||
1018 | 122 | |||
1019 | 123 | # Download the sources from the community site | ||
1020 | 124 | if test "x$TARGET" = "xi686" | ||
1021 | 125 | then | ||
1022 | 126 | RPMVER=i386 | ||
1023 | 127 | elif test "x$(uname -m)" = "xx86_64" | ||
1024 | 128 | then | ||
1025 | 129 | RPMVER=x86_64 | ||
1026 | 130 | else | ||
1027 | 131 | RPMVER=i386 | ||
1028 | 132 | fi | ||
1029 | 133 | |||
1030 | 134 | wget "http://www.percona.com/downloads/community/shared-compat/MySQL-shared-compat-$MYSQL_VERSION-1.linux2.6.$RPMVER.rpm" | ||
1031 | 135 | |||
1032 | 136 | ) | ||
1033 | 137 | |||
1034 | 138 | # Issue rpmbuild command | ||
1035 | 139 | ( | ||
1036 | 140 | cd "$WORKDIR" | ||
1037 | 141 | |||
1038 | 142 | # Issue RPM command | ||
1039 | 143 | rpmbuild -ba --clean --with yassl $SIGN \ | ||
1040 | 144 | "$SOURCEDIR/build/percona-shared-compat.spec" \ | ||
1041 | 145 | --define "_topdir $WORKDIR_ABS" \ | ||
1042 | 146 | --define "redhat_version $REDHAT_RELEASE" \ | ||
1043 | 147 | --define "gotrevision $REVISION" \ | ||
1044 | 148 | --define "release $PERCONA_SERVER_VERSION" \ | ||
1045 | 149 | $TARGET_ARG | ||
1046 | 150 | |||
1047 | 151 | ) | ||
1048 | 152 | |||
1049 | 0 | 153 | ||
1050 | === removed file 'build/build-shared-compat-rpm.sh' | |||
1051 | --- build/build-shared-compat-rpm.sh 2012-02-06 18:37:22 +0000 | |||
1052 | +++ build/build-shared-compat-rpm.sh 1970-01-01 00:00:00 +0000 | |||
1053 | @@ -1,152 +0,0 @@ | |||
1054 | 1 | #!/bin/sh | ||
1055 | 2 | # | ||
1056 | 3 | # Execute this tool to setup and build the shared-compat RPM starting | ||
1057 | 4 | # from a fresh tree | ||
1058 | 5 | # | ||
1059 | 6 | # Usage: build-shared-compat-rpm.sh [target dir] | ||
1060 | 7 | # The default target directory is the current directory. If it is not | ||
1061 | 8 | # supplied and the current directory is not empty, it will issue an error in | ||
1062 | 9 | # order to avoid polluting the current directory after a test run. | ||
1063 | 10 | # | ||
1064 | 11 | # The program will setup the rpm building environment, download the sources | ||
1065 | 12 | # and ultimately call rpmbuild with the appropiate parameters. | ||
1066 | 13 | # | ||
1067 | 14 | |||
1068 | 15 | # Bail out on errors, be strict | ||
1069 | 16 | set -ue | ||
1070 | 17 | |||
1071 | 18 | # Examine parameters | ||
1072 | 19 | TARGET='' | ||
1073 | 20 | TARGET_ARG='' | ||
1074 | 21 | TARGET_CFLAGS='' | ||
1075 | 22 | SIGN='--sign' | ||
1076 | 23 | |||
1077 | 24 | # Check if we have a functional getopt(1) | ||
1078 | 25 | if ! getopt --test | ||
1079 | 26 | then | ||
1080 | 27 | go_out="$(getopt --options="iK" --longoptions=i686,nosign \ | ||
1081 | 28 | --name="$(basename "$0")" -- "$@")" | ||
1082 | 29 | test $? -eq 0 || exit 1 | ||
1083 | 30 | eval set -- $go_out | ||
1084 | 31 | fi | ||
1085 | 32 | |||
1086 | 33 | for arg | ||
1087 | 34 | do | ||
1088 | 35 | case "$arg" in | ||
1089 | 36 | -- ) shift; break;; | ||
1090 | 37 | -i | --i686 ) | ||
1091 | 38 | shift | ||
1092 | 39 | TARGET='i686' | ||
1093 | 40 | TARGET_ARG="--target i686" | ||
1094 | 41 | TARGET_CFLAGS="-m32 -march=i686" | ||
1095 | 42 | ;; | ||
1096 | 43 | -K | --nosign ) | ||
1097 | 44 | shift | ||
1098 | 45 | SIGN='' | ||
1099 | 46 | ;; | ||
1100 | 47 | esac | ||
1101 | 48 | done | ||
1102 | 49 | |||
1103 | 50 | # Working directory | ||
1104 | 51 | if test "$#" -eq 0 | ||
1105 | 52 | then | ||
1106 | 53 | WORKDIR="$(pwd)" | ||
1107 | 54 | |||
1108 | 55 | # Check that the current directory is not empty | ||
1109 | 56 | if test "x$(echo *)" != "x*" | ||
1110 | 57 | then | ||
1111 | 58 | echo >&2 \ | ||
1112 | 59 | "Current directory is not empty. Use $0 . to force build in ." | ||
1113 | 60 | exit 1 | ||
1114 | 61 | fi | ||
1115 | 62 | |||
1116 | 63 | elif test "$#" -eq 1 | ||
1117 | 64 | then | ||
1118 | 65 | WORKDIR="$1" | ||
1119 | 66 | |||
1120 | 67 | # Check that the provided directory exists and is a directory | ||
1121 | 68 | if ! test -d "$WORKDIR" | ||
1122 | 69 | then | ||
1123 | 70 | echo >&2 "$WORKDIR is not a directory" | ||
1124 | 71 | exit 1 | ||
1125 | 72 | fi | ||
1126 | 73 | |||
1127 | 74 | else | ||
1128 | 75 | echo >&2 "Usage: $0 [target dir]" | ||
1129 | 76 | exit 1 | ||
1130 | 77 | |||
1131 | 78 | fi | ||
1132 | 79 | |||
1133 | 80 | WORKDIR_ABS="$(cd "$WORKDIR"; pwd)" | ||
1134 | 81 | |||
1135 | 82 | # If we're in 32 bits, ensure that we're compiling for i686. | ||
1136 | 83 | if test "x$TARGET" == "x" | ||
1137 | 84 | then | ||
1138 | 85 | if test "x$(uname -m)" != "xx86_64" | ||
1139 | 86 | then | ||
1140 | 87 | TARGET='i686' | ||
1141 | 88 | TARGET_ARG="--target i686" | ||
1142 | 89 | TARGET_CFLAGS='-m32 -march=i686' | ||
1143 | 90 | fi | ||
1144 | 91 | |||
1145 | 92 | fi | ||
1146 | 93 | |||
1147 | 94 | SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)" | ||
1148 | 95 | test -e "$SOURCEDIR/Makefile" || exit 2 | ||
1149 | 96 | |||
1150 | 97 | # Extract version from the Makefile | ||
1151 | 98 | MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \ | ||
1152 | 99 | | cut -d = -f 2)" | ||
1153 | 100 | PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \ | ||
1154 | 101 | "$SOURCEDIR/Makefile" | cut -d = -f 2)" | ||
1155 | 102 | PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" | ||
1156 | 103 | |||
1157 | 104 | # Build information | ||
1158 | 105 | REDHAT_RELEASE="$(grep -o 'release [0-9][0-9]*' /etc/redhat-release | \ | ||
1159 | 106 | cut -d ' ' -f 2)" | ||
1160 | 107 | REVISION="$(cd "$SOURCEDIR"; bzr log -r-1 | grep ^revno: | cut -d ' ' -f 2)" | ||
1161 | 108 | |||
1162 | 109 | # Compilation flags | ||
1163 | 110 | export CC=gcc | ||
1164 | 111 | export CXX=gcc | ||
1165 | 112 | export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer $TARGET_CFLAGS" | ||
1166 | 113 | export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions $TARGET_CFLAGS" | ||
1167 | 114 | export MAKE_JFLAG=-j4 | ||
1168 | 115 | |||
1169 | 116 | # Create directories for rpmbuild if these don't exist | ||
1170 | 117 | (cd "$WORKDIR" && mkdir -p BUILD RPMS SOURCES SPECS SRPMS) | ||
1171 | 118 | |||
1172 | 119 | # Prepare sources | ||
1173 | 120 | ( | ||
1174 | 121 | cd "$WORKDIR/SOURCES/" | ||
1175 | 122 | |||
1176 | 123 | # Download the sources from the community site | ||
1177 | 124 | if test "x$TARGET" = "xi686" | ||
1178 | 125 | then | ||
1179 | 126 | RPMVER=i386 | ||
1180 | 127 | elif test "x$(uname -m)" = "xx86_64" | ||
1181 | 128 | then | ||
1182 | 129 | RPMVER=x86_64 | ||
1183 | 130 | else | ||
1184 | 131 | RPMVER=i386 | ||
1185 | 132 | fi | ||
1186 | 133 | |||
1187 | 134 | wget "http://www.percona.com/downloads/community/shared-compat/MySQL-shared-compat-$MYSQL_VERSION-1.linux2.6.$RPMVER.rpm" | ||
1188 | 135 | |||
1189 | 136 | ) | ||
1190 | 137 | |||
1191 | 138 | # Issue rpmbuild command | ||
1192 | 139 | ( | ||
1193 | 140 | cd "$WORKDIR" | ||
1194 | 141 | |||
1195 | 142 | # Issue RPM command | ||
1196 | 143 | rpmbuild -ba --clean --with yassl $SIGN \ | ||
1197 | 144 | "$SOURCEDIR/build/percona-shared-compat.spec" \ | ||
1198 | 145 | --define "_topdir $WORKDIR_ABS" \ | ||
1199 | 146 | --define "redhat_version $REDHAT_RELEASE" \ | ||
1200 | 147 | --define "gotrevision $REVISION" \ | ||
1201 | 148 | --define "release $PERCONA_SERVER_VERSION" \ | ||
1202 | 149 | $TARGET_ARG | ||
1203 | 150 | |||
1204 | 151 | ) | ||
1205 | 152 |