From bb5fc38209df343490be31dd34a65816b0799b59 Mon Sep 17 00:00:00 2001 From: Lisa Welsch Date: Thu, 8 Jul 2021 15:12:36 +0200 Subject: CPack/RPM: Add option to set %global __requires_exclude_from --- Help/cpack_gen/rpm.rst | 11 +++++++++++ Help/release/dev/cpack-rpm-requires-exclude-from.rst | 6 ++++++ Modules/Internal/CPack/CPackRPM.cmake | 12 ++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 Help/release/dev/cpack-rpm-requires-exclude-from.rst diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst index 322ab68..f6274f9 100644 --- a/Help/cpack_gen/rpm.rst +++ b/Help/cpack_gen/rpm.rst @@ -1035,3 +1035,14 @@ Source RPM packaging has its own set of variables: example:: set(CPACK_RPM_BUILDREQUIRES "python >= 2.5.0, cmake >= 2.8") + +.. VARIABLE:: CPACK_RPM_REQUIRES_EXCLUDE_FROM + + * Mandatory : NO + * Default : - + + May be used to keep the dependency generator from scanning specific files + or directories for dependencies. Note that you can use a regular + expression that matches all of the directories or files, for example:: + + set(CPACK_RPM_REQUIRES_EXCLUDE_FROM "bin/libqsqloci.*\\.so.*") diff --git a/Help/release/dev/cpack-rpm-requires-exclude-from.rst b/Help/release/dev/cpack-rpm-requires-exclude-from.rst new file mode 100644 index 0000000..7125901 --- /dev/null +++ b/Help/release/dev/cpack-rpm-requires-exclude-from.rst @@ -0,0 +1,6 @@ +cpack-rpm-requires-exclude-from +------------------------------- + +* The :cpack_gen:`CPack RPM Generator` gained the + :variable:`CPACK_RPM_REQUIRES_EXCLUDE_FROM` option avoid scanning + specific paths for dependencies. diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake index 47d2a5c..bfb42f3 100644 --- a/Modules/Internal/CPack/CPackRPM.cmake +++ b/Modules/Internal/CPack/CPackRPM.cmake @@ -1162,6 +1162,16 @@ function(cpack_rpm_generate_package) set(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}") endif() + # CPACK_RPM_REQUIRES_EXCLUDE_FROM + # May be defined to keep the dependency generator from + # scanning specific files or directories for deps. + if(CPACK_RPM_REQUIRES_EXCLUDE_FROM) + if(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: User defined CPACK_RPM_REQUIRES_EXCLUDE_FROM = ${CPACK_RPM_REQUIRES_EXCLUDE_FROM}") + endif() + set(TMP_RPM_REQUIRES_EXCLUDE_FROM "%global __requires_exclude_from ${CPACK_RPM_REQUIRES_EXCLUDE_FROM}") + endif() + # CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM__POST_INSTALL_SCRIPT_FILE) # CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM__POST_UNINSTALL_SCRIPT_FILE) # CPACK_RPM_POST_TRANS_SCRIPT_FILE (or CPACK_RPM__POST_TRANS_SCRIPT_FILE) @@ -1650,6 +1660,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@FILE_NAME_DEFINE\@ %define _unpackaged_files_terminate_build 0 \@TMP_RPM_SPEC_INSTALL_POST\@ +\@TMP_RPM_REQUIRES_EXCLUDE_FROM\@ \@CPACK_RPM_SPEC_MORE_DEFINE\@ \@CPACK_RPM_COMPRESSION_TYPE_TMP\@ @@ -1784,6 +1795,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@FILE_NAME_DEFINE\@ %define _unpackaged_files_terminate_build 0 \@TMP_RPM_SPEC_INSTALL_POST\@ +\@TMP_RPM_REQUIRES_EXCLUDE_FROM\@ \@CPACK_RPM_SPEC_MORE_DEFINE\@ \@CPACK_RPM_COMPRESSION_TYPE_TMP\@ -- cgit v0.12