Skip to content

Commit

Permalink
MDEV-32686 Use Red Hat package notes in compilation
Browse files Browse the repository at this point in the history
This tests the compile using a spec file. This spec
file is defined by environment variables.

If the spec file doesn't exist (SLES/OpenSUSE),
isn't supported (e.g. clang), or has incorrect environment
variables the linker flag won't be used.
  • Loading branch information
grooverdan committed Dec 18, 2024
1 parent 8a0a22d commit 9651d5d
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 9651d5d

Please sign in to comment.