Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-32686 Debian: include ELF package notes #3692

Open
wants to merge 2 commits into
base: 10.11
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cmake/cpack_rpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ IF(RPM)

MESSAGE(STATUS "CPackRPM building with RPM configuration: ${RPM}")

INCLUDE(check_linker_flag)

SET(CPACK_GENERATOR "RPM")
SET(CPACK_RPM_PACKAGE_DEBUG 1)
SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
Expand Down Expand Up @@ -52,6 +54,14 @@ SET(CPACK_PACKAGE_RELOCATABLE FALSE)
SET(CPACK_RPM_PACKAGE_GROUP "Applications/Databases")
SET(CPACK_RPM_PACKAGE_URL ${CPACK_PACKAGE_URL})

# The spec file depends on environment variables
SET(ENV{RPM_PACKAGE_NAME} ${CPACK_RPM_PACKAGE_NAME})
EXECUTE_PROCESS(COMMAND rpm --eval ${CPACK_RPM_PACKAGE_RELEASE} OUTPUT_VARIABLE RPM_PACKAGE_RELEASE_EXPANDED)
SET(ENV{RPM_PACKAGE_RELEASE} ${RPM_PACKAGE_RELEASE_EXPANDED})
SET(ENV{RPM_ARCH} ${CMAKE_SYSTEM_PROCESSOR})
SET(ENV{RPM_PACKAGE_VERSION} ${SERVER_VERSION})
MY_CHECK_AND_SET_LINKER_FLAG("-specs=/usr/lib/rpm/redhat/redhat-package-notes")

SET(CPACK_RPM_shared_PACKAGE_VENDOR "MariaDB Corporation Ab")
SET(CPACK_RPM_shared_PACKAGE_LICENSE "LGPLv2.1")

Expand Down
12 changes: 12 additions & 0 deletions debian/autobake-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ disable_libfmt()
sed '/libfmt-dev/d' -i debian/control
}

remove_package_notes()
{
# binutils >=2.39 + disto makefile /usr/share/debhelper/dh_package_notes/package-notes.mk
sed -e '/package.notes/d' -i debian/rules debian/control
}

architecture=$(dpkg-architecture -q DEB_BUILD_ARCH)
uname_machine=$(uname -m)

Expand Down Expand Up @@ -114,6 +120,7 @@ in
;&
"bullseye")
add_lsb_base_depends
remove_package_notes
;&
"bookworm")
# mariadb-plugin-rocksdb in control is 4 arches covered by the distro rocksdb-tools
Expand All @@ -131,6 +138,7 @@ in
"focal")
replace_uring_with_aio
disable_libfmt
remove_package_notes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you remove package notes in focal and bullseye? too old binutils?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but more directly not a dh-package-notes package that would use it.

;&
"jammy"|"kinetic")
add_lsb_base_depends
Expand All @@ -155,6 +163,10 @@ in
exit 1
esac

if [ ! -f /usr/share/debhelper/dh_package_notes/package-notes.mk ]; then
remove_package_notes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a good idea. This script builds release packages. They should be consistently built the way we want them to and not depend on whatever we forgot to install on a particular new builder. Better let it fail here — we'll see it and fix the builder — instead of us suddenly releasing the package that doesn't has what we want

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Sure.

fi

if [ -n "${AUTOBAKE_PREP_CONTROL_RULES_ONLY:-}" ]
then
exit 0
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends: bison,
cracklib-runtime <!nocheck>,
debhelper (>= 11),
dh-exec,
dh-package-notes,
flex [amd64],
gdb <!nocheck>,
libaio-dev [linux-any],
Expand Down
3 changes: 3 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
# Include all defaults, including buildflags.mk
include /usr/share/dpkg/default.mk
# Include package notes in built executables
include /usr/share/debhelper/dh_package_notes/package-notes.mk

# 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.
Expand Down