Merge lp:~roel11/percona-server/bug-1144059-5.6 into lp:percona-server/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
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Registry Administrators Pending
Review via email: mp+151937@code.launchpad.net

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

Subscribers

People subscribed via source and target branches