Commit bf7066c6 authored by M. Konrad's avatar M. Konrad Committed by Eric Noulard

CPackDeb add Component Support to DEB generator fix #11655

Contribution by Martin Konrad
Signed-off-by: Eric Noulard's avatarEric NOULARD <eric.noulard@gmail.com>
parent 8def3f59
......@@ -311,6 +311,28 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
# Are we packaging components ?
IF(CPACK_DEB_PACKAGE_COMPONENT)
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}")
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}")
SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}")
ELSE(CPACK_DEB_PACKAGE_COMPONENT)
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
ENDIF(CPACK_DEB_PACKAGE_COMPONENT)
# 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}")
MESSAGE("CPackDeb:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
MESSAGE("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}")
MESSAGE("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
MESSAGE("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
MESSAGE("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
# For debian source packages:
# debian/control
......
This diff is collapsed.
......@@ -33,8 +33,26 @@ public:
protected:
virtual int InitializeInternal();
/**
* The method used to package files when component
* install is used. This will create one
* archive for each component group.
*/
int PackageComponents(bool ignoreGroup);
/**
* Special case of component install where all
* components will be put in a single installer.
*/
int PackageComponentsAllInOne(bool allComponent);
virtual int PackageFiles();
virtual const char* GetOutputExtension() { return ".deb"; }
virtual bool SupportsComponentInstallation() const;
virtual std::string GetComponentInstallDirNameSuffix(
const std::string& componentName);
private:
int createDeb();
std::vector<std::string> packageFiles;
};
......
......@@ -572,6 +572,12 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
if (RPMBUILD)
list(APPEND GENLST "RPM")
endif(RPMBUILD)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
find_program(DPKG NAMES dpkg)
if (DPKG)
list(APPEND GENLST "DEB")
endif(DPKG)
endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
# set up list of component packaging ways
list(APPEND CWAYLST "default")
list(APPEND CWAYLST "OnePackPerGroup")
......
......@@ -9,6 +9,10 @@ if(CPACK_GENERATOR MATCHES "RPM")
set(CPACK_RPM_COMPONENT_INSTALL "ON")
endif(CPACK_GENERATOR MATCHES "RPM")
if(CPACK_GENERATOR MATCHES "DEB")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
endif(CPACK_GENERATOR MATCHES "DEB")
#
# Choose grouping way
#
......
......@@ -9,6 +9,10 @@ if(CPACK_GENERATOR MATCHES "RPM")
set(CPACK_RPM_COMPONENT_INSTALL "ON")
endif(CPACK_GENERATOR MATCHES "RPM")
if(CPACK_GENERATOR MATCHES "DEB")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
endif(CPACK_GENERATOR MATCHES "DEB")
#
# Choose grouping way
#
......
......@@ -9,6 +9,10 @@ if(CPACK_GENERATOR MATCHES "RPM")
set(CPACK_RPM_COMPONENT_INSTALL "ON")
endif(CPACK_GENERATOR MATCHES "RPM")
if(CPACK_GENERATOR MATCHES "DEB")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
endif(CPACK_GENERATOR MATCHES "DEB")
#
# Choose grouping way
#
......
......@@ -9,6 +9,10 @@ if(CPACK_GENERATOR MATCHES "RPM")
set(CPACK_RPM_COMPONENT_INSTALL "ON")
endif(CPACK_GENERATOR MATCHES "RPM")
if(CPACK_GENERATOR MATCHES "DEB")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
endif(CPACK_GENERATOR MATCHES "DEB")
#
# Choose grouping way
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment