diff options
author | Alexander Smorkalov <alexander.smorkalov@itseez.com> | 2016-05-10 12:25:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-13 14:46:03 (GMT) |
commit | c7f388e723b85b48a1d0d462a8f2f7d962314421 (patch) | |
tree | a694efb10eea8f9c572e49c0ce17f16ef225ef1a /Modules/CPackDeb.cmake | |
parent | 2d5896530b7353496e728eb7751ef05c305287e7 (diff) | |
download | CMake-c7f388e723b85b48a1d0d462a8f2f7d962314421.zip CMake-c7f388e723b85b48a1d0d462a8f2f7d962314421.tar.gz CMake-c7f388e723b85b48a1d0d462a8f2f7d962314421.tar.bz2 |
CPack/Deb generation of postinst and postrm ldconfig files
DEBIAN/postinst and DEBAIN/postrm files generation if
the package installs libraries in ldconfig controlled
location (/lib/, /usr/lib/)
Diffstat (limited to 'Modules/CPackDeb.cmake')
-rw-r--r-- | Modules/CPackDeb.cmake | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index 748bf06..d38751f 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -810,6 +810,33 @@ function(cpack_deb_prepare_package_vars) endif() endif() + # add ldconfig call in default postrm and postint + set(CPACK_ADD_LDCONFIG_CALL 0) + foreach(_FILE ${CPACK_DEB_SHARED_OBJECT_FILES}) + get_filename_component(_DIR ${_FILE} DIRECTORY) + # all files in CPACK_DEB_SHARED_OBJECT_FILES have dot at the beginning + if(_DIR STREQUAL "./lib" OR _DIR STREQUAL "./usr/lib") + set(CPACK_ADD_LDCONFIG_CALL 1) + endif() + endforeach() + + if(CPACK_ADD_LDCONFIG_CALL) + set(CPACK_DEBIAN_GENERATE_POSTINST 1) + set(CPACK_DEBIAN_GENERATE_POSTRM 1) + foreach(f ${PACKAGE_CONTROL_EXTRA}) + get_filename_component(n "${f}" NAME) + if("${n}" STREQUAL "postinst") + set(CPACK_DEBIAN_GENERATE_POSTINST 0) + endif() + if("${n}" STREQUAL "postrm") + set(CPACK_DEBIAN_GENERATE_POSTRM 0) + endif() + endforeach() + else() + set(CPACK_DEBIAN_GENERATE_POSTINST 0) + set(CPACK_DEBIAN_GENERATE_POSTRM 0) + endif() + # Print out some debug information if we were asked for that if(CPACK_DEBIAN_PACKAGE_DEBUG) message("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY = '${CPACK_TOPLEVEL_DIRECTORY}'") @@ -863,6 +890,8 @@ function(cpack_deb_prepare_package_vars) "${CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION}" PARENT_SCOPE) set(GEN_CPACK_DEBIAN_PACKAGE_SOURCE "${CPACK_DEBIAN_PACKAGE_SOURCE}" PARENT_SCOPE) + set(GEN_CPACK_DEBIAN_GENERATE_POSTINST "${CPACK_DEBIAN_GENERATE_POSTINST}" PARENT_SCOPE) + set(GEN_CPACK_DEBIAN_GENERATE_POSTRM "${CPACK_DEBIAN_GENERATE_POSTRM}" PARENT_SCOPE) set(GEN_WDIR "${WDIR}" PARENT_SCOPE) endfunction() |