2012-01-23 12:20:16 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Build MariaDB .deb packages.
|
|
|
|
# Based on OurDelta .deb packaging scripts, which are in turn based on Debian
|
|
|
|
# MySQL packages.
|
|
|
|
|
|
|
|
# Exit immediately on any error
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Debug script and command lines
|
|
|
|
#set -x
|
|
|
|
|
2016-08-18 12:47:20 +04: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 12:47:20 +04: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
|
|
|
|
2015-02-16 23:18:32 +01:00
|
|
|
export MARIADB_OPTIONAL_DEBS=""
|
2013-09-10 10:30:07 +02:00
|
|
|
|
2012-01-23 12:20:16 +01:00
|
|
|
# Find major.minor version.
|
|
|
|
#
|
|
|
|
source ./VERSION
|
2012-12-06 16:34:02 +01:00
|
|
|
UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}"
|
|
|
|
RELEASE_EXTRA=""
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2013-04-16 09:42:09 +02:00
|
|
|
RELEASE_NAME=""
|
|
|
|
PATCHLEVEL="+maria"
|
2012-01-23 12:20:16 +01:00
|
|
|
LOGSTRING="MariaDB build"
|
|
|
|
|
|
|
|
# Look up distro-version specific stuff.
|
2015-07-21 23:37:05 +03:00
|
|
|
|
2012-01-23 12:20:16 +01:00
|
|
|
CODENAME="$(lsb_release -sc)"
|
|
|
|
|
2015-02-16 23:18:32 +01:00
|
|
|
# add libcrack2 (>= 2.9.0) as a build dependency
|
2016-08-18 12:47:20 +04:00
|
|
|
# but only where the distribution can possibly satisfy it and if not on Travis-CI
|
|
|
|
if $TRAVIS || apt-cache madison cracklib2|grep 'cracklib2 *| *2\.[0-8]\.' >/dev/null 2>&1
|
2015-02-16 23:18:32 +01:00
|
|
|
then
|
2015-07-21 23:37:05 +03:00
|
|
|
# Anything in MARIADB_OPTIONAL_DEBS is omitted from the resulting
|
|
|
|
# packages by snipped in rules file
|
2015-11-20 18:43:22 +01:00
|
|
|
MARIADB_OPTIONAL_DEBS="${MARIADB_OPTIONAL_DEBS} cracklib-password-check-10.2"
|
2015-07-21 23:37:05 +03:00
|
|
|
sed -i -e "/\\\${MAYBE_LIBCRACK}/d" debian/control
|
2015-11-24 11:57:10 +02:00
|
|
|
# Remove package entry from control file completely so that
|
|
|
|
# resulting Debian source package will actually be buildable
|
|
|
|
sed -i -e "/Package: mariadb-cracklib-password-check/,+6d" debian/control
|
2015-02-16 23:18:32 +01:00
|
|
|
else
|
|
|
|
MAYBE_LIBCRACK='libcrack2-dev (>= 2.9.0),'
|
2015-07-21 23:37:05 +03:00
|
|
|
sed -i -e "s/\\\${MAYBE_LIBCRACK}/${MAYBE_LIBCRACK}/g" debian/control
|
2015-02-16 23:18:32 +01:00
|
|
|
fi
|
2012-08-23 15:32:03 +02:00
|
|
|
|
2012-01-23 12:20:16 +01:00
|
|
|
# Adjust changelog, add new version.
|
|
|
|
#
|
|
|
|
echo "Incrementing changelog and starting build scripts"
|
|
|
|
|
2012-01-24 10:47:57 +01:00
|
|
|
dch -b -D ${CODENAME} -v "${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}1~${CODENAME}" "Automatic build with ${LOGSTRING}."
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2012-01-24 10:47:57 +01:00
|
|
|
echo "Creating package version ${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}1~${CODENAME} ... "
|
2012-01-23 12:20:16 +01:00
|
|
|
|
|
|
|
# Build the package.
|
2015-07-22 13:45:43 +03:00
|
|
|
# Pass -I so that .git and other unnecessary temporary and source control files
|
|
|
|
# will be ignored by dpkg-source when createing the tar.gz source package
|
|
|
|
fakeroot dpkg-buildpackage -us -uc -I
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2013-09-10 10:30:07 +02:00
|
|
|
[ -e debian/autorm-file ] && rm -vf `cat debian/autorm-file`
|
|
|
|
|
2012-01-23 12:20:16 +01:00
|
|
|
echo "Build complete"
|
|
|
|
|
|
|
|
# end of autobake script
|