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
=== added file 'build/build-binary.sh'
--- build/build-binary.sh 1970-01-01 00:00:00 +0000
+++ build/build-binary.sh 2013-03-06 12:02:24 +0000
@@ -0,0 +1,162 @@
1#!/bin/sh
2#
3# Execute this tool to setup the environment and build binary releases
4# for Percona-Server starting from a fresh tree.
5#
6# Usage: build-binary.sh [target dir]
7# The default target directory is the current directory. If it is not
8# supplied and the current directory is not empty, it will issue an error in
9# order to avoid polluting the current directory after a test run.
10#
11
12# Bail out on errors, be strict
13set -ue
14
15# Examine parameters
16TARGET="$(uname -m)"
17TARGET_CFLAGS=''
18QUIET='VERBOSE=1'
19
20# Some programs that may be overriden
21TAR=${TAR:-tar}
22
23# Check if we have a functional getopt(1)
24if ! getopt --test
25then
26 go_out="$(getopt --options="iqdv" --longoptions=i686,quiet,debug,valgrind \
27 --name="$(basename "$0")" -- "$@")"
28 test $? -eq 0 || exit 1
29 eval set -- $go_out
30fi
31
32for arg
33do
34 case "$arg" in
35 -- ) shift; break;;
36 -i | --i686 )
37 shift
38 TARGET="i686"
39 TARGET_CFLAGS="-m32 -march=i686"
40 ;;
41 -q | --quiet )
42 shift
43 QUIET=''
44 ;;
45 -d | --debug )
46 shift
47 BUILD_COMMENT="${BUILD_COMMENT:-}-debug"
48 CMAKE_BUILD_TYPE='Debug'
49 ;;
50 -v | --valgrind )
51 shift
52 CMAKE_OPTS="${CMAKE_OPTS:-} -DWITH_VALGRIND=ON"
53 BUILD_COMMENT="${BUILD_COMMENT:-}-valgrind"
54 ;;
55 esac
56done
57
58# Working directory
59if test "$#" -eq 0
60then
61 WORKDIR="$(pwd)"
62
63 # Check that the current directory is not empty
64 if test "x$(echo *)" != "x*"
65 then
66 echo >&2 \
67 "Current directory is not empty. Use $0 . to force build in ."
68 exit 1
69 fi
70
71elif test "$#" -eq 1
72then
73 WORKDIR="$1"
74
75 # Check that the provided directory exists and is a directory
76 if ! test -d "$WORKDIR"
77 then
78 echo >&2 "$WORKDIR is not a directory"
79 exit 1
80 fi
81
82 WORKDIR_ABS="$(cd "$WORKDIR"; pwd)"
83
84else
85 echo >&2 "Usage: $0 [target dir]"
86 exit 1
87
88fi
89
90SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)"
91test -e "$SOURCEDIR/Makefile" || exit 2
92
93# Extract version from the Makefile
94MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \
95 | cut -d = -f 2)"
96PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \
97 "$SOURCEDIR/Makefile" | cut -d = -f 2)"
98PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
99
100# Build information
101REVISION="$(cd "$SOURCEDIR"; bzr revno)"
102PRODUCT_FULL="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
103PRODUCT_FULL="$PRODUCT_FULL-$REVISION${BUILD_COMMENT:-}.$(uname -s).$TARGET"
104COMMENT="Percona Server with XtraDB (GPL), Release $PERCONA_SERVER_VERSION"
105COMMENT="$COMMENT, Revision $REVISION${BUILD_COMMENT:-}"
106
107# Compilation flags
108export CC=${CC:-gcc}
109export CXX=${CXX:-g++}
110export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CFLAGS:-}"
111export 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:-}"
112export MAKE_JFLAG=-j4
113
114# Create a temporary working directory
115INSTALLDIR="$(cd "$WORKDIR" && TMPDIR="$WORKDIR_ABS" mktemp -d percona-build.XXXXXX)"
116INSTALLDIR="$WORKDIR_ABS/$INSTALLDIR" # Make it absolute
117
118# Build
119(
120 cd "$SOURCEDIR"
121
122 # Execute clean and download mysql, apply patches
123 make clean all
124
125 cd "$PRODUCT"
126 cmake . ${CMAKE_OPTS:-} -DBUILD_CONFIG=mysql_release \
127 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-RelWithDebInfo} \
128 -DWITH_EMBEDDED_SERVER=OFF \
129 -DFEATURE_SET=community \
130 -DENABLE_DTRACE=OFF \
131 -DCMAKE_INSTALL_PREFIX="/usr/local/$PRODUCT_FULL" \
132 -DMYSQL_DATADIR="/usr/local/$PRODUCT_FULL/data" \
133 -DMYSQL_SERVER_SUFFIX="-$PERCONA_SERVER_VERSION" \
134 -DCOMPILATION_COMMENT="$COMMENT"
135
136 make $MAKE_JFLAG $QUIET
137 make DESTDIR="$INSTALLDIR" install
138
139 # Build UDF
140 (
141 cd "UDF"
142 CXX=${UDF_CXX:-g++} ./configure --includedir="$SOURCEDIR/$PRODUCT/include" \
143 --libdir="/usr/local/$PRODUCT_FULL/mysql/plugin"
144 make
145 make DESTDIR="$INSTALLDIR" install
146
147 )
148
149)
150
151# Package the archive
152(
153 cd "$INSTALLDIR/usr/local/"
154
155 $TAR czf "$WORKDIR_ABS/$PRODUCT_FULL.tar.gz" \
156 --owner=0 --group=0 "$PRODUCT_FULL/"
157
158)
159
160# Clean up
161rm -rf "$INSTALLDIR"
162
0163
=== removed file 'build/build-binary.sh'
--- build/build-binary.sh 2013-02-19 08:20:59 +0000
+++ build/build-binary.sh 1970-01-01 00:00:00 +0000
@@ -1,162 +0,0 @@
1#!/bin/sh
2#
3# Execute this tool to setup the environment and build binary releases
4# for Percona-Server starting from a fresh tree.
5#
6# Usage: build-binary.sh [target dir]
7# The default target directory is the current directory. If it is not
8# supplied and the current directory is not empty, it will issue an error in
9# order to avoid polluting the current directory after a test run.
10#
11
12# Bail out on errors, be strict
13set -ue
14
15# Examine parameters
16TARGET="$(uname -m)"
17TARGET_CFLAGS=''
18QUIET='VERBOSE=1'
19
20# Some programs that may be overriden
21TAR=${TAR:-tar}
22
23# Check if we have a functional getopt(1)
24if ! getopt --test
25then
26 go_out="$(getopt --options="iqdv" --longoptions=i686,quiet,debug,valgrind \
27 --name="$(basename "$0")" -- "$@")"
28 test $? -eq 0 || exit 1
29 eval set -- $go_out
30fi
31
32for arg
33do
34 case "$arg" in
35 -- ) shift; break;;
36 -i | --i686 )
37 shift
38 TARGET="i686"
39 TARGET_CFLAGS="-m32 -march=i686"
40 ;;
41 -q | --quiet )
42 shift
43 QUIET=''
44 ;;
45 -d | --debug )
46 shift
47 BUILD_COMMENT="${BUILD_COMMENT:-}-debug"
48 CMAKE_BUILD_TYPE='Debug'
49 ;;
50 -v | --valgrind )
51 shift
52 CMAKE_OPTS="${CMAKE_OPTS:-} -DWITH_VALGRIND=ON"
53 BUILD_COMMENT="${BUILD_COMMENT:-}-valgrind"
54 ;;
55 esac
56done
57
58# Working directory
59if test "$#" -eq 0
60then
61 WORKDIR="$(pwd)"
62
63 # Check that the current directory is not empty
64 if test "x$(echo *)" != "x*"
65 then
66 echo >&2 \
67 "Current directory is not empty. Use $0 . to force build in ."
68 exit 1
69 fi
70
71elif test "$#" -eq 1
72then
73 WORKDIR="$1"
74
75 # Check that the provided directory exists and is a directory
76 if ! test -d "$WORKDIR"
77 then
78 echo >&2 "$WORKDIR is not a directory"
79 exit 1
80 fi
81
82 WORKDIR_ABS="$(cd "$WORKDIR"; pwd)"
83
84else
85 echo >&2 "Usage: $0 [target dir]"
86 exit 1
87
88fi
89
90SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)"
91test -e "$SOURCEDIR/Makefile" || exit 2
92
93# Extract version from the Makefile
94MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \
95 | cut -d = -f 2)"
96PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \
97 "$SOURCEDIR/Makefile" | cut -d = -f 2)"
98PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
99
100# Build information
101REVISION="$(cd "$SOURCEDIR"; bzr revno)"
102PRODUCT_FULL="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
103PRODUCT_FULL="$PRODUCT_FULL-$REVISION${BUILD_COMMENT:-}.$(uname -s).$TARGET"
104COMMENT="Percona Server with XtraDB (GPL), Release $PERCONA_SERVER_VERSION"
105COMMENT="$COMMENT, Revision $REVISION${BUILD_COMMENT:-}"
106
107# Compilation flags
108export CC=${CC:-gcc}
109export CXX=${CXX:-g++}
110export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CFLAGS:-}"
111export 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:-}"
112export MAKE_JFLAG=-j4
113
114# Create a temporary working directory
115INSTALLDIR="$(cd "$WORKDIR" && TMPDIR="$WORKDIR_ABS" mktemp -d percona-build.XXXXXX)"
116INSTALLDIR="$WORKDIR_ABS/$INSTALLDIR" # Make it absolute
117
118# Build
119(
120 cd "$SOURCEDIR"
121
122 # Execute clean and download mysql, apply patches
123 make clean all
124
125 cd "$PRODUCT"
126 cmake . ${CMAKE_OPTS:-} -DBUILD_CONFIG=mysql_release \
127 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-RelWithDebInfo} \
128 -DWITH_EMBEDDED_SERVER=OFF \
129 -DFEATURE_SET=community \
130 -DENABLE_DTRACE=OFF \
131 -DCMAKE_INSTALL_PREFIX="/usr/local/$PRODUCT_FULL" \
132 -DMYSQL_DATADIR="/usr/local/$PRODUCT_FULL/data" \
133 -DMYSQL_SERVER_SUFFIX="-$PERCONA_SERVER_VERSION" \
134 -DCOMPILATION_COMMENT="$COMMENT"
135
136 make $MAKE_JFLAG $QUIET
137 make DESTDIR="$INSTALLDIR" install
138
139 # Build UDF
140 (
141 cd "UDF"
142 CXX=${UDF_CXX:-g++} ./configure --includedir="$SOURCEDIR/$PRODUCT/include" \
143 --libdir="/usr/local/$PRODUCT_FULL/mysql/plugin"
144 make
145 make DESTDIR="$INSTALLDIR" install
146
147 )
148
149)
150
151# Package the archive
152(
153 cd "$INSTALLDIR/usr/local/"
154
155 $TAR czf "$WORKDIR_ABS/$PRODUCT_FULL.tar.gz" \
156 --owner=0 --group=0 "$PRODUCT_FULL/"
157
158)
159
160# Clean up
161rm -rf "$INSTALLDIR"
162
1630
=== added file 'build/build-dpkg.sh'
--- build/build-dpkg.sh 1970-01-01 00:00:00 +0000
+++ build/build-dpkg.sh 2013-03-06 12:02:24 +0000
@@ -0,0 +1,115 @@
1#!/bin/sh
2# Usage: build-dpkg.sh [target dir]
3# The default target directory is the current directory. If it is not
4# supplied and the current directory is not empty, it will issue an error in
5# order to avoid polluting the current directory after a test run.
6#
7# The program will setup the dpkg building environment and ultimately call
8# dpkg-buildpackage with the appropiate parameters.
9#
10
11# Bail out on errors, be strict
12set -ue
13
14# Examine parameters
15go_out="$(getopt --options "kK:bH" --longoptions key:,nosign,binary \
16 --name "$(basename "$0")" -- "$@")"
17test $? -eq 0 || exit 1
18eval set -- $go_out
19
20BUILDPKG_KEY=''
21BINARY=''
22
23for arg
24do
25 case "$arg" in
26 -- ) shift; break;;
27 -k | --key ) shift; BUILDPKG_KEY="-pgpg -k$1"; shift;;
28 -K | --nosign ) shift; BUILDPKG_KEY="-uc -us";;
29 -b | --binary ) shift; BINARY='-b';;
30 esac
31done
32
33# Working directory
34if test "$#" -eq 0
35then
36 WORKDIR="$(pwd)"
37
38 # Check that the current directory is not empty
39 if test "x$(echo *)" != "x*"
40 then
41 echo >&2 \
42 "Current directory is not empty. Use $0 . to force build in ."
43 exit 1
44 fi
45
46elif test "$#" -eq 1
47then
48 WORKDIR="$1"
49
50 # Check that the provided directory exists and is a directory
51 if ! test -d "$WORKDIR"
52 then
53 echo >&2 "$WORKDIR is not a directory"
54 exit 1
55 fi
56
57else
58 echo >&2 "Usage: $0 [target dir]"
59 exit 1
60
61fi
62
63SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)"
64test -e "$SOURCEDIR/Makefile" || exit 2
65
66# Extract version from the Makefile
67MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \
68 | cut -d = -f 2)"
69PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= "$SOURCEDIR/Makefile" | cut -d = -f 2)"
70PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
71DEBIAN_VERSION="$(lsb_release -sc)"
72
73
74# Build information
75export BB_PERCONA_REVISION="$(cd "$SOURCEDIR"; bzr revno)"
76export DEB_BUILD_OPTIONS='nostrip debug nocheck'
77
78# Compilation flags
79export CC=${CC:-gcc}
80export CXX=${CXX:-g++}
81export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION ${CFLAGS:-}"
82export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION ${CXXFLAGS:-}"
83export MAKE_JFLAG=-j4
84
85# Prepare sources
86(
87 cd "$SOURCEDIR"
88 make clean all
89)
90
91# Build
92(
93 # Make a copy in workdir and copy debian files
94 cd "$WORKDIR"
95
96 rm -rf "$PRODUCT/"
97 cp -a "$SOURCEDIR/$PRODUCT/" .
98 (
99 cd "$PRODUCT/"
100
101 # Copy debian files from source
102 cp -R "$SOURCEDIR/build/debian" .
103 chmod +x debian/rules
104
105 # Update distribution name
106 dch -m -D "$DEBIAN_VERSION" --force-distribution -v "$MYSQL_VERSION-$PERCONA_SERVER_VERSION-$BB_PERCONA_REVISION.$DEBIAN_VERSION" 'Update distribution'
107
108 DEB_CFLAGS_APPEND="$CFLAGS" DEB_CXXFLAGS_APPEND="$CXXFLAGS" \
109 dpkg-buildpackage $BINARY -rfakeroot $BUILDPKG_KEY
110
111 )
112
113 rm -rf "$PRODUCT"
114
115)
0116
=== removed file 'build/build-dpkg.sh'
--- build/build-dpkg.sh 2012-08-21 07:35:48 +0000
+++ build/build-dpkg.sh 1970-01-01 00:00:00 +0000
@@ -1,115 +0,0 @@
1#!/bin/sh
2# Usage: build-dpkg.sh [target dir]
3# The default target directory is the current directory. If it is not
4# supplied and the current directory is not empty, it will issue an error in
5# order to avoid polluting the current directory after a test run.
6#
7# The program will setup the dpkg building environment and ultimately call
8# dpkg-buildpackage with the appropiate parameters.
9#
10
11# Bail out on errors, be strict
12set -ue
13
14# Examine parameters
15go_out="$(getopt --options "kK:bH" --longoptions key:,nosign,binary \
16 --name "$(basename "$0")" -- "$@")"
17test $? -eq 0 || exit 1
18eval set -- $go_out
19
20BUILDPKG_KEY=''
21BINARY=''
22
23for arg
24do
25 case "$arg" in
26 -- ) shift; break;;
27 -k | --key ) shift; BUILDPKG_KEY="-pgpg -k$1"; shift;;
28 -K | --nosign ) shift; BUILDPKG_KEY="-uc -us";;
29 -b | --binary ) shift; BINARY='-b';;
30 esac
31done
32
33# Working directory
34if test "$#" -eq 0
35then
36 WORKDIR="$(pwd)"
37
38 # Check that the current directory is not empty
39 if test "x$(echo *)" != "x*"
40 then
41 echo >&2 \
42 "Current directory is not empty. Use $0 . to force build in ."
43 exit 1
44 fi
45
46elif test "$#" -eq 1
47then
48 WORKDIR="$1"
49
50 # Check that the provided directory exists and is a directory
51 if ! test -d "$WORKDIR"
52 then
53 echo >&2 "$WORKDIR is not a directory"
54 exit 1
55 fi
56
57else
58 echo >&2 "Usage: $0 [target dir]"
59 exit 1
60
61fi
62
63SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)"
64test -e "$SOURCEDIR/Makefile" || exit 2
65
66# Extract version from the Makefile
67MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \
68 | cut -d = -f 2)"
69PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= "$SOURCEDIR/Makefile" | cut -d = -f 2)"
70PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
71DEBIAN_VERSION="$(lsb_release -sc)"
72
73
74# Build information
75export BB_PERCONA_REVISION="$(cd "$SOURCEDIR"; bzr revno)"
76export DEB_BUILD_OPTIONS='nostrip debug nocheck'
77
78# Compilation flags
79export CC=${CC:-gcc}
80export CXX=${CXX:-g++}
81export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION ${CFLAGS:-}"
82export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION ${CXXFLAGS:-}"
83export MAKE_JFLAG=-j4
84
85# Prepare sources
86(
87 cd "$SOURCEDIR"
88 make clean all
89)
90
91# Build
92(
93 # Make a copy in workdir and copy debian files
94 cd "$WORKDIR"
95
96 rm -rf "$PRODUCT/"
97 cp -a "$SOURCEDIR/$PRODUCT/" .
98 (
99 cd "$PRODUCT/"
100
101 # Copy debian files from source
102 cp -R "$SOURCEDIR/build/debian" .
103 chmod +x debian/rules
104
105 # Update distribution name
106 dch -m -D "$DEBIAN_VERSION" --force-distribution -v "$MYSQL_VERSION-$PERCONA_SERVER_VERSION-$BB_PERCONA_REVISION.$DEBIAN_VERSION" 'Update distribution'
107
108 DEB_CFLAGS_APPEND="$CFLAGS" DEB_CXXFLAGS_APPEND="$CXXFLAGS" \
109 dpkg-buildpackage $BINARY -rfakeroot $BUILDPKG_KEY
110
111 )
112
113 rm -rf "$PRODUCT"
114
115)
1160
=== added file 'build/build-rpm.sh'
--- build/build-rpm.sh 1970-01-01 00:00:00 +0000
+++ build/build-rpm.sh 2013-03-06 12:02:24 +0000
@@ -0,0 +1,154 @@
1#!/bin/sh
2#
3# Execute this tool to setup and build RPMs for Percona-Server starting
4# from a fresh tree
5#
6# Usage: build-rpm.sh [target dir]
7# The default target directory is the current directory. If it is not
8# supplied and the current directory is not empty, it will issue an error in
9# order to avoid polluting the current directory after a test run.
10#
11# The program will setup the rpm building environment and ultimately call
12# rpmbuild with the appropiate parameters.
13#
14
15# Bail out on errors, be strict
16set -ue
17
18# Examine parameters
19TARGET=''
20TARGET_CFLAGS=''
21SIGN='--sign' # We sign by default
22QUIET=''
23
24# Check if we have a functional getopt(1)
25if ! getopt --test
26then
27 go_out="$(getopt --options="iKqH" --longoptions=i686,nosign,quiet \
28 --name="$(basename "$0")" -- "$@")"
29 test $? -eq 0 || exit 1
30 eval set -- $go_out
31fi
32
33for arg
34do
35 case "$arg" in
36 -- ) shift; break;;
37 -i | --i686 )
38 shift
39 TARGET="--target i686"
40 TARGET_CFLAGS="-m32 -march=i686"
41 ;;
42 -K | --nosign )
43 shift
44 SIGN=''
45 ;;
46 -q | --quiet )
47 shift
48 QUIET='--quiet'
49 ;;
50 esac
51done
52
53# Working directory
54if test "$#" -eq 0
55then
56 WORKDIR="$(pwd)"
57
58 # Check that the current directory is not empty
59 if test "x$(echo *)" != "x*"
60 then
61 echo >&2 \
62 "Current directory is not empty. Use $0 . to force build in ."
63 exit 1
64 fi
65
66 WORKDIR_ABS="$(cd "$WORKDIR"; pwd)"
67
68elif test "$#" -eq 1
69then
70 WORKDIR="$1"
71
72 # Check that the provided directory exists and is a directory
73 if ! test -d "$WORKDIR"
74 then
75 echo >&2 "$WORKDIR is not a directory"
76 exit 1
77 fi
78
79 WORKDIR_ABS="$(cd "$WORKDIR"; pwd)"
80
81else
82 echo >&2 "Usage: $0 [target dir]"
83 exit 1
84
85fi
86
87# If we're in 32 bits, ensure that we're compiling for i686.
88if test "x$TARGET" == "x"
89then
90 if test "x$(uname -m)" != "xx86_64"
91 then
92 TARGET='--target i686'
93 TARGET_CFLAGS='-m32 -march=i686'
94 fi
95
96fi
97
98SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)"
99test -e "$SOURCEDIR/Makefile" || exit 2
100
101# Extract version from the Makefile
102MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \
103 | cut -d = -f 2)"
104PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \
105 "$SOURCEDIR/Makefile" | cut -d = -f 2)"
106PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
107
108# Build information
109REDHAT_RELEASE="$(grep -o 'release [0-9][0-9]*' /etc/redhat-release | \
110 cut -d ' ' -f 2)"
111REVISION="$(cd "$SOURCEDIR"; bzr revno)"
112
113# Compilation flags
114export CC="${CC:-gcc}"
115export CXX="${CXX:-g++}"
116export HS_CXX="${HS_CXX:-g++}"
117export UDF_CXX="${UDF_CXX:-g++}"
118export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CFLAGS:-}"
119export 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:-}"
120export MAKE_JFLAG=-j4
121
122# Create directories for rpmbuild if these don't exist
123(cd "$WORKDIR" && mkdir -p BUILD RPMS SOURCES SPECS SRPMS)
124
125(
126 cd "$SOURCEDIR"
127
128 # Execute clean and download mysql, apply patches
129 make clean all
130
131 # "Fix" cmake destdirs, since we cannot alter SYSTEM_PROCESSOR
132 if test "x$TARGET" != "x"
133 then
134 sed -i 's/lib64/lib/' "$PRODUCT/cmake/install_layout.cmake"
135 fi
136
137 # Create tarball for build
138 tar czf "$WORKDIR_ABS/SOURCES/$PRODUCT.tar.gz" "$PRODUCT/"*
139
140)
141
142# Issue rpmbuild command
143(
144 cd "$WORKDIR"
145
146 # Issue RPM command
147 rpmbuild -ba --clean --with yassl $TARGET $SIGN $QUIET \
148 "$SOURCEDIR/build/percona-server.spec" \
149 --define "_topdir $WORKDIR_ABS" \
150 --define "redhat_version $REDHAT_RELEASE" \
151 --define "gotrevision $REVISION"
152
153)
154
0155
=== removed file 'build/build-rpm.sh'
--- build/build-rpm.sh 2012-08-21 07:35:48 +0000
+++ build/build-rpm.sh 1970-01-01 00:00:00 +0000
@@ -1,154 +0,0 @@
1#!/bin/sh
2#
3# Execute this tool to setup and build RPMs for Percona-Server starting
4# from a fresh tree
5#
6# Usage: build-rpm.sh [target dir]
7# The default target directory is the current directory. If it is not
8# supplied and the current directory is not empty, it will issue an error in
9# order to avoid polluting the current directory after a test run.
10#
11# The program will setup the rpm building environment and ultimately call
12# rpmbuild with the appropiate parameters.
13#
14
15# Bail out on errors, be strict
16set -ue
17
18# Examine parameters
19TARGET=''
20TARGET_CFLAGS=''
21SIGN='--sign' # We sign by default
22QUIET=''
23
24# Check if we have a functional getopt(1)
25if ! getopt --test
26then
27 go_out="$(getopt --options="iKqH" --longoptions=i686,nosign,quiet \
28 --name="$(basename "$0")" -- "$@")"
29 test $? -eq 0 || exit 1
30 eval set -- $go_out
31fi
32
33for arg
34do
35 case "$arg" in
36 -- ) shift; break;;
37 -i | --i686 )
38 shift
39 TARGET="--target i686"
40 TARGET_CFLAGS="-m32 -march=i686"
41 ;;
42 -K | --nosign )
43 shift
44 SIGN=''
45 ;;
46 -q | --quiet )
47 shift
48 QUIET='--quiet'
49 ;;
50 esac
51done
52
53# Working directory
54if test "$#" -eq 0
55then
56 WORKDIR="$(pwd)"
57
58 # Check that the current directory is not empty
59 if test "x$(echo *)" != "x*"
60 then
61 echo >&2 \
62 "Current directory is not empty. Use $0 . to force build in ."
63 exit 1
64 fi
65
66 WORKDIR_ABS="$(cd "$WORKDIR"; pwd)"
67
68elif test "$#" -eq 1
69then
70 WORKDIR="$1"
71
72 # Check that the provided directory exists and is a directory
73 if ! test -d "$WORKDIR"
74 then
75 echo >&2 "$WORKDIR is not a directory"
76 exit 1
77 fi
78
79 WORKDIR_ABS="$(cd "$WORKDIR"; pwd)"
80
81else
82 echo >&2 "Usage: $0 [target dir]"
83 exit 1
84
85fi
86
87# If we're in 32 bits, ensure that we're compiling for i686.
88if test "x$TARGET" == "x"
89then
90 if test "x$(uname -m)" != "xx86_64"
91 then
92 TARGET='--target i686'
93 TARGET_CFLAGS='-m32 -march=i686'
94 fi
95
96fi
97
98SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)"
99test -e "$SOURCEDIR/Makefile" || exit 2
100
101# Extract version from the Makefile
102MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \
103 | cut -d = -f 2)"
104PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \
105 "$SOURCEDIR/Makefile" | cut -d = -f 2)"
106PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
107
108# Build information
109REDHAT_RELEASE="$(grep -o 'release [0-9][0-9]*' /etc/redhat-release | \
110 cut -d ' ' -f 2)"
111REVISION="$(cd "$SOURCEDIR"; bzr revno)"
112
113# Compilation flags
114export CC="${CC:-gcc}"
115export CXX="${CXX:-g++}"
116export HS_CXX="${HS_CXX:-g++}"
117export UDF_CXX="${UDF_CXX:-g++}"
118export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -DPERCONA_INNODB_VERSION=$PERCONA_SERVER_VERSION $TARGET_CFLAGS ${CFLAGS:-}"
119export 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:-}"
120export MAKE_JFLAG=-j4
121
122# Create directories for rpmbuild if these don't exist
123(cd "$WORKDIR" && mkdir -p BUILD RPMS SOURCES SPECS SRPMS)
124
125(
126 cd "$SOURCEDIR"
127
128 # Execute clean and download mysql, apply patches
129 make clean all
130
131 # "Fix" cmake destdirs, since we cannot alter SYSTEM_PROCESSOR
132 if test "x$TARGET" != "x"
133 then
134 sed -i 's/lib64/lib/' "$PRODUCT/cmake/install_layout.cmake"
135 fi
136
137 # Create tarball for build
138 tar czf "$WORKDIR_ABS/SOURCES/$PRODUCT.tar.gz" "$PRODUCT/"*
139
140)
141
142# Issue rpmbuild command
143(
144 cd "$WORKDIR"
145
146 # Issue RPM command
147 rpmbuild -ba --clean --with yassl $TARGET $SIGN $QUIET \
148 "$SOURCEDIR/build/percona-server.spec" \
149 --define "_topdir $WORKDIR_ABS" \
150 --define "redhat_version $REDHAT_RELEASE" \
151 --define "gotrevision $REVISION"
152
153)
154
1550
=== added file 'build/build-shared-compat-rpm.sh'
--- build/build-shared-compat-rpm.sh 1970-01-01 00:00:00 +0000
+++ build/build-shared-compat-rpm.sh 2013-03-06 12:02:24 +0000
@@ -0,0 +1,152 @@
1#!/bin/sh
2#
3# Execute this tool to setup and build the shared-compat RPM starting
4# from a fresh tree
5#
6# Usage: build-shared-compat-rpm.sh [target dir]
7# The default target directory is the current directory. If it is not
8# supplied and the current directory is not empty, it will issue an error in
9# order to avoid polluting the current directory after a test run.
10#
11# The program will setup the rpm building environment, download the sources
12# and ultimately call rpmbuild with the appropiate parameters.
13#
14
15# Bail out on errors, be strict
16set -ue
17
18# Examine parameters
19TARGET=''
20TARGET_ARG=''
21TARGET_CFLAGS=''
22SIGN='--sign'
23
24# Check if we have a functional getopt(1)
25if ! getopt --test
26then
27 go_out="$(getopt --options="iK" --longoptions=i686,nosign \
28 --name="$(basename "$0")" -- "$@")"
29 test $? -eq 0 || exit 1
30 eval set -- $go_out
31fi
32
33for arg
34do
35 case "$arg" in
36 -- ) shift; break;;
37 -i | --i686 )
38 shift
39 TARGET='i686'
40 TARGET_ARG="--target i686"
41 TARGET_CFLAGS="-m32 -march=i686"
42 ;;
43 -K | --nosign )
44 shift
45 SIGN=''
46 ;;
47 esac
48done
49
50# Working directory
51if test "$#" -eq 0
52then
53 WORKDIR="$(pwd)"
54
55 # Check that the current directory is not empty
56 if test "x$(echo *)" != "x*"
57 then
58 echo >&2 \
59 "Current directory is not empty. Use $0 . to force build in ."
60 exit 1
61 fi
62
63elif test "$#" -eq 1
64then
65 WORKDIR="$1"
66
67 # Check that the provided directory exists and is a directory
68 if ! test -d "$WORKDIR"
69 then
70 echo >&2 "$WORKDIR is not a directory"
71 exit 1
72 fi
73
74else
75 echo >&2 "Usage: $0 [target dir]"
76 exit 1
77
78fi
79
80WORKDIR_ABS="$(cd "$WORKDIR"; pwd)"
81
82# If we're in 32 bits, ensure that we're compiling for i686.
83if test "x$TARGET" == "x"
84then
85 if test "x$(uname -m)" != "xx86_64"
86 then
87 TARGET='i686'
88 TARGET_ARG="--target i686"
89 TARGET_CFLAGS='-m32 -march=i686'
90 fi
91
92fi
93
94SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)"
95test -e "$SOURCEDIR/Makefile" || exit 2
96
97# Extract version from the Makefile
98MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \
99 | cut -d = -f 2)"
100PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \
101 "$SOURCEDIR/Makefile" | cut -d = -f 2)"
102PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
103
104# Build information
105REDHAT_RELEASE="$(grep -o 'release [0-9][0-9]*' /etc/redhat-release | \
106 cut -d ' ' -f 2)"
107REVISION="$(cd "$SOURCEDIR"; bzr log -r-1 | grep ^revno: | cut -d ' ' -f 2)"
108
109# Compilation flags
110export CC=gcc
111export CXX=gcc
112export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer $TARGET_CFLAGS"
113export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions $TARGET_CFLAGS"
114export MAKE_JFLAG=-j4
115
116# Create directories for rpmbuild if these don't exist
117(cd "$WORKDIR" && mkdir -p BUILD RPMS SOURCES SPECS SRPMS)
118
119# Prepare sources
120(
121 cd "$WORKDIR/SOURCES/"
122
123 # Download the sources from the community site
124 if test "x$TARGET" = "xi686"
125 then
126 RPMVER=i386
127 elif test "x$(uname -m)" = "xx86_64"
128 then
129 RPMVER=x86_64
130 else
131 RPMVER=i386
132 fi
133
134 wget "http://www.percona.com/downloads/community/shared-compat/MySQL-shared-compat-$MYSQL_VERSION-1.linux2.6.$RPMVER.rpm"
135
136)
137
138# Issue rpmbuild command
139(
140 cd "$WORKDIR"
141
142 # Issue RPM command
143 rpmbuild -ba --clean --with yassl $SIGN \
144 "$SOURCEDIR/build/percona-shared-compat.spec" \
145 --define "_topdir $WORKDIR_ABS" \
146 --define "redhat_version $REDHAT_RELEASE" \
147 --define "gotrevision $REVISION" \
148 --define "release $PERCONA_SERVER_VERSION" \
149 $TARGET_ARG
150
151)
152
0153
=== removed file 'build/build-shared-compat-rpm.sh'
--- build/build-shared-compat-rpm.sh 2012-02-06 18:37:22 +0000
+++ build/build-shared-compat-rpm.sh 1970-01-01 00:00:00 +0000
@@ -1,152 +0,0 @@
1#!/bin/sh
2#
3# Execute this tool to setup and build the shared-compat RPM starting
4# from a fresh tree
5#
6# Usage: build-shared-compat-rpm.sh [target dir]
7# The default target directory is the current directory. If it is not
8# supplied and the current directory is not empty, it will issue an error in
9# order to avoid polluting the current directory after a test run.
10#
11# The program will setup the rpm building environment, download the sources
12# and ultimately call rpmbuild with the appropiate parameters.
13#
14
15# Bail out on errors, be strict
16set -ue
17
18# Examine parameters
19TARGET=''
20TARGET_ARG=''
21TARGET_CFLAGS=''
22SIGN='--sign'
23
24# Check if we have a functional getopt(1)
25if ! getopt --test
26then
27 go_out="$(getopt --options="iK" --longoptions=i686,nosign \
28 --name="$(basename "$0")" -- "$@")"
29 test $? -eq 0 || exit 1
30 eval set -- $go_out
31fi
32
33for arg
34do
35 case "$arg" in
36 -- ) shift; break;;
37 -i | --i686 )
38 shift
39 TARGET='i686'
40 TARGET_ARG="--target i686"
41 TARGET_CFLAGS="-m32 -march=i686"
42 ;;
43 -K | --nosign )
44 shift
45 SIGN=''
46 ;;
47 esac
48done
49
50# Working directory
51if test "$#" -eq 0
52then
53 WORKDIR="$(pwd)"
54
55 # Check that the current directory is not empty
56 if test "x$(echo *)" != "x*"
57 then
58 echo >&2 \
59 "Current directory is not empty. Use $0 . to force build in ."
60 exit 1
61 fi
62
63elif test "$#" -eq 1
64then
65 WORKDIR="$1"
66
67 # Check that the provided directory exists and is a directory
68 if ! test -d "$WORKDIR"
69 then
70 echo >&2 "$WORKDIR is not a directory"
71 exit 1
72 fi
73
74else
75 echo >&2 "Usage: $0 [target dir]"
76 exit 1
77
78fi
79
80WORKDIR_ABS="$(cd "$WORKDIR"; pwd)"
81
82# If we're in 32 bits, ensure that we're compiling for i686.
83if test "x$TARGET" == "x"
84then
85 if test "x$(uname -m)" != "xx86_64"
86 then
87 TARGET='i686'
88 TARGET_ARG="--target i686"
89 TARGET_CFLAGS='-m32 -march=i686'
90 fi
91
92fi
93
94SOURCEDIR="$(cd $(dirname "$0"); cd ..; pwd)"
95test -e "$SOURCEDIR/Makefile" || exit 2
96
97# Extract version from the Makefile
98MYSQL_VERSION="$(grep ^MYSQL_VERSION= "$SOURCEDIR/Makefile" \
99 | cut -d = -f 2)"
100PERCONA_SERVER_VERSION="$(grep ^PERCONA_SERVER_VERSION= \
101 "$SOURCEDIR/Makefile" | cut -d = -f 2)"
102PRODUCT="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
103
104# Build information
105REDHAT_RELEASE="$(grep -o 'release [0-9][0-9]*' /etc/redhat-release | \
106 cut -d ' ' -f 2)"
107REVISION="$(cd "$SOURCEDIR"; bzr log -r-1 | grep ^revno: | cut -d ' ' -f 2)"
108
109# Compilation flags
110export CC=gcc
111export CXX=gcc
112export CFLAGS="-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer $TARGET_CFLAGS"
113export CXXFLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions $TARGET_CFLAGS"
114export MAKE_JFLAG=-j4
115
116# Create directories for rpmbuild if these don't exist
117(cd "$WORKDIR" && mkdir -p BUILD RPMS SOURCES SPECS SRPMS)
118
119# Prepare sources
120(
121 cd "$WORKDIR/SOURCES/"
122
123 # Download the sources from the community site
124 if test "x$TARGET" = "xi686"
125 then
126 RPMVER=i386
127 elif test "x$(uname -m)" = "xx86_64"
128 then
129 RPMVER=x86_64
130 else
131 RPMVER=i386
132 fi
133
134 wget "http://www.percona.com/downloads/community/shared-compat/MySQL-shared-compat-$MYSQL_VERSION-1.linux2.6.$RPMVER.rpm"
135
136)
137
138# Issue rpmbuild command
139(
140 cd "$WORKDIR"
141
142 # Issue RPM command
143 rpmbuild -ba --clean --with yassl $SIGN \
144 "$SOURCEDIR/build/percona-shared-compat.spec" \
145 --define "_topdir $WORKDIR_ABS" \
146 --define "redhat_version $REDHAT_RELEASE" \
147 --define "gotrevision $REVISION" \
148 --define "release $PERCONA_SERVER_VERSION" \
149 $TARGET_ARG
150
151)
152

Subscribers

People subscribed via source and target branches