Skip to content

Commit

Permalink
Enable features to generate dependency list and fix RPM installation. (
Browse files Browse the repository at this point in the history
…#343)

* CPACK: Enable features to generate dependency lists

For DEBIAN, enable CPACK_DEBIAN_PACKAGE_SHLIBDEPS to generate a package
dependency list.

For RPM, enable CPACK_RPM_PACKAGE_AUTOREQPROV to automatically generate
lists of shared libraries that this package requires and provides.

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

* Manually derive RPM provides list for libunwind.

[Why]
`dnf install` fails dependency resolution

[How]
Auto-generation did not add it to the "provides" list, despite it being
included in the package when OMNITRACE_BUILD_LIBUNWIND is enabled. So,
manually include these in the "CPACK_RPM_PACKAGE_PROVIDES" parameter.

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

* Fix cmake-format linting

Signed-off-by: David Galiffi <David.Galiffi@amd.com>

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
  • Loading branch information
dgaliffiAMD authored Jun 7, 2024
1 parent 6bcd1d3 commit 129580b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions cmake/ConfigCPack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ string(REPLACE ";" ", " _DEBIAN_PACKAGE_DEPENDS "${_DEBIAN_PACKAGE_DEPENDS}")
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${_DEBIAN_PACKAGE_DEPENDS}"
CACHE STRING "Debian package dependencies" FORCE)

set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)

# -------------------------------------------------------------------------------------- #
#
Expand All @@ -198,8 +200,23 @@ string(REGEX REPLACE "([a-zA-Z])-([0-9])" "\\1\\2" CPACK_RPM_PACKAGE_RELEASE
"${CPACK_RPM_PACKAGE_RELEASE}")
string(REPLACE "-" "~" CPACK_RPM_PACKAGE_RELEASE "${CPACK_RPM_PACKAGE_RELEASE}")

set(_RPM_PACKAGE_PROVIDES "")

if(OMNITRACE_BUILD_LIBUNWIND)
list(APPEND _RPM_PACKAGE_PROVIDES "libunwind.so.99()(64bit)")
list(APPEND _RPM_PACKAGE_PROVIDES "libunwind-x86_64.so.99()(64bit)")
list(APPEND _RPM_PACKAGE_PROVIDES "libunwind-setjmp.so.0()(64bit)")
list(APPEND _RPM_PACKAGE_PROVIDES "libunwind-ptrace.so.0()(64bit)")
endif()

string(REPLACE ";" ", " CPACK_RPM_PACKAGE_PROVIDES "${_RPM_PACKAGE_PROVIDES}")
set(CPACK_RPM_PACKAGE_PROVIDES
"${CPACK_RPM_PACKAGE_PROVIDES}"
CACHE STRING "RPM package provides" FORCE)

set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
set(CPACK_RPM_PACKAGE_AUTOREQPROV ON)

# -------------------------------------------------------------------------------------- #
#
Expand Down Expand Up @@ -230,9 +247,15 @@ omnitrace_add_feature(CPACK_PACKAGING_INSTALL_PREFIX "Package installation prefi
omnitrace_add_feature(CPACK_DEBIAN_FILE_NAME "Debian file name")
omnitrace_add_feature(CPACK_DEBIAN_PACKAGE_RELEASE "Debian package release version")
omnitrace_add_feature(CPACK_DEBIAN_PACKAGE_DEPENDS "Debian package dependencies")
omnitrace_add_feature(CPACK_DEBIAN_PACKAGE_SHLIBDEPS
"Debian package shared library dependencies")

omnitrace_add_feature(CPACK_RPM_FILE_NAME "RPM file name")
omnitrace_add_feature(CPACK_RPM_PACKAGE_RELEASE "RPM package release version")
omnitrace_add_feature(CPACK_RPM_PACKAGE_REQUIRES "RPM package dependencies")
omnitrace_add_feature(CPACK_RPM_PACKAGE_AUTOREQPROV
"RPM package auto generate requires and provides")
omnitrace_add_feature(CPACK_RPM_PACKAGE_REQUIRES "RPM package requires")
omnitrace_add_feature(CPACK_RPM_PACKAGE_PROVIDES "RPM package provides")

include(CPack)

0 comments on commit 129580b

Please sign in to comment.