66# Exit immediately on any error
77set -e
88
9- # This file is invocated from Buildbot and Travis-CI to build deb packages.
10- # As both of those CI systems have many parallel jobs that include different
11- # parts of the test suite, we don't need to run the mysql-test-run at all when
12- # building the deb packages here.
13- export DEB_BUILD_OPTIONS=" nocheck $DEB_BUILD_OPTIONS "
14-
15- # Travis-CI optimizations
16- if [[ $TRAVIS ]]
17- then
18- # On Travis-CI, the log must stay under 4MB so make the build less verbose
19- sed -i -e ' /Add support for verbose builds/,+2d' debian/rules
20-
21- # Don't include test suite package on Travis-CI to make the build time shorter
22- sed ' /Package: mariadb-test-data/,/^$/d' -i debian/control
23- sed ' /Package: mariadb-test/,/^$/d' -i debian/control
24-
25- # Don't build the test package at all to save time and disk space
26- sed ' s|DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test|DINSTALL_MYSQLTESTDIR=false|' -i debian/rules
27-
28- # Also skip building RocksDB and TokuDB to save even more time and disk space
29- sed ' s|-DDEB|-DPLUGIN_TOKUDB=NO -DPLUGIN_MROONGA=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_SPIDER=NO -DPLUGIN_OQGRAPH=NO -DPLUGIN_PERFSCHEMA=NO -DPLUGIN_SPHINX=NO -WITH_EMBEDDED_SERVER=OFF -DDEB|' -i debian/rules
30- fi
31-
32- # Convert gcc version to numberical value. Format is Mmmpp where M is Major
33- # version, mm is minor version and p is patch.
34- # -dumpfullversion & -dumpversion to make it uniform across old and new (>=7)
35- GCCVERSION=$( gcc -dumpfullversion -dumpversion | sed -e ' s/\.\([0-9][0-9]\)/\1/g' \
36- -e ' s/\.\([0-9]\)/0\1/g' \
37- -e ' s/^[0-9]\{3,4\}$/&00/' )
9+ # On Buildbot, don't run the mysql-test-run test suite as part of build.
10+ # It takes a lot of time, and we will do a better test anyway in
11+ # Buildbot, running the test suite from installed .debs on a clean VM.
12+ export DEB_BUILD_OPTIONS=" nocheck"
3813
3914# Look up distro-version specific stuff
4015#
@@ -50,49 +25,8 @@ case "${CODENAME}" in
5025;;
5126esac
5227
53- # If libcrack2 (>= 2.9.0) is not available (before Debian Jessie and Ubuntu Trusty)
54- # clean away the cracklib stanzas so the package can build without them.
55- if ! apt-cache madison libcrack2-dev | grep ' libcrack2-dev *| *2\.9' > /dev/null 2>&1
56- then
57- sed ' /libcrack2-dev/d' -i debian/control
58- sed ' /Package: mariadb-plugin-cracklib/,/^$/d' -i debian/control
59- fi
60-
61- # If libpcre3-dev (>= 2:8.35-3.2~) is not available (before Debian Jessie or Ubuntu Wily)
62- # clean away the PCRE3 stanzas so the package can build without them.
63- # Update check when version 2:8.40 or newer is available.
64- if ! apt-cache madison libpcre3-dev | grep ' libpcre3-dev *| *2:8\.3[2-9]' > /dev/null 2>&1
65- then
66- sed ' /libpcre3-dev/d' -i debian/control
67- fi
68-
69- # If libsystemd-dev is not available (before Debian Jessie or Ubuntu Wily)
70- # clean away the systemd stanzas so the package can build without them.
71- if ! apt-cache madison libsystemd-dev | grep ' libsystemd-dev' > /dev/null 2>&1
72- then
73- sed ' /dh-systemd/d' -i debian/control
74- sed ' /libsystemd-dev/d' -i debian/control
75- sed ' s/ --with systemd//' -i debian/rules
76- sed ' /systemd/d' -i debian/rules
77- sed ' /\.service/d' -i debian/rules
78- sed ' /galera_new_cluster/d' -i debian/mariadb-server-10.3.install
79- sed ' /galera_recovery/d' -i debian/mariadb-server-10.3.install
80- sed ' /mariadb-service-convert/d' -i debian/mariadb-server-10.3.install
81- fi
82-
83- # The binaries should be fully hardened by default. However TokuDB compilation seems to fail on
84- # Debian Jessie and older and on Ubuntu Xenial and older with the following error message:
85- # /usr/bin/ld.bfd.real: /tmp/ccOIwjFo.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol
86- # `toku_product_name_strings' can not be used when making a shared object; recompile with -fPIC
87- # Therefore we need to disable PIE on those releases using gcc as proxy for detection.
88- if [[ $GCCVERSION -lt 60000 ]]
89- then
90- sed ' s/hardening=+all$/hardening=+all,-pie/' -i debian/rules
91- fi
92-
93- # Don't build rocksdb package if gcc version is less than 4.8 or we are running on
94- # x86 32 bit.
95- if [[ $GCCVERSION -lt 40800 ]] || [[ $( arch) =~ i[346]86 ]] || [[ $TRAVIS ]]
28+ # Don't build rocksdb package on x86 32 bit.
29+ if [[ $( arch) =~ i[346]86 ]]
9630then
9731 sed ' /Package: mariadb-plugin-rocksdb/,/^$/d' -i debian/control
9832fi
11246 sed ' /Package: mariadb-plugin-cassandra/,/^$/d' -i debian/control
11347fi
11448
115- # From Debian Stretch/Ubuntu Bionic onwards dh-systemd is just an empty
116- # transitional metapackage and the functionality was merged into debhelper.
117- # In Ubuntu Hirsute is was completely removed, so it can't be referenced anymore.
118- # Keep using it only on Debian Jessie and Ubuntu Xenial.
119- if apt-cache madison dh-systemd | grep ' dh-systemd' > /dev/null 2>&1
120- then
121- sed ' s/debhelper (>= 9.20160709~),/debhelper (>= 9), dh-systemd,/' -i debian/control
122- fi
123-
124- # Mroonga, TokuDB never built on Travis CI anyway, see build flags above
125- if [[ $TRAVIS ]]
126- then
127- sed -i -e " /Package: mariadb-plugin-tokudb/,/^$/d" debian/control
128- sed -i -e " /Package: mariadb-plugin-mroonga/,/^$/d" debian/control
129- sed -i -e " /Package: mariadb-plugin-spider/,/^$/d" debian/control
130- sed -i -e " /Package: mariadb-plugin-oqgraph/,/^$/d" debian/control
131- sed -i -e " /usr\/lib\/mysql\/plugin\/ha_sphinx.so/d" debian/mariadb-server-10.3.install
132- sed -i -e " /Package: libmariadbd-dev/,/^$/d" debian/control
133- fi
134-
13549# Adjust changelog, add new version
13650echo " Incrementing changelog and starting build scripts"
13751
@@ -146,13 +60,6 @@ dch -b -D ${CODENAME} -v "${EPOCH}${UPSTREAM}${PATCHLEVEL}~${CODENAME}" "Automat
14660
14761echo " Creating package version ${EPOCH}${UPSTREAM}${PATCHLEVEL} ~${CODENAME} ... "
14862
149- # On Travis CI, use -b to build binary only packages as there is no need to
150- # waste time on generating the source package.
151- if [[ $TRAVIS ]]
152- then
153- BUILDPACKAGE_FLAGS=" -b"
154- fi
155-
15663# Build the package
15764# Pass -I so that .git and other unnecessary temporary and source control files
15865# will be ignored by dpkg-source when creating the tar.gz source package.
@@ -161,17 +68,13 @@ fakeroot dpkg-buildpackage -us -uc -I $BUILDPACKAGE_FLAGS -j$(nproc)
16168# If the step above fails due to missing dependencies, you can manually run
16269# sudo mk-build-deps debian/control -r -i
16370
164- # Don't log package contents on Travis-CI to save time and log size
165- if [[ ! $TRAVIS ]]
166- then
167- echo " List package contents ..."
168- cd ..
169- for package in ` ls * .deb`
170- do
171- echo $package | cut -d ' _' -f 1
172- dpkg-deb -c $package | awk ' {print $1 " " $2 " " $6}' | sort -k 3
173- echo " ------------------------------------------------"
174- done
175- fi
71+ echo " List package contents ..."
72+ cd ..
73+ for package in ` ls * .deb`
74+ do
75+ echo $package | cut -d ' _' -f 1
76+ dpkg-deb -c $package | awk ' {print $1 " " $2 " " $6}' | sort -k 3
77+ echo " ------------------------------------------------"
78+ done
17679
17780echo " Build complete"
0 commit comments