diff options
author | unknown <knielsen@knielsen-hq.org> | 2012-01-23 12:20:16 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2012-01-23 12:20:16 +0100 |
commit | cfd4fcb0bc3d469dfca74dae30d17250d65fdd91 (patch) | |
tree | 63748edc7d791bf41847fa8b678e38d3db952dc6 /debian/autobake-deb.sh | |
parent | 3cb24fff33105f40c2f4b696a06449032ec09604 (diff) | |
download | mariadb-git-cfd4fcb0bc3d469dfca74dae30d17250d65fdd91.tar.gz |
Initial draft for building .deb packages for MariaDB 5.5.
Diffstat (limited to 'debian/autobake-deb.sh')
-rwxr-xr-x | debian/autobake-deb.sh | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh new file mode 100755 index 00000000000..51cda73ee89 --- /dev/null +++ b/debian/autobake-deb.sh @@ -0,0 +1,74 @@ +#!/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" + +# Find major.minor version. +# +source ./VERSION +UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}" +RELEASE_EXTRA=${MYSQL_VERSION_EXTRA} + +RELEASE_NAME=mariadb +PATCHLEVEL="" +LOGSTRING="MariaDB build" + +# Look up distro-version specific stuff. +# +# Libreadline changed to GPLv3. Old GPLv2 version is available, but it +# is called different things on different versions. +CODENAME="$(lsb_release -sc)" +case "${CODENAME}" in + etch) LIBREADLINE_DEV=libreadline-dev ;; + lenny|hardy|intrepid|jaunty|karmic|lucid) LIBREADLINE_DEV='libreadline5-dev | libreadline-dev' ;; + squeeze|maverick|natty) LIBREADLINE_DEV=libreadline5-dev ;; + *) LIBREADLINE_DEV=libreadline-gplv2-dev ;; +esac + +# Clean up build file symlinks that are distro-specific. First remove all, then set +# new links. +DISTRODIRS="$(ls ./debian/dist)" +for distrodir in ${DISTRODIRS}; do + DISTROFILES="$(ls ./debian/dist/${distrodir})" + for distrofile in ${DISTROFILES}; do + rm -f "./debian/${distrofile}"; + done; +done; + +# Set no symlinks for build files in the debian dir, so we avoid adding AppArmor on Debian. +DISTRO="$(lsb_release -si)" +echo "Copying distribution specific build files for ${DISTRO}" +DISTROFILES="$(ls ./debian/dist/${DISTRO})" +for distrofile in ${DISTROFILES}; do + rm -f "./debian/${distrofile}" + sed -e "s/\\\${LIBREADLINE_DEV}/${LIBREADLINE_DEV}/g" < "./debian/dist/${DISTRO}/${distrofile}" > "./debian/${distrofile}" + chmod --reference="./debian/dist/${DISTRO}/${distrofile}" "./debian/${distrofile}" +done; + +# Adjust changelog, add new version. +# +echo "Incrementing changelog and starting build scripts" + +dch -b -D ${CODENAME} -v "${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}~${CODENAME}" "Automatic build with ${LOGSTRING}." + +echo "Creating package version ${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}~${CODENAME} ... " + +# Build the package. +# +fakeroot dpkg-buildpackage -us -uc + +echo "Build complete" + +# end of autobake script |