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
|
|
|
|
|
|
|
|
# Don't run the mysql-test-run test suite as part of build.
|
|
|
|
# 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.
|
|
|
|
export DEB_BUILD_OPTIONS="nocheck"
|
|
|
|
|
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
|
|
|
|
# but only where the distribution can possibly satisfy it
|
|
|
|
if apt-cache madison cracklib2|grep 'cracklib2 *| *2\.[0-8]\.' >/dev/null 2>&1
|
|
|
|
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-02-16 23:18:32 +01:00
|
|
|
MARIADB_OPTIONAL_DEBS="${MARIADB_OPTIONAL_DEBS} cracklib-password-check-10.1"
|
2015-07-21 23:37:05 +03:00
|
|
|
sed -i -e "/\\\${MAYBE_LIBCRACK}/d" 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
|
|
|
|
2017-07-13 21:56:03 +02:00
|
|
|
# same for OpenSSL. Use the correct dependency
|
|
|
|
if apt-cache madison libssl-dev|grep 'libssl-dev *| *1\.1\.' >/dev/null 2>&1
|
|
|
|
then
|
|
|
|
LIBSSL='libssl1.0-dev'
|
|
|
|
else
|
|
|
|
LIBSSL='libssl-dev'
|
|
|
|
fi
|
|
|
|
sed -i -e "s/\\\${LIBSSL}/${LIBSSL}/g" debian/control
|
|
|
|
|
2012-01-23 12:20:16 +01:00
|
|
|
# Adjust changelog, add new version.
|
|
|
|
#
|
|
|
|
echo "Incrementing changelog and starting build scripts"
|
|
|
|
|
2018-06-15 10:14:18 +02:00
|
|
|
if [[ "$CODENAME" == bionic ]]; then
|
|
|
|
EPOCH="1:"
|
|
|
|
fi
|
|
|
|
dch -b -D ${CODENAME} -v "${EPOCH}${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}1~${CODENAME}" "Automatic build with ${LOGSTRING}."
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2018-06-15 10:14:18 +02:00
|
|
|
echo "Creating package version ${EPOCH}${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
|