Merge lp:~ourdelta-core/ourdelta/ourdelta-mariadb51 into lp:~ourdelta-core/ourdelta/trunk015fmt

Proposed by Kristian Nielsen
Status: Needs review
Proposed branch: lp:~ourdelta-core/ourdelta/ourdelta-mariadb51
Merge into: lp:~ourdelta-core/ourdelta/trunk015fmt
Diff against target: 224 lines
4 files modified
bakery/autobake-bintar.sh (+5/-10)
bakery/autobake-bintar51.sh (+98/-0)
bakery/tarbake51.sh (+61/-0)
bakery/util/util.sh (+15/-0)
To merge this branch: bzr merge lp:~ourdelta-core/ourdelta/ourdelta-mariadb51
Reviewer Review Type Date Requested Status
Arjen Lentz testing Needs Fixing
Review via email: mp+6150@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Kristian Nielsen (knielsen) wrote :

Initial scripts for 5.1 binaries based on MariaDB as upstream. Source tarballs and bintar package only.

Revision history for this message
Arjen Lentz (arjen-lentz) wrote :

Bits might need work and adding... Toby working on this. Although it's separate scripts, best to get it all sorted before merging into trunk.

review: Needs Fixing (testing)
57. By Kristian Nielsen

Use BUILD/compile-dist instead of long custom ./configure
The BUILD/compile-dist script will be kept up-to-date using Buildbot, so this reduces the
risk of accidentally missing some stuff due to incorrect ./configure option.

Unmerged revisions

57. By Kristian Nielsen

Use BUILD/compile-dist instead of long custom ./configure
The BUILD/compile-dist script will be kept up-to-date using Buildbot, so this reduces the
risk of accidentally missing some stuff due to incorrect ./configure option.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bakery/autobake-bintar.sh'
2--- bakery/autobake-bintar.sh 2009-03-25 12:54:42 +0000
3+++ bakery/autobake-bintar.sh 2009-09-30 13:37:10 +0000
4@@ -20,6 +20,10 @@
5 BUILD_BASE_DIR="$(pwd)/build-temp-$$"
6 INSTALLROOT="/usr/local/mysql"
7
8+# Source our shared util functions.
9+#
10+. ${BAKERY_BASE_DIR}/util/util.sh
11+
12 if [ ! $# -eq 1 ]; then
13 echo "Usage: $0 [tarball]"
14 echo " tarball: ourdelta or ourdelta-sail tarball"
15@@ -84,16 +88,7 @@
16 OURDELTA_VERSION_STRING="${UPSTREAM}-d${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}${REPO_VERSION}-$(uname -o | cut -d '/' -f 2)-$(uname -m)"
17
18
19-case `gcc -dumpmachine` in
20- x86_64-*)
21- # gcc barfs on -march=... on x64
22- CPUOPT="-m64 -mtune=generic"
23- ;;
24- *)
25- # we'd use i586 to not trip up mobile/lowpower devices
26- CPUOPT="-m32 -march=i586 -mtune=generic"
27- ;;
28-esac
29+get_cpuopt
30
31 # we need the following to set up proper for Sphinx Engine
32 sh BUILD/autorun.sh
33
34=== added file 'bakery/autobake-bintar51.sh'
35--- bakery/autobake-bintar51.sh 1970-01-01 00:00:00 +0000
36+++ bakery/autobake-bintar51.sh 2009-09-30 13:37:10 +0000
37@@ -0,0 +1,98 @@
38+#! /bin/bash
39+
40+# Build generic binaries.
41+#
42+# We link libc dynamically, otherwise we get lots of problems loading
43+# .so files at runtime (either system stuff like NSS, or server
44+# plugins).
45+#
46+# We link libgcc statically (and avoid linking libstdc++ at all by
47+# CXX=gcc), to avoid reduce nasty library version dependencies.
48+
49+# Abort on error
50+set -e
51+
52+BAKERY_BASE_DIR="$(dirname $(readlink -f ${0}))"
53+INSTALLROOT="/usr/local/mysql"
54+
55+TARBALL="${1}"
56+if [ -z "$TARBALL" ]; then
57+ echo 1>&2 "Usage: $0 tarball.tar.gz"
58+ exit 1
59+fi
60+
61+WORKDIR="build-temp-$$"
62+
63+if [ ! -f "$TARBALL" ]; then
64+ echo 1>&2 "Can't find tarball: $TARBALL"
65+ exit 1
66+else
67+ TARBALL="$(readlink -f "$TARBALL")"
68+fi
69+
70+# Determine source name
71+#
72+SOURCE_DIR=$(basename ${TARBALL} .tar.gz)
73+BINDIST_NAME="$SOURCE_DIR-$(uname -o | cut -d '/' -f 2)-$(uname -m)"
74+
75+if [ -e "$INSTALLROOT" ]; then
76+ echo "${INSTALLROOT} exists, move it out of the way first"
77+ exit 2
78+fi
79+
80+if [ -e "/usr/local/$BINDIST_NAME" ]; then
81+ echo "/usr/local/$BINDIST_NAME exists, move it out of the way first"
82+ exit 2
83+fi
84+
85+
86+# Source our shared util functions.
87+#
88+. ${BAKERY_BASE_DIR}/util/util.sh
89+
90+echo "Unpacking sources..."
91+
92+mkdir "$WORKDIR"
93+cd "$WORKDIR"
94+tar zxf "$TARBALL"
95+cd "$SOURCE_DIR"
96+
97+echo "Compiling ..."
98+
99+get_cpuopt
100+
101+# Use gcc rather than g++ to avoid linking libstdc++.so (which we don't need).
102+
103+COMP="gcc -static-libgcc"
104+FLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall $CPUOPT"
105+
106+CC="$COMP" CXX="$COMP" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" \
107+ ./configure \
108+ --prefix=/usr/local/mysql \
109+ --exec-prefix=/usr/local/mysql \
110+ --libexecdir=/usr/local/mysql/bin \
111+ --localstatedir=/usr/local/mysql/data \
112+ --with-comment="(OurDelta - http://ourdelta.org/)" \
113+ --with-system-type=linux-gnu \
114+ --enable-shared --enable-static \
115+ --enable-thread-safe-client --enable-local-infile --with-big-tables \
116+ --without-docs --with-extra-charsets=all \
117+ --with-libwrap --with-ssl --with-readline --with-libevent --with-zlib-dir=bundled \
118+ --with-partition --with-embedded-server \
119+ --with-plugins=max-no-ndb \
120+ > build.log 2>&1
121+make -j4 >> build.log 2>&1
122+
123+echo "Building binary distribution..."
124+
125+make install >> build.log 2>&1
126+mv /usr/local/mysql "/usr/local/$BINDIST_NAME"
127+
128+cd ..
129+cd ..
130+
131+tar zcf "$BINDIST_NAME.tar.gz" -C /usr/local/ "$BINDIST_NAME/" && rm -Rf "/usr/local/$BINDIST_NAME"
132+
133+echo "Successfully build generic bintar package $BINDIST_NAME.tar.gz"
134+
135+exit 0
136
137=== added file 'bakery/tarbake51.sh'
138--- bakery/tarbake51.sh 1970-01-01 00:00:00 +0000
139+++ bakery/tarbake51.sh 2009-09-30 13:37:10 +0000
140@@ -0,0 +1,61 @@
141+#! /bin/bash
142+
143+# Script to produce source tarball from Launchpad bzr repo for OurDelta builds.
144+#
145+# Kristian Nielsen <knielsen@knielsen-hq.org>
146+
147+# Abort on error.
148+set -e
149+
150+# For a release, it is important to know which bzr revision was used
151+# to do the release. So fail if none specified, rather than default to
152+# latest.
153+#
154+# (One can specify last:1 for latest version).
155+#
156+# Also, it is best to use revid: specifications, as revno: numbers are
157+# not stable, and can change whenever new stuff is merged.
158+#
159+# After the release, the revision specified here should be tagged (or
160+# can specify tag: revision if placing tag before release).
161+
162+BZR_REVSPEC="${1}"
163+if [ -z "$BZR_REVSPEC" ]; then
164+ echo 1>&2 "Usage: $0 bzr-revisionspec"
165+ exit 1
166+fi
167+BZR_BRANCH="${2}"
168+if [ -z "$BZR_BRANCH" ]; then
169+ BZR_BRANCH="lp:maria/5.1"
170+fi
171+
172+echo "Checking out sources from bzr repo..."
173+
174+# Make sure we have a shared repository, so we don't have to download
175+# everything every time.
176+
177+bzr info . >/dev/null 2>&1 || bzr init-repo .
178+WORKDIR="build-temp-$$"
179+test -d "$WORKDIR" && rm -Rf "$WORKDIR"
180+bzr checkout "$BZR_BRANCH" "$WORKDIR"
181+
182+echo "Building..."
183+
184+cd "$WORKDIR"
185+BUILD/compile-dist > build.log 2>&1
186+
187+echo "Making source tarball..."
188+
189+make dist >> build.log 2>&1
190+
191+# Grab the version info from configure.in to know tarball names.
192+set $(perl -ne 'print "$1 $2" if /AM_INIT_AUTOMAKE\((.*), (.*)\)/' configure.in)
193+echo >../.mariadb-version "PACKAGE_NAME=$1" # we may change this to mariadb later
194+echo >>../.mariadb-version "VERSION=$2"
195+source ../.mariadb-version
196+TARBALL="${PACKAGE_NAME}-${VERSION}.tar.gz"
197+mv "$TARBALL" ..
198+cd ..
199+rm -Rf "$WORKDIR"
200+
201+echo "Successfully made source tarball $TARBALL"
202
203=== modified file 'bakery/util/util.sh'
204--- bakery/util/util.sh 2008-11-05 02:03:01 +0000
205+++ bakery/util/util.sh 2009-09-30 13:37:10 +0000
206@@ -23,3 +23,18 @@
207 fi
208 return 0
209 }
210+
211+# Setting cpu options.
212+get_cpuopt () {
213+ case "$(gcc -dumpmachine)" in
214+ x86_64-*)
215+ # gcc barfs on -march=... on x64
216+ CPUOPT="-m64 -mtune=generic"
217+ ;;
218+ *)
219+ # we'd use i586 to not trip up mobile/lowpower devices
220+ CPUOPT="-m32 -march=i586 -mtune=generic"
221+ ;;
222+ esac
223+ return 0
224+}

Subscribers

People subscribed via source and target branches