1

In my current setup (C++ project under Mageia 5 built using cmake), the cpack commands below cause the construction of RPM packages with dependencies to devel packages which is unnecessary.

The _CPack_Packages/Linux/RPM/rpmbuild.out file contain the following Requires section:

Requires: devel(libQt5Core(64bit)) devel(libQt5Test(64bit)) 
devel(libQt5Xml(64bit)) devel(libgcc_s(64bit)) 
devel(liblima-common-data(64bit)) devel(liblima-common-datahandler(64bit)) 
devel(liblima-common-factory(64bit)) devel(liblima-common-fsaaccess(64bit)) 
(…)

If found nowhere how this list was generated. If I manually run the find-requires script from RPM and other tools, I don't get devel packages.

The CPack commands are:

set(CPACK_PACKAGE_NAME "limacommon")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LIMA Common libraries")
set(CPACK_PACKAGE_VENDOR "CEA LIST")
set(CPACK_PACKAGE_CONTACT "Gaël de Chalendar <Gael.de-Chalendar@cea.fr>")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_VERSION_MAJOR "${LIMA_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${LIMA_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${LIMA_VERSION_RELEASE}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Lima-${LIMA_VERSION_MAJOR}.${LIMA_VERSION_MINOR}")
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
SET(CPACK_NSIS_MODIFY_PATH "ON")
SET(CPACK_STRIP_FILES "bin/testDict16;bin/testLexicon")
SET(CPACK_SOURCE_STRIP_FILES "")
if ("x$ENV{LIMA_DISABLE_CPACK_DEBIAN_PACKAGE_SHLIBDEPS}" STREQUAL "x")
  set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
endif()
set(CPACK_GENERATOR ${SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR})

The code is available here.

How to avoid generating these spurious dependencies ?

Note that this question is not a duplicate of "How do you make it so that cpack doesn't add required libraries to an RPM?" because this question was about voluntarily disabling automatic dependency tracking while mine is about correcting a wrong behaviour while keeping the automatic dependency tracking. BTW, I already found this question and navigated through the links it contains.

Community
  • 1
  • 1
Kleag
  • 642
  • 7
  • 14
  • Possible duplicate of [How do you make it so that cpack doesn't add required libraries to an RPM?](http://stackoverflow.com/questions/14658034/how-do-you-make-it-so-that-cpack-doesnt-add-required-libraries-to-an-rpm) – Tsyvarev Jan 26 '17 at 12:06
  • 1
    No, I don't think this is a duplicate because this question was about voluntarily disabling automatic dependency tracking while mine is about correcting a wrong behaviour while keeping the automatic dependency tracking. BTW, I already found this question and navigated through the links it contains. – Kleag Jan 26 '17 at 12:48
  • `correcting a wrong behaviour` - **Why** do you think that "devel" packages are **wrongly** added here? [mcve] would be helpfull. ... Oh, this `If found nowhere ...` paragraph. I have catched its meaning only now... – Tsyvarev Jan 26 '17 at 12:54
  • 2
    Because no executable or library in the generated package depends on any devel package. I will try to generate a smaller example but that could be not so easy. – Kleag Jan 26 '17 at 12:58
  • Have you found a solution to this problem in the meantime? – maxime-esa Jul 23 '20 at 12:48
  • @maxime-esa No. And I do not work anymore with rpm based distributions, so I even do not encounter this problem anymore. – Kleag Sep 15 '20 at 09:06

0 Answers0