2012-01-23 12:20:16 +01:00
|
|
|
#!/bin/bash
|
2016-11-08 21:15:33 +01:00
|
|
|
#
|
|
|
|
# Build MariaDB .deb packages for test and release at mariadb.org
|
|
|
|
#
|
2012-01-23 12:20:16 +01:00
|
|
|
|
|
|
|
# Exit immediately on any error
|
|
|
|
set -e
|
|
|
|
|
2016-08-18 10:47:20 +02:00
|
|
|
# On Buildbot, don't run the mysql-test-run test suite as part of build.
|
2012-01-23 12:20:16 +01:00
|
|
|
# It takes a lot of time, and we will do a better test anyway in
|
|
|
|
# Buildbot, running the test suite from installed .debs on a clean VM.
|
2016-08-18 10:47:20 +02:00
|
|
|
# On Travis-CI we want to simulate the full build, including tests.
|
|
|
|
# Also on Travis-CI it is useful not to override the DEB_BUILD_OPTIONS
|
|
|
|
# at this stage at all.
|
|
|
|
if [[ ! $TRAVIS ]]
|
|
|
|
then
|
|
|
|
export DEB_BUILD_OPTIONS="nocheck"
|
|
|
|
fi
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-11-08 21:15:33 +01:00
|
|
|
# Travis-CI optimizations
|
2016-10-26 01:12:18 +02:00
|
|
|
if [[ $TRAVIS ]]
|
|
|
|
then
|
2016-11-08 21:15:33 +01:00
|
|
|
# On Travis-CI, the log must stay under 4MB so make the build less verbose
|
|
|
|
sed -i -e '/Add support for verbose builds/,+2d' debian/rules
|
|
|
|
|
|
|
|
# Don't include test suite package on Travis-CI to make the build time shorter
|
2016-10-26 01:12:18 +02:00
|
|
|
sed '/Package: mariadb-test-data/,+26d' -i debian/control
|
|
|
|
sed '/Package: mariadb-test/,+34d' -i debian/control
|
|
|
|
fi
|
|
|
|
|
2013-09-10 10:30:07 +02:00
|
|
|
|
2016-11-08 21:15:33 +01:00
|
|
|
# Look up distro-version specific stuff
|
2016-11-26 13:22:10 +01:00
|
|
|
#
|
2016-10-21 12:52:36 +02:00
|
|
|
# Always keep the actual packaging as up-to-date as possible following the latest
|
|
|
|
# Debian policy and targetting Debian Sid. Then case-by-case run in autobake-deb.sh
|
|
|
|
# tests for backwards compatibility and strip away parts on older builders.
|
2015-07-21 22:37:05 +02:00
|
|
|
|
2016-11-26 13:22:10 +01:00
|
|
|
# If iproute2 is not available (before Debian Jessie and Ubuntu Trusty)
|
|
|
|
# fall back to the old iproute package.
|
|
|
|
if ! apt-cache madison iproute2 | grep 'iproute2 *|' >/dev/null 2>&1
|
|
|
|
then
|
|
|
|
sed 's/iproute2/iproute/' -i debian/control
|
|
|
|
fi
|
|
|
|
|
2016-10-21 12:52:36 +02:00
|
|
|
# If libcrack2 (>= 2.9.0) is not available (before Debian Jessie and Ubuntu Trusty)
|
|
|
|
# clean away the cracklib stanzas so the package can build without them.
|
|
|
|
if ! apt-cache madison libcrack2-dev | grep 'libcrack2-dev *| *2\.9' >/dev/null 2>&1
|
2015-02-16 23:18:32 +01:00
|
|
|
then
|
2016-10-21 12:52:36 +02:00
|
|
|
sed '/libcrack2-dev/d' -i debian/control
|
2016-11-27 20:40:35 +01:00
|
|
|
sed '/Package: mariadb-plugin-cracklib/,+9d' -i debian/control
|
2016-10-06 18:30:20 +02:00
|
|
|
fi
|
|
|
|
|
2016-10-21 12:52:36 +02:00
|
|
|
# If libpcre3-dev (>= 2:8.35-3.2~) is not available (before Debian Jessie or Ubuntu Wily)
|
|
|
|
# clean away the PCRE3 stanzas so the package can build without them.
|
2016-10-06 18:30:20 +02:00
|
|
|
# Update check when version 2:8.40 or newer is available.
|
2016-10-21 12:52:36 +02:00
|
|
|
if ! apt-cache madison libpcre3-dev | grep 'libpcre3-dev *| *2:8\.3[2-9]' >/dev/null 2>&1
|
2016-10-06 18:30:20 +02:00
|
|
|
then
|
2016-10-21 12:52:36 +02:00
|
|
|
sed '/libpcre3-dev/d' -i debian/control
|
2015-02-16 23:18:32 +01:00
|
|
|
fi
|
2012-08-23 15:32:03 +02:00
|
|
|
|
2016-10-29 01:43:45 +02:00
|
|
|
# If libsystemd-dev is not available (before Debian Jessie or Ubuntu Wily)
|
|
|
|
# clean away the systemd stanzas so the package can build without them.
|
|
|
|
if ! apt-cache madison libsystemd-dev | grep 'libsystemd-dev' >/dev/null 2>&1
|
|
|
|
then
|
|
|
|
sed '/dh-systemd/d' -i debian/control
|
|
|
|
sed '/libsystemd-dev/d' -i debian/control
|
|
|
|
sed 's/ --with systemd//' -i debian/rules
|
|
|
|
sed '/systemd/d' -i debian/rules
|
|
|
|
sed '/\.service/d' -i debian/rules
|
|
|
|
sed '/galera_new_cluster/d' -i debian/mariadb-server-10.2.install
|
|
|
|
sed '/galera_recovery/d' -i debian/mariadb-server-10.2.install
|
|
|
|
sed '/mariadb-service-convert/d' -i debian/mariadb-server-10.2.install
|
|
|
|
fi
|
|
|
|
|
2017-03-26 17:13:29 +02:00
|
|
|
# Convert gcc version to numberical value. Format is Mmmpp where M is Major
|
|
|
|
# version, mm is minor version and p is patch.
|
|
|
|
GCCVERSION=$(gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$/&00/')
|
|
|
|
# Don't build rocksdb package if gcc version is less than 4.8 or we are running on
|
|
|
|
# x86 32 bit.
|
2017-04-01 09:12:28 +02:00
|
|
|
if [[ $GCCVERSION -lt 40800 ]] || [[ $(arch) =~ i[346]86 ]]
|
2017-03-26 17:13:29 +02:00
|
|
|
then
|
2017-11-29 18:36:17 +01:00
|
|
|
sed '/Package: mariadb-plugin-rocksdb/,+9d' -i debian/control
|
2017-03-26 17:13:29 +02:00
|
|
|
fi
|
2017-05-08 11:26:23 +02:00
|
|
|
if [[ $GCCVERSION -lt 40800 ]]
|
|
|
|
then
|
|
|
|
sed '/Package: mariadb-plugin-aws-key-management-10.2/,+13d' -i debian/control
|
|
|
|
fi
|
|
|
|
|
2017-03-26 17:13:29 +02:00
|
|
|
|
2016-11-08 21:15:33 +01:00
|
|
|
# Adjust changelog, add new version
|
2012-01-23 12:20:16 +01:00
|
|
|
echo "Incrementing changelog and starting build scripts"
|
|
|
|
|
2016-11-08 21:15:33 +01:00
|
|
|
# Find major.minor version
|
|
|
|
source ./VERSION
|
|
|
|
UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}"
|
|
|
|
PATCHLEVEL="+maria"
|
|
|
|
LOGSTRING="MariaDB build"
|
|
|
|
CODENAME="$(lsb_release -sc)"
|
|
|
|
|
2016-07-09 21:03:02 +02:00
|
|
|
dch -b -D ${CODENAME} -v "${UPSTREAM}${PATCHLEVEL}~${CODENAME}" "Automatic build with ${LOGSTRING}."
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-07-09 21:03:02 +02:00
|
|
|
echo "Creating package version ${UPSTREAM}${PATCHLEVEL}~${CODENAME} ... "
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-11-08 21:15:33 +01:00
|
|
|
# Build the package
|
2015-07-22 12:45:43 +02:00
|
|
|
# Pass -I so that .git and other unnecessary temporary and source control files
|
2016-11-08 21:15:33 +01:00
|
|
|
# will be ignored by dpkg-source when creating the tar.gz source package.
|
2016-10-29 00:30:50 +02:00
|
|
|
# Use -b to build binary only packages as there is no need to waste time on
|
|
|
|
# generating the source package.
|
|
|
|
fakeroot dpkg-buildpackage -us -uc -I -b
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-11-08 21:18:19 +01:00
|
|
|
# Don't log package contents on Travis-CI to save time and log size
|
|
|
|
if [[ ! $TRAVIS ]]
|
|
|
|
then
|
|
|
|
echo "List package contents ..."
|
|
|
|
cd ..
|
|
|
|
for package in `ls *.deb`
|
|
|
|
do
|
|
|
|
echo $package | cut -d '_' -f 1
|
|
|
|
dpkg-deb -c $package | awk '{print $1 " " $2 " " $6}' | sort -k 3
|
|
|
|
echo "------------------------------------------------"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2012-01-23 12:20:16 +01:00
|
|
|
echo "Build complete"
|