2012-01-23 12:20:16 +01:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
|
|
|
export DH_VERBOSE=1
|
2018-10-23 16:42:10 +02:00
|
|
|
export DEB_BUILD_HARDENING=1
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-10-09 22:39:01 +02:00
|
|
|
# enable Debian Hardening
|
|
|
|
# see: https://wiki.debian.org/Hardening
|
Misc Debian/Salsa-CI fixes (#2299)
* Deb: Handle codename 'n/a' from Debian Sid properly and autobake-deb cleanup
This fixes autobake-deb.sh builds on Sid which was visible as 4 failing
build steps on Salsa-CI.
- In Sid the LSBNAME might evaluate to 'n/a', so accept it as 'Sid' to
fix builds that failed with error:
Error - unknown release codename n/a
- Refactor list to have Ubuntu versions first, then Debian, and as last
the special case of Debian Sid
- Fix minor syntax issues detected by Shellcheck
Also remove useless DEB_HOST_ARCH_CPU check from debian/rules:
* It was never in effect as the 'sed' in autobake-deb.sh cleared it anyway
* The variable name was wrong and always empty
* If variable would have been correct, logic was still reversed
- Define 3h timeout as the default 1h timeout on Gitlab.com (and others)
is usually not enough for initial (uncached) MariaDB builds.
- Replace Buster to Bookworm/Sid upgrade testing with upgrade inside Buster
testing as direct upgrades from Stretch to Bullseye and Buster to Bookworm
are no longer possible due to:
Bug#993755: libcrypt.so.1: cannot open shared object file when
upgrading from Stretch to Sid (https://bugs.debian.org/993755)
- Stop ignoring MariaDB.org 10.6 to this version upgrade testing failures
to reveal bug MDEV-28640. Originally this step was failing as the uring
dependencies in upstream builders lagged behind and there was nothing
that needed work, only time time to resolve. Now there is an actual bug
in packaging that should be visible as a CI failure.
- Stop testing for 'service mysql status' on systems that upgraded from
MySQL 8.0 to MariaDB.org vended 10.6. Due to some unidentified debian/control
changes in 10.6 on upstream the upgrade is no longer compatible in
a way that would maintain the init.d script with name 'mysql'.
- Fix typos where mergers had changed occurrences of 10.5 to 10.6 while
they intentionally need to be exactly 10.5, otherwise the meaning
changes.
- Align autopkgtest code with downstream official Debian packaging one.
This is change is safe on a stable branch because is only affects builds
and testing, not any actual usage of MariaDB 10.6.
- Standardize on using capitalized 'YES' in CMake build options
(instead of 'yes' or mixed case)
- Add some comments to better document debian/rules
- Fix typo in Lintian overrides
Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634
MariaDB ticket: https://jira.mariadb.org/browse/MDEV-25633
When built with LTO on Ubuntu, MariaDB does not catch an exception when
the uring initialization fails due to a low RLIMIT_MEMLOCK value.
This commit amends the commit 0609b345554f9a148e165c497aadbe368e0900aa
to be identical to the one done downstream in Debian:
https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/8d20ca979cf422d3a507283b86c2547d78559179
This way both the inline comments and 'git blame' for this section will
show properly why this is needed, and the fix is one that is fully tested
on Debian and Ubuntu.
Also having this section fully identical in upstream MariaDB and downstream
Debian will make the packaging maintenance easier as 'diff` runs on this
file will not flag this as a difference anymore.
In MDEV-28640 the init script failed to stop/start the MariaDB server
due to missing mysqladmin on the system. This was however very hard to
spot from the console output.
Add an explicit check for the binary the script depends on, and fail
verbosely if the dependency is missing.
2022-11-11 08:51:34 +01:00
|
|
|
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
|
|
|
|
|
|
|
# Disable LTO on Ubuntu, see LP: #1970634 and https://jira.mariadb.org/browse/MDEV-25633
|
|
|
|
ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes), yes)
|
|
|
|
export DEB_BUILD_MAINT_OPTIONS += optimize=-lto
|
|
|
|
endif
|
|
|
|
|
2016-10-09 22:39:01 +02:00
|
|
|
DPKG_EXPORT_BUILDFLAGS = 1
|
2020-06-28 16:35:02 +02:00
|
|
|
# Include all defaults, including buildflags.mk
|
2018-05-29 08:50:55 +02:00
|
|
|
include /usr/share/dpkg/default.mk
|
2020-04-05 12:05:56 +02:00
|
|
|
# CPPFLAGS are nor read by CMake, so copy them to CXXFLAGS
|
|
|
|
# See why at https://cmake.org/Bug/view.php?id=12928
|
|
|
|
# This is needed for e.g. all automatic Debian hardening flags to apply on all cmake builds.
|
|
|
|
CFLAGS+=$(CPPFLAGS)
|
|
|
|
CXXFLAGS+=$(CPPFLAGS)
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2020-12-25 16:41:03 +01:00
|
|
|
# Only do a strict symbol checking on Linux
|
|
|
|
ifneq (,$(filter linux,$(DEB_HOST_ARCH_OS)))
|
|
|
|
DPKG_GENSYMBOLS_CHECK_LEVEL := 4
|
|
|
|
endif
|
|
|
|
|
2016-10-09 22:39:01 +02:00
|
|
|
BUILDDIR := builddir
|
2018-05-29 08:50:55 +02:00
|
|
|
DEB_VERSION_REVISION := $(shell echo $(DEB_VERSION) | sed -e 's/^.*-//')
|
|
|
|
RELEASE := $(shell lsb_release -r -s) # Use changelog based DEB_DISTRIBUTION instead?
|
2016-10-09 22:39:01 +02:00
|
|
|
TMP:=$(CURDIR)/debian/tmp
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2020-06-28 16:35:02 +02:00
|
|
|
# According to Debian Policy version 4.2.0 builds should be as verbose as
|
|
|
|
# possible unless 'terse' is specifically passed.
|
|
|
|
ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
|
|
|
|
export DH_VERBOSE=1
|
|
|
|
endif
|
|
|
|
|
2016-08-18 10:47:20 +02:00
|
|
|
# Parallel build support as advised
|
|
|
|
# at https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options
|
|
|
|
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
|
|
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
2017-11-17 05:17:26 +01:00
|
|
|
MAKEFLAGS += -j$(NUMJOBS)
|
2016-10-09 22:39:01 +02:00
|
|
|
else
|
2020-12-30 09:08:23 +01:00
|
|
|
# NUMJOBS cannot be empty as it is used as a parameter to mtr, default to 'auto'.
|
|
|
|
NUMJOBS = auto
|
2012-01-23 12:20:16 +01:00
|
|
|
endif
|
|
|
|
|
2021-09-06 05:22:45 +02:00
|
|
|
# RocksDB cannot build on 32-bit platforms
|
|
|
|
ifeq (32,$(DEB_HOST_ARCH_BITS))
|
|
|
|
CMAKEFLAGS += -DPLUGIN_ROCKSDB=NO
|
|
|
|
endif
|
|
|
|
|
2021-03-10 08:51:42 +01:00
|
|
|
# Cross building requires stack direction instruction
|
2020-12-25 16:41:03 +01:00
|
|
|
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
|
|
|
|
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),alpha amd64 arm arm64 i386 ia64 m68k mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sh4 sparc64))
|
|
|
|
CMAKEFLAGS += -DSTACK_DIRECTION=-1
|
|
|
|
endif
|
|
|
|
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),hppa))
|
|
|
|
CMAKEFLAGS += -DSTACK_DIRECTION=1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2021-03-10 08:51:42 +01:00
|
|
|
# Only attempt to build with PMEM on archs that have package libpmem-dev available
|
|
|
|
# See https://packages.debian.org/search?searchon=names&keywords=libpmem-dev
|
2022-03-18 07:36:53 +01:00
|
|
|
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),amd64 arm64 ppc64el riscv64))
|
Misc Debian/Salsa-CI fixes (#2299)
* Deb: Handle codename 'n/a' from Debian Sid properly and autobake-deb cleanup
This fixes autobake-deb.sh builds on Sid which was visible as 4 failing
build steps on Salsa-CI.
- In Sid the LSBNAME might evaluate to 'n/a', so accept it as 'Sid' to
fix builds that failed with error:
Error - unknown release codename n/a
- Refactor list to have Ubuntu versions first, then Debian, and as last
the special case of Debian Sid
- Fix minor syntax issues detected by Shellcheck
Also remove useless DEB_HOST_ARCH_CPU check from debian/rules:
* It was never in effect as the 'sed' in autobake-deb.sh cleared it anyway
* The variable name was wrong and always empty
* If variable would have been correct, logic was still reversed
- Define 3h timeout as the default 1h timeout on Gitlab.com (and others)
is usually not enough for initial (uncached) MariaDB builds.
- Replace Buster to Bookworm/Sid upgrade testing with upgrade inside Buster
testing as direct upgrades from Stretch to Bullseye and Buster to Bookworm
are no longer possible due to:
Bug#993755: libcrypt.so.1: cannot open shared object file when
upgrading from Stretch to Sid (https://bugs.debian.org/993755)
- Stop ignoring MariaDB.org 10.6 to this version upgrade testing failures
to reveal bug MDEV-28640. Originally this step was failing as the uring
dependencies in upstream builders lagged behind and there was nothing
that needed work, only time time to resolve. Now there is an actual bug
in packaging that should be visible as a CI failure.
- Stop testing for 'service mysql status' on systems that upgraded from
MySQL 8.0 to MariaDB.org vended 10.6. Due to some unidentified debian/control
changes in 10.6 on upstream the upgrade is no longer compatible in
a way that would maintain the init.d script with name 'mysql'.
- Fix typos where mergers had changed occurrences of 10.5 to 10.6 while
they intentionally need to be exactly 10.5, otherwise the meaning
changes.
- Align autopkgtest code with downstream official Debian packaging one.
This is change is safe on a stable branch because is only affects builds
and testing, not any actual usage of MariaDB 10.6.
- Standardize on using capitalized 'YES' in CMake build options
(instead of 'yes' or mixed case)
- Add some comments to better document debian/rules
- Fix typo in Lintian overrides
Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634
MariaDB ticket: https://jira.mariadb.org/browse/MDEV-25633
When built with LTO on Ubuntu, MariaDB does not catch an exception when
the uring initialization fails due to a low RLIMIT_MEMLOCK value.
This commit amends the commit 0609b345554f9a148e165c497aadbe368e0900aa
to be identical to the one done downstream in Debian:
https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/8d20ca979cf422d3a507283b86c2547d78559179
This way both the inline comments and 'git blame' for this section will
show properly why this is needed, and the fix is one that is fully tested
on Debian and Ubuntu.
Also having this section fully identical in upstream MariaDB and downstream
Debian will make the packaging maintenance easier as 'diff` runs on this
file will not flag this as a difference anymore.
In MDEV-28640 the init script failed to stop/start the MariaDB server
due to missing mysqladmin on the system. This was however very hard to
spot from the console output.
Add an explicit check for the binary the script depends on, and fail
verbosely if the dependency is missing.
2022-11-11 08:51:34 +01:00
|
|
|
CMAKEFLAGS += -DWITH_PMEM=YES
|
2021-03-10 08:51:42 +01:00
|
|
|
endif
|
|
|
|
|
2016-10-09 22:39:01 +02:00
|
|
|
# Add support for verbose builds
|
|
|
|
MAKEFLAGS += VERBOSE=1
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-10-09 22:39:01 +02:00
|
|
|
override_dh_auto_clean:
|
2012-01-23 12:20:16 +01:00
|
|
|
@echo "RULES.$@"
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
2021-06-11 14:58:50 +02:00
|
|
|
rm -rf $(BUILDDIR) builddir-native mysql-test/unstable-tests
|
2020-04-05 12:05:56 +02:00
|
|
|
debconf-updatepo # Update po-files when clean runs before each build
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-10-09 22:39:01 +02:00
|
|
|
override_dh_auto_configure:
|
2012-01-23 12:20:16 +01:00
|
|
|
@echo "RULES.$@"
|
|
|
|
dh_testdir
|
|
|
|
|
2020-04-05 12:05:56 +02:00
|
|
|
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
|
|
|
|
dpkg-architecture -a$(DEB_BUILD_ARCH) -f -c dh_auto_configure --builddirectory=builddir-native
|
|
|
|
dh_auto_build --builddirectory=builddir-native -- import_executables
|
2016-10-09 22:39:01 +02:00
|
|
|
endif
|
2021-08-11 03:28:08 +02:00
|
|
|
|
2020-11-27 15:05:17 +01:00
|
|
|
echo "server:Version=$(DEB_VERSION)" >> debian/substvars
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2021-09-06 05:22:45 +02:00
|
|
|
# Don't build ColumnStore as part of the native build as it does not meet the
|
|
|
|
# quality standards in Debian. Also building it requires an extra 4 GB of disk
|
|
|
|
# space which makes native Debian builds fail as the total disk space needed
|
|
|
|
# for MariaDB becomes over 10 GB. Only build CS via autobake-deb.sh.
|
2020-12-25 16:41:03 +01:00
|
|
|
PATH=$${MYSQL_BUILD_PATH:-"/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin"} \
|
|
|
|
NO_UPDATE_BUILD_VERSION=1 \
|
|
|
|
dh_auto_configure --builddirectory=$(BUILDDIR) -- \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2016-10-09 22:39:01 +02:00
|
|
|
$(CMAKEFLAGS) \
|
2020-12-25 16:41:03 +01:00
|
|
|
$(if $(filter $(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)),,-DIMPORT_EXECUTABLES=$(CURDIR)/builddir-native/import_executables.cmake) \
|
2016-10-09 22:39:01 +02:00
|
|
|
-DCOMPILATION_COMMENT="mariadb.org binary distribution" \
|
2018-05-29 08:50:55 +02:00
|
|
|
-DMYSQL_SERVER_SUFFIX="-$(DEB_VERSION_REVISION)" \
|
|
|
|
-DSYSTEM_TYPE="debian-$(DEB_HOST_GNU_SYSTEM)" \
|
|
|
|
-DCMAKE_SYSTEM_PROCESSOR=$(DEB_HOST_ARCH) \
|
2016-10-09 22:39:01 +02:00
|
|
|
-DBUILD_CONFIG=mysql_release \
|
2020-12-20 22:48:20 +01:00
|
|
|
-DCONC_DEFAULT_CHARSET=utf8mb4 \
|
2018-06-29 14:11:38 +02:00
|
|
|
-DPLUGIN_AWS_KEY_MANAGEMENT=NO \
|
Misc Debian/Salsa-CI fixes (#2299)
* Deb: Handle codename 'n/a' from Debian Sid properly and autobake-deb cleanup
This fixes autobake-deb.sh builds on Sid which was visible as 4 failing
build steps on Salsa-CI.
- In Sid the LSBNAME might evaluate to 'n/a', so accept it as 'Sid' to
fix builds that failed with error:
Error - unknown release codename n/a
- Refactor list to have Ubuntu versions first, then Debian, and as last
the special case of Debian Sid
- Fix minor syntax issues detected by Shellcheck
Also remove useless DEB_HOST_ARCH_CPU check from debian/rules:
* It was never in effect as the 'sed' in autobake-deb.sh cleared it anyway
* The variable name was wrong and always empty
* If variable would have been correct, logic was still reversed
- Define 3h timeout as the default 1h timeout on Gitlab.com (and others)
is usually not enough for initial (uncached) MariaDB builds.
- Replace Buster to Bookworm/Sid upgrade testing with upgrade inside Buster
testing as direct upgrades from Stretch to Bullseye and Buster to Bookworm
are no longer possible due to:
Bug#993755: libcrypt.so.1: cannot open shared object file when
upgrading from Stretch to Sid (https://bugs.debian.org/993755)
- Stop ignoring MariaDB.org 10.6 to this version upgrade testing failures
to reveal bug MDEV-28640. Originally this step was failing as the uring
dependencies in upstream builders lagged behind and there was nothing
that needed work, only time time to resolve. Now there is an actual bug
in packaging that should be visible as a CI failure.
- Stop testing for 'service mysql status' on systems that upgraded from
MySQL 8.0 to MariaDB.org vended 10.6. Due to some unidentified debian/control
changes in 10.6 on upstream the upgrade is no longer compatible in
a way that would maintain the init.d script with name 'mysql'.
- Fix typos where mergers had changed occurrences of 10.5 to 10.6 while
they intentionally need to be exactly 10.5, otherwise the meaning
changes.
- Align autopkgtest code with downstream official Debian packaging one.
This is change is safe on a stable branch because is only affects builds
and testing, not any actual usage of MariaDB 10.6.
- Standardize on using capitalized 'YES' in CMake build options
(instead of 'yes' or mixed case)
- Add some comments to better document debian/rules
- Fix typo in Lintian overrides
Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634
MariaDB ticket: https://jira.mariadb.org/browse/MDEV-25633
When built with LTO on Ubuntu, MariaDB does not catch an exception when
the uring initialization fails due to a low RLIMIT_MEMLOCK value.
This commit amends the commit 0609b345554f9a148e165c497aadbe368e0900aa
to be identical to the one done downstream in Debian:
https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/8d20ca979cf422d3a507283b86c2547d78559179
This way both the inline comments and 'git blame' for this section will
show properly why this is needed, and the fix is one that is fully tested
on Debian and Ubuntu.
Also having this section fully identical in upstream MariaDB and downstream
Debian will make the packaging maintenance easier as 'diff` runs on this
file will not flag this as a difference anymore.
In MDEV-28640 the init script failed to stop/start the MariaDB server
due to missing mysqladmin on the system. This was however very hard to
spot from the console output.
Add an explicit check for the binary the script depends on, and fail
verbosely if the dependency is missing.
2022-11-11 08:51:34 +01:00
|
|
|
-DPLUGIN_COLUMNSTORE=NO \
|
2021-03-15 10:33:15 +01:00
|
|
|
-DIGNORE_AIO_CHECK=YES \
|
Misc Debian/Salsa-CI fixes (#2299)
* Deb: Handle codename 'n/a' from Debian Sid properly and autobake-deb cleanup
This fixes autobake-deb.sh builds on Sid which was visible as 4 failing
build steps on Salsa-CI.
- In Sid the LSBNAME might evaluate to 'n/a', so accept it as 'Sid' to
fix builds that failed with error:
Error - unknown release codename n/a
- Refactor list to have Ubuntu versions first, then Debian, and as last
the special case of Debian Sid
- Fix minor syntax issues detected by Shellcheck
Also remove useless DEB_HOST_ARCH_CPU check from debian/rules:
* It was never in effect as the 'sed' in autobake-deb.sh cleared it anyway
* The variable name was wrong and always empty
* If variable would have been correct, logic was still reversed
- Define 3h timeout as the default 1h timeout on Gitlab.com (and others)
is usually not enough for initial (uncached) MariaDB builds.
- Replace Buster to Bookworm/Sid upgrade testing with upgrade inside Buster
testing as direct upgrades from Stretch to Bullseye and Buster to Bookworm
are no longer possible due to:
Bug#993755: libcrypt.so.1: cannot open shared object file when
upgrading from Stretch to Sid (https://bugs.debian.org/993755)
- Stop ignoring MariaDB.org 10.6 to this version upgrade testing failures
to reveal bug MDEV-28640. Originally this step was failing as the uring
dependencies in upstream builders lagged behind and there was nothing
that needed work, only time time to resolve. Now there is an actual bug
in packaging that should be visible as a CI failure.
- Stop testing for 'service mysql status' on systems that upgraded from
MySQL 8.0 to MariaDB.org vended 10.6. Due to some unidentified debian/control
changes in 10.6 on upstream the upgrade is no longer compatible in
a way that would maintain the init.d script with name 'mysql'.
- Fix typos where mergers had changed occurrences of 10.5 to 10.6 while
they intentionally need to be exactly 10.5, otherwise the meaning
changes.
- Align autopkgtest code with downstream official Debian packaging one.
This is change is safe on a stable branch because is only affects builds
and testing, not any actual usage of MariaDB 10.6.
- Standardize on using capitalized 'YES' in CMake build options
(instead of 'yes' or mixed case)
- Add some comments to better document debian/rules
- Fix typo in Lintian overrides
Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634
MariaDB ticket: https://jira.mariadb.org/browse/MDEV-25633
When built with LTO on Ubuntu, MariaDB does not catch an exception when
the uring initialization fails due to a low RLIMIT_MEMLOCK value.
This commit amends the commit 0609b345554f9a148e165c497aadbe368e0900aa
to be identical to the one done downstream in Debian:
https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/8d20ca979cf422d3a507283b86c2547d78559179
This way both the inline comments and 'git blame' for this section will
show properly why this is needed, and the fix is one that is fully tested
on Debian and Ubuntu.
Also having this section fully identical in upstream MariaDB and downstream
Debian will make the packaging maintenance easier as 'diff` runs on this
file will not flag this as a difference anymore.
In MDEV-28640 the init script failed to stop/start the MariaDB server
due to missing mysqladmin on the system. This was however very hard to
spot from the console output.
Add an explicit check for the binary the script depends on, and fail
verbosely if the dependency is missing.
2022-11-11 08:51:34 +01:00
|
|
|
-DWITH_URING=YES \
|
2020-12-25 16:41:03 +01:00
|
|
|
-DDEB=$(DEB_VENDOR)
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-10-09 22:39:01 +02:00
|
|
|
# This is needed, otherwise 'make test' will run before binaries have been built
|
|
|
|
override_dh_auto_build:
|
|
|
|
@echo "RULES.$@"
|
|
|
|
# Print build env info to help debug builds on different platforms
|
|
|
|
dpkg-architecture
|
2022-04-07 06:55:52 +02:00
|
|
|
cd $(BUILDDIR) && $(MAKE) --output-sync=target
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-10-09 22:39:01 +02:00
|
|
|
override_dh_auto_test:
|
|
|
|
@echo "RULES.$@"
|
|
|
|
dh_testdir
|
Misc Debian/Salsa-CI fixes (#2299)
* Deb: Handle codename 'n/a' from Debian Sid properly and autobake-deb cleanup
This fixes autobake-deb.sh builds on Sid which was visible as 4 failing
build steps on Salsa-CI.
- In Sid the LSBNAME might evaluate to 'n/a', so accept it as 'Sid' to
fix builds that failed with error:
Error - unknown release codename n/a
- Refactor list to have Ubuntu versions first, then Debian, and as last
the special case of Debian Sid
- Fix minor syntax issues detected by Shellcheck
Also remove useless DEB_HOST_ARCH_CPU check from debian/rules:
* It was never in effect as the 'sed' in autobake-deb.sh cleared it anyway
* The variable name was wrong and always empty
* If variable would have been correct, logic was still reversed
- Define 3h timeout as the default 1h timeout on Gitlab.com (and others)
is usually not enough for initial (uncached) MariaDB builds.
- Replace Buster to Bookworm/Sid upgrade testing with upgrade inside Buster
testing as direct upgrades from Stretch to Bullseye and Buster to Bookworm
are no longer possible due to:
Bug#993755: libcrypt.so.1: cannot open shared object file when
upgrading from Stretch to Sid (https://bugs.debian.org/993755)
- Stop ignoring MariaDB.org 10.6 to this version upgrade testing failures
to reveal bug MDEV-28640. Originally this step was failing as the uring
dependencies in upstream builders lagged behind and there was nothing
that needed work, only time time to resolve. Now there is an actual bug
in packaging that should be visible as a CI failure.
- Stop testing for 'service mysql status' on systems that upgraded from
MySQL 8.0 to MariaDB.org vended 10.6. Due to some unidentified debian/control
changes in 10.6 on upstream the upgrade is no longer compatible in
a way that would maintain the init.d script with name 'mysql'.
- Fix typos where mergers had changed occurrences of 10.5 to 10.6 while
they intentionally need to be exactly 10.5, otherwise the meaning
changes.
- Align autopkgtest code with downstream official Debian packaging one.
This is change is safe on a stable branch because is only affects builds
and testing, not any actual usage of MariaDB 10.6.
- Standardize on using capitalized 'YES' in CMake build options
(instead of 'yes' or mixed case)
- Add some comments to better document debian/rules
- Fix typo in Lintian overrides
Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634
MariaDB ticket: https://jira.mariadb.org/browse/MDEV-25633
When built with LTO on Ubuntu, MariaDB does not catch an exception when
the uring initialization fails due to a low RLIMIT_MEMLOCK value.
This commit amends the commit 0609b345554f9a148e165c497aadbe368e0900aa
to be identical to the one done downstream in Debian:
https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/8d20ca979cf422d3a507283b86c2547d78559179
This way both the inline comments and 'git blame' for this section will
show properly why this is needed, and the fix is one that is fully tested
on Debian and Ubuntu.
Also having this section fully identical in upstream MariaDB and downstream
Debian will make the packaging maintenance easier as 'diff` runs on this
file will not flag this as a difference anymore.
In MDEV-28640 the init script failed to stop/start the MariaDB server
due to missing mysqladmin on the system. This was however very hard to
spot from the console output.
Add an explicit check for the binary the script depends on, and fail
verbosely if the dependency is missing.
2022-11-11 08:51:34 +01:00
|
|
|
# Ensure at least an empty file exists
|
2021-06-11 14:58:50 +02:00
|
|
|
touch mysql-test/unstable-tests
|
2018-05-29 08:50:55 +02:00
|
|
|
[ ! -f debian/unstable-tests.$(DEB_HOST_ARCH) ] || cat debian/unstable-tests.$(DEB_HOST_ARCH) >> mysql-test/unstable-tests
|
2016-10-09 22:39:01 +02:00
|
|
|
# Run testsuite
|
|
|
|
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
|
2020-12-20 22:29:29 +01:00
|
|
|
cd $(BUILDDIR)/mysql-test && \
|
|
|
|
./mtr --force --mem \
|
|
|
|
--parallel=$(NUMJOBS) --skip-rpl --suite=main \
|
|
|
|
--skip-test-list=unstable-tests
|
2016-10-09 22:39:01 +02:00
|
|
|
endif
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-10-09 22:39:01 +02:00
|
|
|
override_dh_auto_install:
|
|
|
|
@echo "RULES.$@"
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
2012-01-26 12:55:12 +01:00
|
|
|
|
2018-05-29 08:50:55 +02:00
|
|
|
ifneq (,$(filter linux,$(DEB_HOST_ARCH_OS)))
|
2016-10-29 01:43:45 +02:00
|
|
|
# Copy systemd files to a location available for dh_installinit
|
2020-05-14 17:00:13 +02:00
|
|
|
cp $(BUILDDIR)/support-files/mariadb.service debian/mariadb-server-10.6.mariadb.service
|
2021-03-19 03:42:40 +01:00
|
|
|
cp $(BUILDDIR)/support-files/mariadb.socket debian/mariadb-server-10.6.mariadb.socket
|
|
|
|
cp $(BUILDDIR)/support-files/mariadb-extra.socket debian/mariadb-server-10.6.mariadb-extra.socket
|
2020-05-14 17:00:13 +02:00
|
|
|
cp $(BUILDDIR)/support-files/mariadb@.service debian/mariadb-server-10.6.mariadb@.service
|
2021-03-19 03:42:40 +01:00
|
|
|
cp $(BUILDDIR)/support-files/mariadb@.socket debian/mariadb-server-10.6.mariadb@.socket
|
|
|
|
cp $(BUILDDIR)/support-files/mariadb-extra@.socket debian/mariadb-server-10.6.mariadb-extra@.socket
|
2018-05-29 08:23:23 +02:00
|
|
|
endif
|
2016-10-29 01:43:45 +02:00
|
|
|
|
2020-03-16 12:07:52 +01:00
|
|
|
# Run 'make install' without output since it is uninteresting and
|
|
|
|
# silencing it helps to make overall build log shorter and more readable
|
|
|
|
@echo "Running $(MAKE) install DESTDIR=$(TMP) ..."
|
|
|
|
cd $(BUILDDIR) && $(MAKE) install DESTDIR=$(TMP) > /dev/null
|
|
|
|
|
|
|
|
# If mariadb-test package is removed, also remove most of it's files
|
|
|
|
grep --quiet "Package: mariadb-test" debian/control || rm -rf $(TMP)/usr/share/mysql/mysql-test
|
2012-01-28 21:22:14 +01:00
|
|
|
|
2021-05-06 21:08:38 +02:00
|
|
|
# Delete private files from libraries so they don't get shipped in the -dev packages
|
2020-04-05 11:57:10 +02:00
|
|
|
rm -r $(TMP)/usr/include/mariadb/server/private
|
|
|
|
|
2020-04-05 12:05:56 +02:00
|
|
|
# Don't ship sql-bench at all, just delete it completely even though it builds
|
|
|
|
rm -r $(TMP)/usr/sql-bench
|
|
|
|
|
2016-10-09 22:39:01 +02:00
|
|
|
# nm numeric soft is not enough, therefore extra sort in command
|
|
|
|
# to satisfy Debian reproducible build requirements
|
2020-07-03 21:49:45 +02:00
|
|
|
nm --defined-only $(BUILDDIR)/sql/mariadbd | LC_ALL=C sort | gzip -n -9 > $(TMP)/usr/share/doc/mariadb-server-10.6/mariadbd.sym.gz
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2020-12-20 22:29:29 +01:00
|
|
|
# Rename and install AppArmor profile
|
2020-06-11 00:39:11 +02:00
|
|
|
install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mariadbd
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-11-13 00:10:41 +01:00
|
|
|
# Install libmariadbclient18 compatibility links
|
2018-01-11 16:48:17 +01:00
|
|
|
ln -s libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadbclient.so
|
|
|
|
ln -s libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadbclient.so.18
|
2016-11-13 00:10:41 +01:00
|
|
|
|
2016-11-26 19:08:07 +01:00
|
|
|
# Install libmysqlclientclientXX compatibility links
|
2018-01-11 16:48:17 +01:00
|
|
|
ln -s libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqlclient.so.18
|
|
|
|
ln -s libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqlclient.so.19
|
|
|
|
ln -s libmariadb.so.3 $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqlclient.so.20
|
2016-11-26 19:08:07 +01:00
|
|
|
|
2020-03-27 00:47:53 +01:00
|
|
|
# Install libmariadbclient.a compatibility link
|
|
|
|
ln -s libmariadb.a $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadbclient.a
|
|
|
|
|
2020-04-05 17:21:29 +02:00
|
|
|
# Symlink plugins that are used by both server and client and thus need to
|
|
|
|
# load from the libmariadb path as well
|
|
|
|
ln -s ../../../mysql/plugin/auth_test_plugin.so $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb3/plugin/auth_test_plugin.so
|
|
|
|
ln -s ../../../mysql/plugin/qa_auth_interface.so $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb3/plugin/qa_auth_interface.so
|
2020-10-19 14:51:52 +02:00
|
|
|
ln -s ../../../mysql/plugin/test_sql_service.so $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb3/plugin/test_sql_service.so
|
2020-04-05 17:21:29 +02:00
|
|
|
# Move test plugins that are only needed by the client to the libmariadb path
|
|
|
|
mv -v $(TMP)/usr/lib/mysql/plugin/qa_auth_client.so $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb3/plugin/
|
|
|
|
|
2016-10-09 22:39:01 +02:00
|
|
|
override_dh_installlogrotate-arch:
|
|
|
|
dh_installlogrotate --name mysql-server
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2016-10-29 01:43:45 +02:00
|
|
|
override_dh_systemd_enable:
|
2021-03-27 08:13:51 +01:00
|
|
|
dh_systemd_enable --name=mariadb
|
|
|
|
dh_systemd_enable --no-enable --name=mariadb mariadb.socket
|
|
|
|
dh_systemd_enable --no-enable --name=mariadb-extra mariadb-extra.socket
|
2021-03-19 03:42:40 +01:00
|
|
|
dh_systemd_enable --no-enable --name=mariadb@ mariadb.socket
|
|
|
|
dh_systemd_enable --no-enable --name=mariadb-extra@ mariadb-extra.socket
|
|
|
|
dh_systemd_enable --no-enable --name=mariadb@ mariadb@.service
|
2016-10-29 01:43:45 +02:00
|
|
|
|
MDEV-5536: add systemd socket activation
Systemd has a socket activation feature where a mariadb.socket
definition defines the sockets to listen to, and passes those
file descriptors directly to mariadbd to use when a connection
occurs.
The new functionality is utilized when starting as follows:
systemctl start mariadb.socket
The mariadb.socket definition only needs to contain the network
information, ListenStream= directives, the mariadb.service
definition is still used for service instigation.
When mariadbd is started in this way, the socket, port, bind-address
backlog are all assumed to be self contained in the mariadb.socket
definition and as such the mariadb settings and command line
arguments of these network settings are ignored.
See man systemd.socket for how to limit this to specific ports.
Extra ports, those specified with extra_port in socket activation
mode, are those with a FileDescriptorName=extra. These need
to be in a separate service name like mariadb-extra.socket and
these require a Service={mariadb.service} directive to map to the
original service. Extra ports need systemd v227 or greater
(not RHEL/Centos7 - v219) when FileDescriptorName= was added,
otherwise the extra ports are treated like ordinary ports.
The number of sockets isn't limited when using systemd socket activation
(except by operating system limits on file descriptors and a minimal
amount of memory used per file descriptor). The systemd sockets passed
can include any ownership or permissions, including those the
mariadbd process wouldn't normally have the permission to create.
This implementation is compatible with mariadb.service definitions.
Those services started with:
systemctl start mariadb.service
does actually start the mariadb.service and used all the my.cnf
settings of sockets and ports like it previously did.
2015-03-11 21:26:04 +01:00
|
|
|
# Start MariaDB at sequence number 19 before 20 where apache, proftpd etc gets
|
2016-10-09 22:39:01 +02:00
|
|
|
# started which might depend on a running database server.
|
|
|
|
override_dh_installinit-arch:
|
2020-04-26 09:41:21 +02:00
|
|
|
dh_installinit --name=mariadb --no-start -- defaults 19 21
|
2016-10-29 01:43:45 +02:00
|
|
|
dh_systemd_start --restart-after-upgrade
|
2012-01-23 12:20:16 +01:00
|
|
|
|
Misc Debian/Salsa-CI fixes (#2299)
* Deb: Handle codename 'n/a' from Debian Sid properly and autobake-deb cleanup
This fixes autobake-deb.sh builds on Sid which was visible as 4 failing
build steps on Salsa-CI.
- In Sid the LSBNAME might evaluate to 'n/a', so accept it as 'Sid' to
fix builds that failed with error:
Error - unknown release codename n/a
- Refactor list to have Ubuntu versions first, then Debian, and as last
the special case of Debian Sid
- Fix minor syntax issues detected by Shellcheck
Also remove useless DEB_HOST_ARCH_CPU check from debian/rules:
* It was never in effect as the 'sed' in autobake-deb.sh cleared it anyway
* The variable name was wrong and always empty
* If variable would have been correct, logic was still reversed
- Define 3h timeout as the default 1h timeout on Gitlab.com (and others)
is usually not enough for initial (uncached) MariaDB builds.
- Replace Buster to Bookworm/Sid upgrade testing with upgrade inside Buster
testing as direct upgrades from Stretch to Bullseye and Buster to Bookworm
are no longer possible due to:
Bug#993755: libcrypt.so.1: cannot open shared object file when
upgrading from Stretch to Sid (https://bugs.debian.org/993755)
- Stop ignoring MariaDB.org 10.6 to this version upgrade testing failures
to reveal bug MDEV-28640. Originally this step was failing as the uring
dependencies in upstream builders lagged behind and there was nothing
that needed work, only time time to resolve. Now there is an actual bug
in packaging that should be visible as a CI failure.
- Stop testing for 'service mysql status' on systems that upgraded from
MySQL 8.0 to MariaDB.org vended 10.6. Due to some unidentified debian/control
changes in 10.6 on upstream the upgrade is no longer compatible in
a way that would maintain the init.d script with name 'mysql'.
- Fix typos where mergers had changed occurrences of 10.5 to 10.6 while
they intentionally need to be exactly 10.5, otherwise the meaning
changes.
- Align autopkgtest code with downstream official Debian packaging one.
This is change is safe on a stable branch because is only affects builds
and testing, not any actual usage of MariaDB 10.6.
- Standardize on using capitalized 'YES' in CMake build options
(instead of 'yes' or mixed case)
- Add some comments to better document debian/rules
- Fix typo in Lintian overrides
Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634
MariaDB ticket: https://jira.mariadb.org/browse/MDEV-25633
When built with LTO on Ubuntu, MariaDB does not catch an exception when
the uring initialization fails due to a low RLIMIT_MEMLOCK value.
This commit amends the commit 0609b345554f9a148e165c497aadbe368e0900aa
to be identical to the one done downstream in Debian:
https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/8d20ca979cf422d3a507283b86c2547d78559179
This way both the inline comments and 'git blame' for this section will
show properly why this is needed, and the fix is one that is fully tested
on Debian and Ubuntu.
Also having this section fully identical in upstream MariaDB and downstream
Debian will make the packaging maintenance easier as 'diff` runs on this
file will not flag this as a difference anymore.
In MDEV-28640 the init script failed to stop/start the MariaDB server
due to missing mysqladmin on the system. This was however very hard to
spot from the console output.
Add an explicit check for the binary the script depends on, and fail
verbosely if the dependency is missing.
2022-11-11 08:51:34 +01:00
|
|
|
# Use custom server version string variable
|
2020-11-27 15:05:17 +01:00
|
|
|
override_dh_gencontrol:
|
|
|
|
dh_gencontrol -- -Tdebian/substvars
|
2012-01-23 12:20:16 +01:00
|
|
|
|
2018-01-12 21:27:22 +01:00
|
|
|
# If a file is not supposed to be included anywhere, add it to the not-installed
|
|
|
|
# file and document the reason. Note that dh_install supports the above mentioned
|
|
|
|
# white list file only starting from Debian Stretch and Ubuntu Xenial.
|
|
|
|
# To find more, grep build logs for 'but is not installed to anywhere'.
|
2016-10-09 22:39:01 +02:00
|
|
|
%:
|
2018-04-10 18:38:14 +02:00
|
|
|
dh $@ --parallel --with systemd --list-missing
|
2012-01-23 12:20:16 +01:00
|
|
|
|
|
|
|
# vim: ts=8
|