From 4da40b110919c331669adaab14d417d680ecbda3 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Sun, 20 Dec 2020 19:54:52 +0100 Subject: [PATCH 1/4] packaging: add RPM packaging --- CMakeLists.txt | 5 +- scripts/cmake/ElektraPackaging.cmake | 586 ++++++------------ scripts/cmake/Modules/PackagingDebian.cmake | 236 +++++++ scripts/cmake/Modules/PackagingFedora.cmake | 200 ++++++ scripts/docker/fedora/33/Dockerfile | 8 + scripts/kdb/find-tools | 2 +- scripts/packaging/fedora/changelog | 0 scripts/packaging/fedora/map_licenses.sh | 19 + .../packaging/fedora/update-rpm-changelog.sh | 65 ++ scripts/packaging/package.sh | 103 +-- 10 files changed, 780 insertions(+), 444 deletions(-) create mode 100644 scripts/cmake/Modules/PackagingDebian.cmake create mode 100644 scripts/cmake/Modules/PackagingFedora.cmake create mode 100644 scripts/packaging/fedora/changelog create mode 100644 scripts/packaging/fedora/map_licenses.sh create mode 100644 scripts/packaging/fedora/update-rpm-changelog.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index b4f270b057b..7d5868b6cc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,10 +31,7 @@ endif (CMAKE_VERSION VERSION_LESS 3.9) set (CMAKE_MACOSX_RPATH 1) set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") -set ( - CMAKE_INSTALL_DEFAULT_COMPONENT_NAME - "elektra-misc" - CACHE STRING "Default component name" FORCE) +set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "elektra-misc") # additional modules for loading libraries set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/scripts/cmake/Modules/") diff --git a/scripts/cmake/ElektraPackaging.cmake b/scripts/cmake/ElektraPackaging.cmake index ba5efe5fa6c..9db2e268b4a 100644 --- a/scripts/cmake/ElektraPackaging.cmake +++ b/scripts/cmake/ElektraPackaging.cmake @@ -1,19 +1,12 @@ -set (PACKAGE_NAME "elektra") set (PACKAGE_URL "https://www.libelektra.org/") set (PACKAGE_BUGREPORT "https://bugs.libelektra.org/") - set (PROJECT_VERSION "${KDB_VERSION}") set (CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") -set (CPACK_DEBIAN_PACKAGE_VERSION "${PROJECT_VERSION}") -set (CPACK_DEBIAN_PACKAGE_RELEASE "1") -set (DEBIAN_VERSION_RELEASE "${CPACK_DEBIAN_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}") -set (CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) -set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Robert Sowula ") set (CPACK_OUTPUT_FILE_PREFIX "packages") set ( - DEBIAN_PACKAGES + PACKAGES libelektra4 libelektra4-all libelektra4-full @@ -56,26 +49,18 @@ set ( ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}) set (ALL_PLUGINS "") -foreach (component ${DEBIAN_PACKAGES}) +foreach (component ${PACKAGES}) if (component MATCHES "^libelektra4-.*") list (APPEND ALL_PLUGINS "${component}") endif () endforeach () string (REPLACE ";" ", " ALL_PLUGINS_STR "${ALL_PLUGINS}") -set (DBG_PACKAGE_NAMES "") -foreach (component ${DEBIAN_PACKAGES}) - if (NOT component IN_LIST COMPONENTS_WITHOUT_DBGSYM) - list (APPEND DBG_PACKAGE_NAMES "${component}-dbgsym") - endif () -endforeach () -string (REPLACE ";" ", " DBG_PACKAGE_NAMES_STR "${DBG_PACKAGE_NAMES}") - set ( PACKAGE_DESCRIPTION - "Elektra provides a universal and secure framework to store configuration parameters in a global, hierarchical key database. The core is a small library implemented in C. The plugin-based framework fulfills many configuration-related tasks to avoid any unnecessary code duplication across applications while it still allows the core to stay without any external dependency. Elektra abstracts from cross-platform-related issues with an consistent API, and allows applications to be aware of other applications' configurations, leveraging easy application integration.\n." + "Elektra provides a universal and secure framework to store configuration parameters in a global, hierarchical key database. The core is a small library implemented in C. The plugin-based framework fulfills many configuration-related tasks to avoid any unnecessary code duplication across applications while it still allows the core to stay without any external dependency. Elektra abstracts from cross-platform-related issues with an consistent API, and allows applications to be aware of other applications' configurations, leveraging easy application integration." ) -set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PACKAGE_DESCRIPTION}") +set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PACKAGE_DESCRIPTION}\n.") set ( CPACK_SOURCE_IGNORE_FILES "/.cvsignore" @@ -111,406 +96,199 @@ if (UNIX) string (STRIP "${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_ARCHITECTURE) # Try to find distro name and distro-specific arch - execute_process (COMMAND lsb_release -is OUTPUT_VARIABLE LSB_ID) - execute_process (COMMAND lsb_release -rs OUTPUT_VARIABLE LSB_RELEASE) - string (STRIP "${LSB_ID}" LSB_ID) - string (STRIP "${LSB_RELEASE}" LSB_RELEASE) - set (LSB_DISTRIB "${LSB_ID}${LSB_RELEASE}") - if (NOT LSB_DISTRIB) - set (LSB_DISTRIB "unix") - endif (NOT LSB_DISTRIB) - message (STATUS "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME: ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}") + execute_process (COMMAND bash "-c" "grep \"^NAME=\" /etc/os-release | awk -F= {' print $2'} | sed 's/\"//g'" + OUTPUT_VARIABLE OS_NAME) + execute_process (COMMAND bash "-c" "grep \"^VERSION_ID=\" /etc/os-release | awk -F= {' print $2'} | sed 's/\"//g'" + OUTPUT_VARIABLE OS_VERSION_ID) + string (STRIP "${OS_NAME}" OS_NAME) + string (STRIP "${OS_VERSION_ID}" OS_VERSION_ID) + set (OS_DISTRIB "${OS_NAME}${OS_VERSION_ID}") + if (NOT OS_DISTRIB) + set (OS_DISTRIB "unix") + endif (NOT OS_DISTRIB) + + set (CPACK_COMPONENT_LIBELEKTRA4_DISPLAY_NAME "libelektra4") + set (CPACK_COMPONENT_LIBELEKTRA4_DESCRIPTION "This package contains the main elektra library, and most of the core plugins") + + set (CPACK_COMPONENT_LIBELEKTRA4-FULL_DISPLAY_NAME "libelektra4-full") + set ( + CPACK_COMPONENT_LIBELEKTRA4-FULL_DESCRIPTION + "This package contains an variant of the Elektra library in which all plugins are linked together to a full library. The package is only needed for testing." + ) + + set (CPACK_COMPONENT_LIBELEKTRA4-EXPERIMENTAL_DISPLAY_NAME "libelektra4-experimental") + set (CPACK_COMPONENT_LIBELEKTRA4-EXPERIMENTAL_DESCRIPTION "This package contains experimental plugins.") + set (CPACK_COMPONENT_LIBELEKTRA4-EXTRA_DISPLAY_NAME "libelektra4-extra") + set (CPACK_COMPONENT_LIBELEKTRA4-EXTRA_DESCRIPTION "This package contains extra plugins.") + + set (CPACK_COMPONENT_ELEKTRA-BIN_DISPLAY_NAME "elektra-bin") + set (CPACK_COMPONENT_ELEKTRA-BIN_DESCRIPTION "This package contains command line utilities for Elektra.") + set (CPACK_COMPONENT_ELEKTRA-BIN_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DISPLAY_NAME "libelektra4-augeas") + set (CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DESCRIPTION "This package contains the 'augeas' plugin.") + set (CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-DBUS_DISPLAY_NAME "libelektra4-dbus") + set (CPACK_COMPONENT_LIBELEKTRA4-DBUS_DESCRIPTION "This package contains the 'dbus' plugins.") + set (CPACK_COMPONENT_LIBELEKTRA4-DBUS_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA-DEV_DISPLAY_NAME "libelektra-dev") + set (CPACK_COMPONENT_LIBELEKTRA-DEV_DESCRIPTION "This package contains the development files for the main Elektra library.") + set (CPACK_COMPONENT_LIBELEKTRA4-DEV_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DISPLAY_NAME "libelektra4-zeromq") + set (CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DESCRIPTION "This package contains the 'zeromq' plugins.") + set (CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DISPLAY_NAME "libelektra4-xmltool") + set (CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DESCRIPTION "This package contains the 'xmltool' plugin.") + set (CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-XERCES_DISPLAY_NAME "libelektra4-xerces") + set (CPACK_COMPONENT_LIBELEKTRA4-XERCES_DESCRIPTION "This package contains the 'xerces' plugin.") + set (CPACK_COMPONENT_LIBELEKTRA4-XERCES_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-YAJL_DISPLAY_NAME "libelektra4-yajl") + set (CPACK_COMPONENT_LIBELEKTRA4-YAJL_DESCRIPTION "This package contains the 'yajl' plugin.") + set (CPACK_COMPONENT_LIBELEKTRA4-YAJL_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DISPLAY_NAME "libelektra4-crypto") + set (CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DESCRIPTION "This package contains the crypto plugins.") + set (CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-CURL_DISPLAY_NAME "libelektra4-curl") + set (CPACK_COMPONENT_LIBELEKTRA4-CURL_DESCRIPTION "This package contains the 'curlget' plugin.") + set (CPACK_COMPONENT_LIBELEKTRA4-CURL_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DISPLAY_NAME "libelektra4-journald") + set (CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DESCRIPTION "This package contains the 'journald' plugins.") + set (CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DISPLAY_NAME "libelektra4-yamlcpp") + set (CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DESCRIPTION "This package contains the 'yamlcpp' plugin.") + set (CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-JAVA_DISPLAY_NAME "libelektra4-java") + set (CPACK_COMPONENT_LIBELEKTRA4-JAVA_DESCRIPTION "This package contains the 'jni' plugin.") + set (CPACK_COMPONENT_LIBELEKTRA4-JAVA_DEPENDS "libelektra4" "java-elektra") + + set (CPACK_COMPONENT_LIBELEKTRA4-LUA_DISPLAY_NAME "libelektra4-lua") + set (CPACK_COMPONENT_LIBELEKTRA4-LUA_DESCRIPTION "This package contains the 'lua' plugin.") + set (CPACK_COMPONENT_LIBELEKTRA4-LUA_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_JAVA-ELEKTRA_DISPLAY_NAME "java-elektra") + set (CPACK_COMPONENT_JAVA-ELEKTRA_DESCRIPTION "This package contains the Java bindings.") + set (CPACK_COMPONENT_JAVA-ELEKTRA_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LUA-ELEKTRA_DISPLAY_NAME "lua-elektra") + set (CPACK_COMPONENT_LUA-ELEKTRA_DESCRIPTION "This package contains the Lua bindings.") + set (CPACK_COMPONENT_LUA-ELEKTRA_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_PYTHON3-ELEKTRA_DISPLAY_NAME "python3-elektra") + set (CPACK_COMPONENT_PYTHON3-ELEKTRA_DESCRIPTION "This package contains the Python 3 bindings.") + set (CPACK_COMPONENT_PYTHON3-ELEKTRA_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DISPLAY_NAME "libelektra4-python") + set (CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DESCRIPTION "This package contains the 'python' plugin.") + set (CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DEPENDS "libelektra4" "python3-elektra") + + set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DISPLAY_NAME "elektra-bin-extra") + set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DESCRIPTION + "This package contains extra command line utilities for Elektra written in non-shell languages like python.") + set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_ELEKTRA-QT-GUI_DISPLAY_NAME "elektra-qt-gui") + set (CPACK_COMPONENT_ELEKTRA-QT-GUI_DESCRIPTION "This package contains a Qt-based graphical interface for Elektra.") + set (CPACK_COMPONENT_ELEKTRA-QT-GUI_DEPENDS "libelektra4") + + set (CPACK_COMPONENT_ELEKTRA-TESTS_DISPLAY_NAME "elektra-tests") + set (CPACK_COMPONENT_ELEKTRA-TESTS_DESCRIPTION "This package contains the Elektra test suite.") + set (CPACK_COMPONENT_ELEKTRA-TESTS_DEPENDS "libelektra4-full" "elektra-bin") + + set (CPACK_COMPONENT_ELEKTRA-DOC_DISPLAY_NAME "elektra-doc") + set (CPACK_COMPONENT_ELEKTRA-DOC_DESCRIPTION "This package contains the API documentation for the Elektra libraries.") + + set (CPACK_COMPONENT_LIBELEKTRA4-ALL_DISPLAY_NAME "libelektra4-all") + set (CPACK_COMPONENT_LIBELEKTRA4-ALL_DESCRIPTION + "This package contains extra command line utilities for Elektra written in non-shell languages like python.") + set ( + CPACK_COMPONENT_LIBELEKTRA4-ALL_DEPENDS + "libelektra4" + "libelektra4-experimental" + "libelektra4-augeas" + "libelektra4-dbus" + "libelektra4-zeromq" + "libelektra4-java" + "libelektra4-lua" + "libelektra4-python" + "libelektra4-xmltool" + "libelektra4-xerces" + "libelektra4-yajl" + "libelektra4-yamlcpp" + "lua-elektra" + "elektra-bin" + "elektra-qt-gui" + "libelektra4-crypto" + "libelektra4-curl" + "libelektra4-journald" + "libelektra4-extra") + string (REPLACE ";" ", " LIBELEKTRA4-ALL_DEPENDS "${CPACK_COMPONENT_LIBELEKTRA4-ALL_DEPENDS}") + + set (CPACK_COMPONENT_ELEKTRA-DBG_DISPLAY_NAME "elektra-dbg") + set (CPACK_COMPONENT_ELEKTRA-DBG_DESCRIPTION "This package contains the dependencies to all dbgsym packages of Elektra.") + + set (CPACK_COMPONENT_ELEKTRA-MISC_DISPLAY_NAME "elektra-misc") + set (CPACK_COMPONENT_ELEKTRA-MISC_DESCRIPTION "This package contains all files not part of any of the released Elektra packages.") # For Debian-based distros we want to create DEB packages. - if ("${LSB_DISTRIB}" MATCHES "Ubuntu|Debian") - set (CPACK_GENERATOR "DEB") - set (CPACK_DEBIAN_PACKAGE_PRIORITY "optional") - set (CPACK_DEBIAN_PACKAGE_SOURCE "elektra") - - set (CPACK_DEB_COMPONENT_INSTALL "ON") - set (CPACK_DEB_PACKAGE_COMPONENT "ON") - set (CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS "ON") - set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON") - set (CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4_PACKAGE_NAME "libelektra4") - set (CPACK_COMPONENT_LIBELEKTRA4_DISPLAY_NAME "libelektra4") - set (CPACK_COMPONENT_LIBELEKTRA4_DESCRIPTION "This package contains the main elektra library, and most of the core plugins") - set (CPACK_DEBIAN_LIBELEKTRA4_PACKAGE_SECTION "libs") - set ( - CPACK_DEBIAN_LIBELEKTRA4_PACKAGE_BREAKS - "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelektra-core4 (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})" - ) - set ( - CPACK_DEBIAN_LIBELEKTRA4_PACKAGE_REPLACES - "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelelektra-core4 (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})" - ) - set (CPACK_DEBIAN_LIBELEKTRA4_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") - set (CPACK_DEBIAN_LIBELEKTRA4_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_NAME "libelektra4-full") - set (CPACK_COMPONENT_LIBELEKTRA4-FULL_DISPLAY_NAME "libelektra4-full") - set (CPACK_COMPONENT_LIBELEKTRA4-FULL_DESCRIPTION - "This package contains an variant of the Elektra library in which all plugins - are linked together to a full library. The package is only needed for testing.") - set (CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_SECTION "libs") - set ( - CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_BREAKS - "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelektra-core4 (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})" - ) - set ( - CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_REPLACES - "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelelektra-core4 (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})" - ) - set (CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_CONFLICTS - "libelektra4 (<< ${CPACK_DEBIAN_PACKAGE_VERSION}), elektra-tests (<< ${CPACK_DEBIAN_PACKAGE_VERSION})") - set (CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") - set (CPACK_DEBIAN_LIBELEKTRA4-FULL_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_NAME "libelektra4-experimental") - set (CPACK_COMPONENT_LIBELEKTRA4-EXPERIMENTAL_DISPLAY_NAME "libelektra4-experimental") - set (CPACK_COMPONENT_LIBELEKTRA4-EXPERIMENTAL_DESCRIPTION "This package contains experimental plugins.") - set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_BREAKS - "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelektra-core4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_REPLACES - "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelelektra-core4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") - set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_NAME "libelektra4-extra") - set (CPACK_COMPONENT_LIBELEKTRA4-EXTRA_DISPLAY_NAME "libelektra4-extra") - set (CPACK_COMPONENT_LIBELEKTRA4-EXTRA_DESCRIPTION "This package contains extra plugins.") - set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_BREAKS - "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelektra-core4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_REPLACES - "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelelektra-core4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") - set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_NAME "elektra-bin") - set (CPACK_COMPONENT_ELEKTRA-BIN_DISPLAY_NAME "elektra-bin") - set (CPACK_COMPONENT_ELEKTRA-BIN_DESCRIPTION "This package contains command line utilities for Elektra.") - set (CPACK_COMPONENT_ELEKTRA-BIN_DEPENDS "libelektra4") - set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_SECTION "misc") - set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_BREAKS - "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}),libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_REPLACES - "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_CONFLICTS "kernel-patch-kdb") - set (CPACK_DEBIAN_ELEKTRA-BIN_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-AUGEAS_PACKAGE_NAME "libelektra4-augeas") - set (CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DISPLAY_NAME "libelektra4-augeas") - set (CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DESCRIPTION "This package contains the 'augeas' plugin.") - set (CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-AUGEAS_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-AUGEAS_PACKAGE_BREAKS "libelektra-augeas4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-AUGEAS_PACKAGE_REPLACES "libelektra-augeas4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-AUGEAS_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-DBUS_PACKAGE_NAME "libelektra4-dbus") - set (CPACK_COMPONENT_LIBELEKTRA4-DBUS_DISPLAY_NAME "libelektra4-dbus") - set (CPACK_COMPONENT_LIBELEKTRA4-DBUS_DESCRIPTION "This package contains the 'dbus' plugins.") - set (CPACK_COMPONENT_LIBELEKTRA4-DBUS_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-DBUS_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-DBUS_PACKAGE_BREAKS "libelektra-dbus4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-DBUS_PACKAGE_REPLACES "libelektra-dbus4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-DBUS_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA-DEV_PACKAGE_NAME "libelektra-dev") - set (CPACK_COMPONENT_LIBELEKTRA-DEV_DISPLAY_NAME "libelektra-dev") - set (CPACK_COMPONENT_LIBELEKTRA-DEV_DESCRIPTION "This package contains the development files for the main Elektra library.") - set (CPACK_COMPONENT_LIBELEKTRA4-DEV_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-DEV_PACKAGE_SECTION "libdevel") - - set (CPACK_DEBIAN_LIBELEKTRA4-ZEROMQ_PACKAGE_NAME "libelektra4-zeromq") - set (CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DISPLAY_NAME "libelektra4-zeromq") - set (CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DESCRIPTION "This package contains the 'zeromq' plugins.") - set (CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-ZEROMQ_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-ZEROMQ_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-XMLTOOL_PACKAGE_NAME "libelektra4-xmltool") - set (CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DISPLAY_NAME "libelektra4-xmltool") - set (CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DESCRIPTION "This package contains the 'xmltool' plugin.") - set (CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-XMLTOOL_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-XMLTOOL_PACKAGE_BREAKS "libelektra-xmltool4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-XMLTOOL_PACKAGE_REPLACES "libelektra-xmltool4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-XMLTOOL_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-XERCES_PACKAGE_NAME "libelektra4-xerces") - set (CPACK_COMPONENT_LIBELEKTRA4-XERCES_DISPLAY_NAME "libelektra4-xerces") - set (CPACK_COMPONENT_LIBELEKTRA4-XERCES_DESCRIPTION "This package contains the 'xerces' plugin.") - set (CPACK_COMPONENT_LIBELEKTRA4-XERCES_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-XERCES_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-XERCES_PACKAGE_BREAKS "libelektra-xerces4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-XERCES_PACKAGE_REPLACES "libelektra-xerces4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-XERCES_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-YAJL_PACKAGE_NAME "libelektra4-yajl") - set (CPACK_COMPONENT_LIBELEKTRA4-YAJL_DISPLAY_NAME "libelektra4-yajl") - set (CPACK_COMPONENT_LIBELEKTRA4-YAJL_DESCRIPTION "This package contains the 'yajl' plugin.") - set (CPACK_COMPONENT_LIBELEKTRA4-YAJL_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-YAJL_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-YAJL_PACKAGE_BREAKS "libelektra-yajl4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-YAJL_PACKAGE_REPLACES "libelektra-yajl4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-YAJL_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-CRYPTO_PACKAGE_NAME "libelektra4-crypto") - set (CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DISPLAY_NAME "libelektra4-crypto") - set (CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DESCRIPTION "This package contains the crypto plugins.") - set (CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-CRYPTO_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-CRYPTO_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-CURL_PACKAGE_NAME "libelektra4-curl") - set (CPACK_COMPONENT_LIBELEKTRA4-CURL_DISPLAY_NAME "libelektra4-curl") - set (CPACK_COMPONENT_LIBELEKTRA4-CURL_DESCRIPTION "This package contains the 'curlget' plugin.") - set (CPACK_COMPONENT_LIBELEKTRA4-CURL_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-CURL_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-CURL_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-JOURNALD_PACKAGE_NAME "libelektra4-journald") - set (CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DISPLAY_NAME "libelektra4-journald") - set (CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DESCRIPTION "This package contains the 'journald' plugins.") - set (CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-JOURNALD_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-JOURNALD_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-YAMLCPP_PACKAGE_NAME "libelektra4-yamlcpp") - set (CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DISPLAY_NAME "libelektra4-yamlcpp") - set (CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DESCRIPTION "This package contains the 'yamlcpp' plugin.") - set (CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-YAMLCPP_PACKAGE_SECTION "libs") - - set (CPACK_DEBIAN_LIBELEKTRA4-LUA_PACKAGE_NAME "libelektra4-lua") - set (CPACK_COMPONENT_LIBELEKTRA4-LUA_DISPLAY_NAME "libelektra4-lua") - set (CPACK_COMPONENT_LIBELEKTRA4-LUA_DESCRIPTION "This package contains the 'lua' plugin.") - set (CPACK_COMPONENT_LIBELEKTRA4-LUA_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LIBELEKTRA4-LUA_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-LUA_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-JAVA_PACKAGE_NAME "libelektra4-java") - set (CPACK_COMPONENT_LIBELEKTRA4-JAVA_DISPLAY_NAME "libelektra4-java") - set (CPACK_COMPONENT_LIBELEKTRA4-JAVA_DESCRIPTION "This package contains the 'jni' plugin.") - set (CPACK_COMPONENT_LIBELEKTRA4-JAVA_DEPENDS "libelektra4" "java-elektra") - set (CPACK_DEBIAN_LIBELEKTRA4-JAVA_PACKAGE_DEPENDS "default-jdk") - set (CPACK_DEBIAN_LIBELEKTRA4-JAVA_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-JAVA_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_JAVA-ELEKTRA_PACKAGE_NAME "java-elektra") - set (CPACK_COMPONENT_JAVA-ELEKTRA_DISPLAY_NAME "java-elektra") - set (CPACK_COMPONENT_JAVA-ELEKTRA_DESCRIPTION "This package contains the Java bindings.") - set (CPACK_COMPONENT_JAVA-ELEKTRA_DEPENDS "libelektra4") - set (CPACK_DEBIAN_JAVA-ELEKTRA_PACKAGE_DEPENDS "default-jdk") - set (CPACK_DEBIAN_JAVA-ELEKTRA_PACKAGE_SECTION "java") - - set (CPACK_DEBIAN_LUA-ELEKTRA_PACKAGE_NAME "lua-elektra") - set (CPACK_COMPONENT_LUA-ELEKTRA_DISPLAY_NAME "lua-elektra") - set (CPACK_COMPONENT_LUA-ELEKTRA_DESCRIPTION "This package contains the Lua bindings.") - set (CPACK_COMPONENT_LUA-ELEKTRA_DEPENDS "libelektra4") - set (CPACK_DEBIAN_LUA-ELEKTRA_PACKAGE_SECTION "interpreters") - set (CPACK_DEBIAN_LUA-ELEKTRA_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_NAME "python3-elektra") - set (CPACK_COMPONENT_PYTHON3-ELEKTRA_DISPLAY_NAME "python3-elektra") - set (CPACK_COMPONENT_PYTHON3-ELEKTRA_DESCRIPTION "This package contains the Python 3 bindings.") - set (CPACK_COMPONENT_PYTHON3-ELEKTRA_DEPENDS "libelektra4") - set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_DEPENDS "python3") - set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_SECTION "python") - set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_CONTROL_STRICT_PERMISSION TRUE) - file (GLOB CONTROL_FILES_PYTHON3-ELEKTRA "${CMAKE_SOURCE_DIR}/scripts/packaging/debian/control/python3-elektra/*") - file (COPY ${CONTROL_FILES_PYTHON3-ELEKTRA} - DESTINATION "${CMAKE_BINARY_DIR}/scripts/packaging/debian/control/python3-elektra/") - file (GLOB CONTROL_FILES_PYTHON3-ELEKTRA_BINARY "${CMAKE_BINARY_DIR}/scripts/packaging/debian/control/python3-elektra/*") - set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_CONTROL_EXTRA "${CONTROL_FILES_PYTHON3-ELEKTRA_BINARY}") - set (CPACK_DEBIAN_PYTHON3-ELEKTRA_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_LIBELEKTRA4-PYTHON_PACKAGE_NAME "libelektra4-python") - set (CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DISPLAY_NAME "libelektra4-python") - set (CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DESCRIPTION "This package contains the 'python' plugin.") - set (CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DEPENDS "libelektra4" "python3-elektra") - set (CPACK_DEBIAN_LIBELEKTRA4-PYTHON_PACKAGE_SECTION "libs") - set (CPACK_DEBIAN_LIBELEKTRA4-PYTHON_PACKAGE_BREAKS "libelelektra-python4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-PYTHON_PACKAGE_REPLACES "libelelektra-python4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_LIBELEKTRA4-PYTHON_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_ELEKTRA-BIN-EXTRA_PACKAGE_NAME "elektra-bin-extra") - set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DISPLAY_NAME "elektra-bin-extra") - set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DESCRIPTION - "This package contains extra command line utilities for Elektra written in non-shell languages like python.") - set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DEPENDS "libelektra4") - set (CPACK_DEBIAN_ELEKTRA-BIN-EXTRA_PACKAGE_DEPENDS "python-all") - set (CPACK_DEBIAN_ELEKTRA-BIN-EXTRA_PACKAGE_SECTION "misc") - set (CPACK_DEBIAN_ELEKTRA-BIN-EXTRA_PACKAGE_CONFLICTS "elektra-bin (<< ${CPACK_DEBIAN_PACKAGE_VERSION})") - set (CPACK_DEBIAN_ELEKTRA-BIN-EXTRA_DEBUGINFO_PACKAGE "OFF") - - set (CPACK_DEBIAN_ELEKTRA-QT-GUI_PACKAGE_NAME "elektra-qt-gui") - set (CPACK_COMPONENT_ELEKTRA-QT-GUI_DISPLAY_NAME "elektra-qt-gui") - set (CPACK_COMPONENT_ELEKTRA-QT-GUI_DESCRIPTION "This package contains a Qt-based graphical interface for Elektra.") - set (CPACK_COMPONENT_ELEKTRA-QT-GUI_DEPENDS "libelektra4") - if ("${LSB_DISTRIB}" MATCHES "Ubuntu20.04") - # qml-module-qtquick-controls-styles-breeze not available on ubuntu focal - set ( - CPACK_DEBIAN_ELEKTRA-QT-GUI_PACKAGE_DEPENDS - "qml-module-qtquick2, qml-module-qtquick-window2, qml-module-qtquick-dialogs, qml-module-qt-labs-folderlistmodel, qml-module-qt-labs-settings" - ) - else () - set ( - CPACK_DEBIAN_ELEKTRA-QT-GUI_PACKAGE_DEPENDS - "qml-module-qtquick2, qml-module-qtquick-window2, qml-module-qtquick-dialogs, qml-module-qt-labs-folderlistmodel, qml-module-qt-labs-settings, qml-module-qtquick-controls-styles-breeze" - ) - endif () - set (CPACK_DEBIAN_ELEKTRA-QT-GUI_PACKAGE_SECTION "misc") - set (CPACK_DEBIAN_ELEKTRA-QT-GUI_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_NAME "elektra-tests") - set (CPACK_COMPONENT_ELEKTRA-TESTS_DISPLAY_NAME "elektra-tests") - set (CPACK_COMPONENT_ELEKTRA-TESTS_DESCRIPTION "This package contains the Elektra test suite.") - set (CPACK_COMPONENT_ELEKTRA-TESTS_DEPENDS "libelektra4-full" "elektra-bin") - set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_SECTION "misc") - set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_PRIORITY "extra") - set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_BREAKS - "libelektra-test (<<${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_REPLACES - "libelektra-test (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_ELEKTRA-TESTS_DEBUGINFO_PACKAGE "ON") - - set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_NAME "elektra-doc") - set (CPACK_COMPONENT_ELEKTRA-DOC_DISPLAY_NAME "elektra-doc") - set (CPACK_COMPONENT_ELEKTRA-DOC_DESCRIPTION "This package contains the API documentation for the Elektra libraries.") - set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_ARCHITECTURE "all") - set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_SECTION "doc") - set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_BREAKS "libelektra-doc (<< ${DEBIAN_VERSION_RELEASE})") - set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_REPLACES "libelektra-doc (<< ${DEBIAN_VERSION_RELEASE})") - install ( - FILES "${CMAKE_SOURCE_DIR}/scripts/packaging/debian/doc-base/elektra-doc" - COMPONENT elektra-doc - DESTINATION ${TARGET_DOCUMENTATION_DOC-BASE_FOLDER}) - - set (CPACK_DEBIAN_LIBELEKTRA4-ALL_PACKAGE_NAME "libelektra4-all") - set (CPACK_COMPONENT_LIBELEKTRA4-ALL_DISPLAY_NAME "libelektra4-all") - set (CPACK_COMPONENT_LIBELEKTRA4-ALL_DESCRIPTION - "This package contains extra command line utilities for Elektra written in non-shell languages like python.") - set ( - CPACK_COMPONENT_LIBELEKTRA4-ALL_DEPENDS - "libelektra4" - "libelektra4-experimental" - "libelektra4-augeas" - "libelektra4-dbus" - "libelektra4-zeromq" - "libelektra4-java" - "libelektra4-lua" - "libelektra4-python" - "libelektra4-xmltool" - "libelektra4-xerces" - "libelektra4-yajl" - "libelektra4-yamlcpp" - "lua-elektra" - "elektra-bin" - "elektra-qt-gui" - "libelektra4-crypto" - "libelektra4-curl" - "libelektra4-journald" - "libelektra4-extra") - set (CPACK_DEBIAN_LIBELEKTRA4-ALL_PACKAGE_SECTION "misc") - set ( - CPACK_DEBIAN_LIBELEKTRA4-ALL_PACKAGE_DEPENDS - "libelektra4, libelektra4-experimental, libelektra4-augeas, libelektra4-dbus, libelektra4-zeromq, libelektra4-lua, libelektra4-python, libelektra4-xmltool, libelektra4-xerces, libelektra4-yajl, lua-elektra, elektra-bin, elektra-qt-gui, libelektra4-crypto, libelektra4-curl, libelektra4-journald, libelektra4-extra" - ) - set (CPACK_DEBIAN_LIBELEKTRA4-ALL_PACKAGE_RECOMMENDS "elektra-tests, elektra-doc, elektra-dbg, libelektra-dev") - - set (CPACK_DEBIAN_ELEKTRA-DBG_PACKAGE_NAME "elektra-dbg") - set (CPACK_COMPONENT_ELEKTRA-DBG_DISPLAY_NAME "elektra-dbg") - set (CPACK_COMPONENT_ELEKTRA-DBG_DESCRIPTION "This package contains the dependencies to all dbgsym packages of Elektra.") - set (CPACK_DEBIAN_ELEKTRA-DBG_PACKAGE_DEPENDS "${DBG_PACKAGE_NAMES_STR}") - set (CPACK_DEBIAN_ELEKTRA-DBG_PACKAGE_SECTION "debug") - - set (CPACK_DEBIAN_ELEKTRA-MISC_PACKAGE_NAME "elektra-misc") - set (CPACK_COMPONENT_ELEKTRA-MISC_DISPLAY_NAME "elektra-misc") - set (CPACK_COMPONENT_ELEKTRA-MISC_DESCRIPTION - "This package contains all files not part of any of the released Elektra packages.") - set (CPACK_DEBIAN_ELEKTRA-MISC_PACKAGE_ARCHITECTURE "all") - set (CPACK_DEBIAN_ELEKTRA-MISC_PACKAGE_SECTION "misc") - - # install copyright file - configure_file ("${CMAKE_SOURCE_DIR}/doc/THIRD-PARTY-LICENSES" "${CMAKE_BINARY_DIR}/doc/copyright" COPYONLY) - foreach (component ${DEBIAN_PACKAGES}) - install ( - FILES "${CMAKE_BINARY_DIR}/doc/copyright" - COMPONENT ${component} - DESTINATION "share/doc/${component}/") + if ("${OS_NAME}" MATCHES "Ubuntu|Debian") + set (DEBIAN_DBG_PACKAGE_NAMES "") + foreach (component ${PACKAGES}) + if (NOT component IN_LIST COMPONENTS_WITHOUT_DBGSYM) + list (APPEND DEBIAN_DBG_PACKAGE_NAMES "${component}-dbgsym") + endif () + endforeach () + string (REPLACE ";" ", " DEBIAN_DBG_PACKAGE_NAMES_STR "${DEBIAN_DBG_PACKAGE_NAMES}") + + # needed by ifs below + include (PackagingDebian) + + elseif ("${OS_NAME}" MATCHES "Fedora|CentOS") + # no debuginfo for python3-elektra on fedora + list (APPEND COMPONENTS_WITHOUT_DBGSYM "python3-elektra") + set (FEDORA_DBG_PACKAGE_NAMES "") + foreach (component ${PACKAGES}) + if (NOT component IN_LIST COMPONENTS_WITHOUT_DBGSYM) + list (APPEND FEDORA_DBG_PACKAGE_NAMES "${component}-debuginfo") + endif () endforeach () + string (REPLACE ";" ", " FEDORA_DBG_PACKAGE_NAMES_STR "${FEDORA_DBG_PACKAGE_NAMES}") - # compress and install changelog - add_custom_command ( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/changelog.Debian.gz" - COMMAND gzip -cn9 "debian/changelog" > "${CMAKE_CURRENT_BINARY_DIR}/changelog.Debian.gz" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/scripts/packaging" - COMMENT "Compressing changelog") + include (PackagingFedora) - add_custom_target (changelog ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/changelog.Debian.gz") + endif () - foreach (component ${DEBIAN_PACKAGES}) - install ( - FILES "${CMAKE_CURRENT_BINARY_DIR}/changelog.Debian.gz" - COMPONENT ${component} - DESTINATION "share/doc/${component}/") - endforeach () + # We need to alter the architecture names as per distro rules + if ("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86") + set (CPACK_PACKAGE_ARCHITECTURE i386) + endif ("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86") + if ("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64") + set (CPACK_PACKAGE_ARCHITECTURE amd64) + endif ("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64") + + set (CPACK_SYSTEM_NAME "${OS_DISTRIB}-${CPACK_PACKAGE_ARCHITECTURE}") - # We need to alter the architecture names as per distro rules - if ("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86") - set (CPACK_PACKAGE_ARCHITECTURE i386) - endif ("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86") - if ("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64") - set (CPACK_PACKAGE_ARCHITECTURE amd64) - endif ("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64") - endif ("${LSB_DISTRIB}" MATCHES "Ubuntu|Debian") - set (CPACK_SYSTEM_NAME "${LSB_DISTRIB}-${CPACK_PACKAGE_ARCHITECTURE}") message (STATUS "Detected ${CPACK_SYSTEM_NAME}. Use make package to build packages (${CPACK_GENERATOR}).") endif (UNIX) set (CPACK_RPM_SPEC_MORE_DEFINE "%define ignore \#") -set ( - CPACK_RPM_USER_FILELIST - "%ignore /etc/profile.d" - "%ignore /etc" - "%ignore /etc/bash_completion.d" - "%ignore /usr" - "%ignore /usr/local" - "%ignore /usr/local/bin" - "%ignore /usr/local/include" - "%ignore /usr/local/lib" - "%ignore /usr/local/share" - "%ignore /usr/local/share/man" - "%ignore /etc" - "%ignore /etc/bash_completion.d" - "%ignore /etc/bash_completion.d" - "%ignore /etc/bash_completion.d" - "%ignore /etc/bash_completion.d" - "%ignore /etc/bash_completion.d" - "%ignore /etc" - "%ignore /etc/bash_completion.d" - "%ignore /etc/bash_completion.d" - "%ignore /etc/bash_completion.d" - "%ignore /etc/bash_completion.d" - "%ignore /usr" - "%ignore /usr/bin" - "%ignore /usr/include" - "%ignore /usr/lib" - "%ignore /usr/share" - "%ignore /usr/share/doc" - "%ignore /usr/share/man") - include (CPack) foreach (component ${CPACK_COMPONENTS_ALL}) - if (NOT component IN_LIST DEBIAN_PACKAGES) + if (NOT component IN_LIST PACKAGES) message (SEND_ERROR "Component ${component} is not -part of DEBIAN_PACKAGES (ElektraPackaging.cmake). Please add it to this list, so the dependencies can be derived correctly.") +part of PACKAGES (ElektraPackaging.cmake). Please add it to this list, so the dependencies can be derived correctly.") endif () endforeach () diff --git a/scripts/cmake/Modules/PackagingDebian.cmake b/scripts/cmake/Modules/PackagingDebian.cmake new file mode 100644 index 00000000000..fbb8b0c64dc --- /dev/null +++ b/scripts/cmake/Modules/PackagingDebian.cmake @@ -0,0 +1,236 @@ +set (CPACK_DEBIAN_PACKAGE_VERSION "${PROJECT_VERSION}") +set (CPACK_DEBIAN_PACKAGE_RELEASE "1") +set (DEBIAN_VERSION_RELEASE "${CPACK_DEBIAN_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}") +set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Robert Sowula ") + +set (CPACK_GENERATOR "DEB") +set (CPACK_DEBIAN_PACKAGE_PRIORITY "optional") +set (CPACK_DEBIAN_PACKAGE_SOURCE "elektra") +set (CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) + +set (CPACK_DEB_COMPONENT_INSTALL "ON") +set (CPACK_DEB_PACKAGE_COMPONENT "ON") +set (CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS "ON") +set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON") +set (CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4_PACKAGE_SECTION "libs") +set ( + CPACK_DEBIAN_LIBELEKTRA4_PACKAGE_BREAKS + "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelektra-core4 (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})" +) +set ( + CPACK_DEBIAN_LIBELEKTRA4_PACKAGE_REPLACES + "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelelektra-core4 (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})" +) +set (CPACK_DEBIAN_LIBELEKTRA4_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") +set (CPACK_DEBIAN_LIBELEKTRA4_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-FULL_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_SECTION "libs") +set ( + CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_BREAKS + "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelektra-core4 (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})" +) +set ( + CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_REPLACES + "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelelektra-core4 (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})" +) +set (CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_CONFLICTS + "libelektra4 (<< ${CPACK_DEBIAN_PACKAGE_VERSION}), elektra-tests (<< ${CPACK_DEBIAN_PACKAGE_VERSION})") +set (CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") +set (CPACK_DEBIAN_LIBELEKTRA4-FULL_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-EXPERIMENTAL_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_BREAKS + "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelektra-core4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_REPLACES + "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelelektra-core4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") +set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-EXTRA_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_BREAKS + "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelektra-core4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_REPLACES + "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelelektra-core4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") +set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-BIN_DISPLAY_NAME}") +set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_SECTION "misc") +set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_BREAKS "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}),libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_REPLACES + "elektra-bin (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_CONFLICTS "kernel-patch-kdb") +set (CPACK_DEBIAN_ELEKTRA-BIN_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-AUGEAS_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-AUGEAS_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-AUGEAS_PACKAGE_BREAKS "libelektra-augeas4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-AUGEAS_PACKAGE_REPLACES "libelektra-augeas4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-AUGEAS_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-DBUS_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-DBUS_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-DBUS_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-DBUS_PACKAGE_BREAKS "libelektra-dbus4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-DBUS_PACKAGE_REPLACES "libelektra-dbus4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-DBUS_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA-DEV_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA-DEV_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-DEV_PACKAGE_SECTION "libdevel") + +set (CPACK_DEBIAN_LIBELEKTRA4-ZEROMQ_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-ZEROMQ_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-ZEROMQ_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-XMLTOOL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-XMLTOOL_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-XMLTOOL_PACKAGE_BREAKS "libelektra-xmltool4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-XMLTOOL_PACKAGE_REPLACES "libelektra-xmltool4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-XMLTOOL_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-XERCES_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-XERCES_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-XERCES_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-XERCES_PACKAGE_BREAKS "libelektra-xerces4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-XERCES_PACKAGE_REPLACES "libelektra-xerces4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-XERCES_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-YAJL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-YAJL_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-YAJL_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-YAJL_PACKAGE_BREAKS "libelektra-yajl4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-YAJL_PACKAGE_REPLACES "libelektra-yajl4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-YAJL_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-CRYPTO_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-CRYPTO_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-CRYPTO_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-CURL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-CURL_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-CURL_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-CURL_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-JOURNALD_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-JOURNALD_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-JOURNALD_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-YAMLCPP_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-YAMLCPP_PACKAGE_SECTION "libs") + +set (CPACK_DEBIAN_LIBELEKTRA4-LUA_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-LUA_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-LUA_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-LUA_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-JAVA_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-JAVA_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-JAVA_PACKAGE_DEPENDS "default-jdk") +set (CPACK_DEBIAN_LIBELEKTRA4-JAVA_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-JAVA_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_JAVA-ELEKTRA_PACKAGE_NAME "${CPACK_COMPONENT_JAVA-ELEKTRA_DISPLAY_NAME}") +set (CPACK_DEBIAN_JAVA-ELEKTRA_PACKAGE_DEPENDS "default-jdk") +set (CPACK_DEBIAN_JAVA-ELEKTRA_PACKAGE_SECTION "java") + +set (CPACK_DEBIAN_LUA-ELEKTRA_PACKAGE_NAME "${CPACK_COMPONENT_LUA-ELEKTRA_DISPLAY_NAME}") +set (CPACK_DEBIAN_LUA-ELEKTRA_PACKAGE_SECTION "interpreters") +set (CPACK_DEBIAN_LUA-ELEKTRA_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_NAME "${CPACK_COMPONENT_PYTHON3-ELEKTRA_DISPLAY_NAME}") +set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_DEPENDS "python3") +set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_SECTION "python") +set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_CONTROL_STRICT_PERMISSION TRUE) +file (GLOB CONTROL_FILES_PYTHON3-ELEKTRA "${CMAKE_SOURCE_DIR}/scripts/packaging/debian/control/python3-elektra/*") +file (COPY ${CONTROL_FILES_PYTHON3-ELEKTRA} DESTINATION "${CMAKE_BINARY_DIR}/scripts/packaging/debian/control/python3-elektra/") +file (GLOB CONTROL_FILES_PYTHON3-ELEKTRA_BINARY "${CMAKE_BINARY_DIR}/scripts/packaging/debian/control/python3-elektra/*") +set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_CONTROL_EXTRA "${CONTROL_FILES_PYTHON3-ELEKTRA_BINARY}") +set (CPACK_DEBIAN_PYTHON3-ELEKTRA_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_LIBELEKTRA4-PYTHON_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-PYTHON_PACKAGE_SECTION "libs") +set (CPACK_DEBIAN_LIBELEKTRA4-PYTHON_PACKAGE_BREAKS "libelelektra-python4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-PYTHON_PACKAGE_REPLACES "libelelektra-python4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_LIBELEKTRA4-PYTHON_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_ELEKTRA-BIN-EXTRA_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DISPLAY_NAME}") +set (CPACK_DEBIAN_ELEKTRA-BIN-EXTRA_PACKAGE_DEPENDS "python-all") +set (CPACK_DEBIAN_ELEKTRA-BIN-EXTRA_PACKAGE_SECTION "misc") +set (CPACK_DEBIAN_ELEKTRA-BIN-EXTRA_PACKAGE_CONFLICTS "${CPACK_COMPONENT_ELEKTRA-BIN_DISPLAY_NAME} (<< ${CPACK_DEBIAN_PACKAGE_VERSION})") +set (CPACK_DEBIAN_ELEKTRA-BIN-EXTRA_DEBUGINFO_PACKAGE "OFF") + +set (CPACK_DEBIAN_ELEKTRA-QT-GUI_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-QT-GUI_DISPLAY_NAME}") +if ("${OS_DISTRIB}" MATCHES "Ubuntu20.04") + # qml-module-qtquick-controls-styles-breeze not available on ubuntu focal + set ( + CPACK_DEBIAN_ELEKTRA-QT-GUI_PACKAGE_DEPENDS + "qml-module-qtquick2, qml-module-qtquick-window2, qml-module-qtquick-dialogs, qml-module-qt-labs-folderlistmodel, qml-module-qt-labs-settings" + ) +else () + set ( + CPACK_DEBIAN_ELEKTRA-QT-GUI_PACKAGE_DEPENDS + "qml-module-qtquick2, qml-module-qtquick-window2, qml-module-qtquick-dialogs, qml-module-qt-labs-folderlistmodel, qml-module-qt-labs-settings, qml-module-qtquick-controls-styles-breeze" + ) +endif () +set (CPACK_DEBIAN_ELEKTRA-QT-GUI_PACKAGE_SECTION "misc") +set (CPACK_DEBIAN_ELEKTRA-QT-GUI_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-TESTS_DISPLAY_NAME}") +set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_SECTION "misc") +set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_PRIORITY "extra") +set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_BREAKS + "libelektra-test (<<${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_REPLACES + "libelektra-test (<< ${DEBIAN_VERSION_RELEASE}), libelektra-full4 (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_ELEKTRA-TESTS_DEBUGINFO_PACKAGE "ON") + +set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-DOC_DISPLAY_NAME}") +set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_ARCHITECTURE "all") +set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_SECTION "doc") +set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_BREAKS "libelektra-doc (<< ${DEBIAN_VERSION_RELEASE})") +set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_REPLACES "libelektra-doc (<< ${DEBIAN_VERSION_RELEASE})") +install ( + FILES "${CMAKE_SOURCE_DIR}/scripts/packaging/debian/doc-base/elektra-doc" + COMPONENT elektra-doc + DESTINATION ${TARGET_DOCUMENTATION_DOC-BASE_FOLDER}) + +set (CPACK_DEBIAN_ELEKTRA-DBG_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-DBG_DISPLAY_NAME}") +set (CPACK_DEBIAN_ELEKTRA-DBG_PACKAGE_DEPENDS "${DEBIAN_DBG_PACKAGE_NAMES_STR}") +set (CPACK_DEBIAN_ELEKTRA-DBG_PACKAGE_SECTION "debug") + +set (CPACK_DEBIAN_LIBELEKTRA4-ALL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-ALL_DISPLAY_NAME}") +set (CPACK_DEBIAN_LIBELEKTRA4-ALL_PACKAGE_SECTION "misc") +set (CPACK_DEBIAN_LIBELEKTRA4-ALL_PACKAGE_DEPENDS ${LIBELEKTRA4-ALL_DEPENDS}) +set ( + CPACK_DEBIAN_LIBELEKTRA4-ALL_PACKAGE_RECOMMENDS + "${CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_NAME}, ${CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_NAME}, ${CPACK_DEBIAN_ELEKTRA-DBG_PACKAGE_NAME}, ${CPACK_DEBIAN_LIBELEKTRA-DEV_PACKAGE_NAME}" +) + +set (CPACK_DEBIAN_ELEKTRA-MISC_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-MISC_DISPLAY_NAME}") +set (CPACK_DEBIAN_ELEKTRA-MISC_PACKAGE_ARCHITECTURE "all") +set (CPACK_DEBIAN_ELEKTRA-MISC_PACKAGE_SECTION "misc") + +# install copyright file +configure_file ("${CMAKE_SOURCE_DIR}/doc/THIRD-PARTY-LICENSES" "${CMAKE_BINARY_DIR}/doc/copyright" COPYONLY) +foreach (component ${PACKAGES}) + install ( + FILES "${CMAKE_BINARY_DIR}/doc/copyright" + COMPONENT ${component} + DESTINATION "share/doc/${component}/") +endforeach () + +# compress and install changelog +add_custom_command ( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/changelog.Debian.gz" + COMMAND gzip -cn9 "debian/changelog" > "${CMAKE_CURRENT_BINARY_DIR}/changelog.Debian.gz" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/scripts/packaging" + COMMENT "Compressing changelog") + +add_custom_target (changelog ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/changelog.Debian.gz") + +foreach (component ${PACKAGES}) + install ( + FILES "${CMAKE_CURRENT_BINARY_DIR}/changelog.Debian.gz" + COMPONENT ${component} + DESTINATION "share/doc/${component}/") +endforeach () diff --git a/scripts/cmake/Modules/PackagingFedora.cmake b/scripts/cmake/Modules/PackagingFedora.cmake new file mode 100644 index 00000000000..f6102cfb617 --- /dev/null +++ b/scripts/cmake/Modules/PackagingFedora.cmake @@ -0,0 +1,200 @@ +set (CPACK_RPM_PACKAGE_VERSION "${PROJECT_VERSION}") +set (CPACK_RPM_PACKAGE_RELEASE "1") +set (RPM_VERSION_RELEASE "${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}") + +set (CPACK_GENERATOR "RPM") +set (CPACK_RPM_COMPONENT_INSTALL "ON") +set (CPACK_RPM_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_PACKAGE_VENDOR "libelektra (${PACKAGE_URL})") +set (CPACK_RPM_FILE_NAME RPM-DEFAULT) +set (CPACK_RPM_PACKAGE_AUTOREQ 1) +set (CPACK_RPM_PACKAGE_AUTOPROV 1) +set (CPACK_RPM_PACKAGE_AUTOREQPROV 1) + +set (CPACK_RPM_CHANGELOG_FILE "${CMAKE_SOURCE_DIR}/scripts/packaging/fedora/changelog") + +execute_process (COMMAND bash "${CMAKE_SOURCE_DIR}/scripts/packaging/fedora/map_licenses.sh" "${CMAKE_SOURCE_DIR}/doc/THIRD-PARTY-LICENSES" + OUTPUT_VARIABLE THIR_PARTY_LICENSES_STR) +set (CPACK_RPM_PACKAGE_LICENSE "${THIR_PARTY_LICENSES_STR} \n # For a breakdown of the licensing, see THIRD-PARTY-LICENSES") + +set ( + CPACK_RPM_BUILDREQUIRES + "make, git augeas-devel, boost-devel, cmake3, docbook-style-xsl, doxygen + discount, gawk, gcc-c++, GConf2-devel, graphviz, libcurl-devel, libdb-devel, + libdrm-devel, libgit2-devel, libxml2-devel, lua-devel, python3-devel, python-devel, + qt5-qtdeclarative-devel, qt5-qtsvg-devel, swig, systemd-devel, yajl-devel, + java-1.8.0-openjdk-devel, jna, ruby-devel, zeromq-devel") + +if (CPACK_PACKAGE_ARCHITECTURE MATCHES "x86_64") + # workaround because rpm autoprov doesn't include symlinks + set (CPACK_RPM_LIBELEKTRA4_PACKAGE_PROVIDES "libelektra-resolver.so()(64bit), libelektra-storage.so()(64bit)") +endif () + +set (CPACK_RPM_LIBELEKTRA4_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") +set (CPACK_RPM_LIBELEKTRA4_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-FULL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-FULL_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-FULL_PACKAGE_CONFLICTS + "libelektra4 < ${CPACK_RPM_PACKAGE_VERSION}, elektra-tests < ${CPACK_RPM_PACKAGE_VERSION}") +set (CPACK_RPM_LIBELEKTRA4-FULL_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") +set (CPACK_RPM_LIBELEKTRA4-FULL_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-FULL_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-FULL_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-FULL_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-EXPERIMENTAL_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") +set (CPACK_RPM_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-EXPERIMENTAL_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-EXPERIMENTAL_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-EXTRA_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-EXTRA_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-EXTRA_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}") +set (CPACK_RPM_LIBELEKTRA4-EXTRA_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-EXTRA_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-EXTRA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-EXTRA_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_ELEKTRA-BIN_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-BIN_DISPLAY_NAME}") +set (CPACK_RPM_ELEKTRA-BIN_PACKAGE_CONFLICTS "kernel-patch-kdb") +set (CPACK_RPM_ELEKTRA-BIN_PACKAGE_SUMMARY "${CPACK_COMPONENT_ELEKTRA-BIN_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-BIN_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-BIN_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA-DEV_PACKAGE_NAME "libelektra-devel") +set (CPACK_RPM_LIBELEKTRA-DEV_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA-DEV_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA-DEV_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") + +set (CPACK_RPM_LIBELEKTRA4-AUGEAS_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-AUGEAS_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-AUGEAS_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-AUGEAS_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-AUGEAS_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-DBUS_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-DBUS_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-DBUS_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-DBUS_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-DBUS_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-DBUS_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-ZEROMQ_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-ZEROMQ_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-ZEROMQ_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-ZEROMQ_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-ZEROMQ_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-XMLTOOL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-XMLTOOL_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-XMLTOOL_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-XMLTOOL_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-XMLTOOL_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-XERCES_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-XERCES_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-XERCES_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-XERCES_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-XERCES_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-XERCES_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-YAJL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-YAJL_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-YAJL_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-YAJL_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-YAJL_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-YAJL_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-CRYPTO_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-CRYPTO_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-CRYPTO_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-CRYPTO_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-CRYPTO_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-CURL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-CURL_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-CURL_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-CURL_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-CURL_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-CURL_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-JOURNALD_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-JOURNALD_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-JOURNALD_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-JOURNALD_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-JOURNALD_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-YAMLCPP_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-YAMLCPP_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-YAMLCPP_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-YAMLCPP_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-YAMLCPP_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-LUA_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-LUA_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-LUA_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-LUA_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-LUA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-LUA_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_LIBELEKTRA4-JAVA_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-JAVA_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-JAVA_PACKAGE_REQUIRES "java-1.8.0-openjdk-devel") +set (CPACK_RPM_LIBELEKTRA4-JAVA_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-JAVA_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-JAVA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-JAVA_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_JAVA-ELEKTRA_PACKAGE_NAME "${CPACK_COMPONENT_JAVA-ELEKTRA_DISPLAY_NAME}") +set (CPACK_RPM_JAVA-ELEKTRA_PACKAGE_REQUIRES "java-1.8.0-openjdk-devel") +set (CPACK_RPM_JAVA-ELEKTRA_PACKAGE_SUMMARY "${CPACK_COMPONENT_JAVA-ELEKTRA_DESCRIPTION}") +set (CPACK_RPM_JAVA-ELEKTRA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") + +set (CPACK_RPM_LUA-ELEKTRA_PACKAGE_NAME "${CPACK_COMPONENT_LUA-ELEKTRA_DISPLAY_NAME}") +set (CPACK_RPM_LUA-ELEKTRA_PACKAGE_SUMMARY "${CPACK_COMPONENT_LUA-ELEKTRA_DESCRIPTION}") +set (CPACK_RPM_LUA-ELEKTRA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LUA-ELEKTRA_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_PYTHON3-ELEKTRA_PACKAGE_NAME "${CPACK_COMPONENT_PYTHON3-ELEKTRA_DISPLAY_NAME}") +set (CPACK_RPM_PYTHON3-ELEKTRA_PACKAGE_REQUIRES "python3") +set (CPACK_RPM_PYTHON3-ELEKTRA_PACKAGE_SUMMARY "${CPACK_COMPONENT_PYTHON3-ELEKTRA_DESCRIPTION}") +set (CPACK_RPM_PYTHON3-ELEKTRA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_PYTHON3-ELEKTRA_DEBUGINFO_PACKAGE "OFF") + +set (CPACK_RPM_LIBELEKTRA4-PYTHON_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-PYTHON_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-PYTHON_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-PYTHON_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-PYTHON_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_ELEKTRA-BIN-EXTRA_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DISPLAY_NAME}") +set (CPACK_RPM_ELEKTRA-BIN-EXTRA_PACKAGE_REQUIRES "python3") +set (CPACK_RPM_ELEKTRA-BIN-EXTRA_PACKAGE_CONFLICTS "${CPACK_COMPONENT_ELEKTRA-BIN_DISPLAY_NAME} < ${CPACK_RPM_PACKAGE_VERSION}") +set (CPACK_RPM_ELEKTRA-BIN-EXTRA_PACKAGE_SUMMARY "${CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-BIN-EXTRA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-BIN-EXTRA_DEBUGINFO_PACKAGE "OFF") + +set (CPACK_RPM_ELEKTRA-QT-GUI_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-QT-GUI_DISPLAY_NAME}") +set (CPACK_RPM_ELEKTRA-QT-GUI_PACKAGE_REQUIRES "qt5-qtquickcontrols") +set (CPACK_RPM_ELEKTRA-QT-GUI_PACKAGE_SUMMARY "${CPACK_COMPONENT_ELEKTRA-QT-GUI_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-QT-GUI_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-QT-GUI_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_ELEKTRA-TESTS_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-TESTS_DISPLAY_NAME}") +set (CPACK_RPM_ELEKTRA-TESTS_PACKAGE_SUMMARY "${CPACK_COMPONENT_ELEKTRA-TESTS_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-TESTS_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-TESTS_DEBUGINFO_PACKAGE "ON") + +set (CPACK_RPM_ELEKTRA-DBG_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-DBG_DISPLAY_NAME}") +set (CPACK_RPM_ELEKTRA-DBG_PACKAGE_REQUIRES "${FEDORA_DBG_PACKAGE_NAMES_STR}") +set (CPACK_RPM_ELEKTRA-DBG_PACKAGE_SUMMARY "${CPACK_COMPONENT_ELEKTRA-DBG_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-DBG_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") + +set (CPACK_RPM_LIBELEKTRA4-ALL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-ALL_DISPLAY_NAME}") +set (CPACK_RPM_LIBELEKTRA4-ALL_PACKAGE_REQUIRES ${LIBELEKTRA4-ALL_DEPENDS}) +set ( + CPACK_RPM_LIBELEKTRA4-ALL_PACKAGE_RECOMMENDS + "${CPACK_RPM_ELEKTRA-TESTS_PACKAGE_NAME}, ${CPACK_RPM_ELEKTRA-DOC_PACKAGE_NAME}, ${CPACK_RPM_ELEKTRA-DBG_PACKAGE_NAME}, ${CPACK_RPM_LIBELEKTRA-DEV_PACKAGE_NAME}" +) +set (CPACK_RPM_LIBELEKTRA4-ALL_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA4-ALL_DESCRIPTION}") +set (CPACK_RPM_LIBELEKTRA4-ALL_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") + +set (CPACK_RPM_ELEKTRA-MISC_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-MISC_DISPLAY_NAME}") +set (CPACK_RPM_ELEKTRA-MISC_PACKAGE_SUMMARY "${CPACK_COMPONENT_ELEKTRA-MISC_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-MISC_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") + +set (CPACK_RPM_ELEKTRA-DOC_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-DOC_DISPLAY_NAME}") +set (CPACK_RPM_ELEKTRA-DOC_PACKAGE_SUMMARY "${CPACK_COMPONENT_ELEKTRA-DOC_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-DOC_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}") +set (CPACK_RPM_ELEKTRA-DOC_PACKAGE_ARCHITECTURE "noarch") + +# install copyright file +configure_file ("${CMAKE_SOURCE_DIR}/LICENSE.md" "${CMAKE_BINARY_DIR}/doc/LICENSE" COPYONLY) +configure_file ("${CMAKE_SOURCE_DIR}/doc/THIRD-PARTY-LICENSES" "${CMAKE_BINARY_DIR}/doc/THIRD-PARTY-LICENSES" COPYONLY) +foreach (component ${PACKAGES}) + install ( + FILES "${CMAKE_BINARY_DIR}/doc/LICENSE" "${CMAKE_BINARY_DIR}/doc/THIRD-PARTY-LICENSES" + COMPONENT ${component} + DESTINATION "share/licenses/${component}") +endforeach () diff --git a/scripts/docker/fedora/33/Dockerfile b/scripts/docker/fedora/33/Dockerfile index a723bb98b7a..c57de45c526 100644 --- a/scripts/docker/fedora/33/Dockerfile +++ b/scripts/docker/fedora/33/Dockerfile @@ -10,6 +10,8 @@ RUN dnf upgrade --refresh -y && dnf install -y \ dbus-devel \ diffutils \ dnf-plugins-core \ + discount \ + fedora-packager \ file \ findutils \ flex \ @@ -22,10 +24,12 @@ RUN dnf upgrade --refresh -y && dnf install -y \ jna \ libasan \ libcurl-devel \ + libdrm-devel \ libev-devel \ libgcrypt-devel \ libgit2-devel \ libmarkdown-devel \ + qt5-qtsvg-devel \ libubsan \ libuv-devel \ libxml2-devel \ @@ -38,13 +42,17 @@ RUN dnf upgrade --refresh -y && dnf install -y \ procps-ng \ python3-devel \ qt5-qtbase-devel \ + qt5-qtdeclarative-devel \ + rpmdevtools \ ruby-devel \ rubygem-test-unit \ swig \ + systemd-devel \ valgrind \ xerces-c-devel \ yajl-devel \ yaml-cpp-devel \ + zeromq-devel \ zlib-devel \ && dnf debuginfo-install -y \ bison \ diff --git a/scripts/kdb/find-tools b/scripts/kdb/find-tools index 3306ecedaf3..1de3e3c7b12 100755 --- a/scripts/kdb/find-tools +++ b/scripts/kdb/find-tools @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # @author Sebastian Bachmann, Kurt Micheli # @tags org diff --git a/scripts/packaging/fedora/changelog b/scripts/packaging/fedora/changelog new file mode 100644 index 00000000000..e69de29bb2d diff --git a/scripts/packaging/fedora/map_licenses.sh b/scripts/packaging/fedora/map_licenses.sh new file mode 100644 index 00000000000..fa33ad4ebf5 --- /dev/null +++ b/scripts/packaging/fedora/map_licenses.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +LICENSE_FILE=$1 + +LICENSES_WITHOUT_BSD=$(cat $LICENSE_FILE | grep "License:" | awk -F": " {' print $2'} | grep -v "^BSD.*" | sort | uniq | tr '\n' ',' | sed '$s/,$/\n/' | sed 's/,/ and /g') + +declare -A arr + +arr["Apache-2.0"]="ASL 2.0" +arr["BSL-1.0"]="Boost" +arr["OFL-1.1"]="OFL" +arr["Zlib"]="zlib" +arr["public-domain"]="Public Domain" + +for key in ${!arr[@]}; do + LICENSES_WITHOUT_BSD=$(echo $LICENSES_WITHOUT_BSD | sed "s/$key[^ ]*/${arr[${key}]}/g" ) +done + +echo "BSD and $LICENSES_WITHOUT_BSD" diff --git a/scripts/packaging/fedora/update-rpm-changelog.sh b/scripts/packaging/fedora/update-rpm-changelog.sh new file mode 100644 index 00000000000..a66bf872f8d --- /dev/null +++ b/scripts/packaging/fedora/update-rpm-changelog.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# +# @brief Adds an entry to the rpm changelog file + +USAGE=$( + cat << EOF +Usage: [-h] [-a AUTHOR] [-f FILE] [-m MESSAGE] [-v VERSION] +Adds a new entry to the rpm changelog. + -a=AUTHOR set the author of the changelog. + Defaults to git config user.email + -f=FILE path to the changelog. + Defaults to ./changelog. + -m=MESSAGE add a custom changelog message. + Default is: New upstream version. + -v=VERSION set the version of this changelog entry. + Default is: \$RVERSION. + -h display this help and exit. +EOF +) + +FILE="changelog" +MESSAGE="New upstream version" +VERSION=$RVERSION + +while getopts "ha:m:v:f:" opt; do + case $opt in + h) + echo "${USAGE}" + exit + ;; + a) + AUTHOR="${OPTARG}" + ;; + f) + FILE="${OPTARG}" + ;; + m) + MESSAGE="${OPTARG}" + ;; + v) + VERSION="${OPTARG}" + ;; + :) + printf "%s: missing argument for -%s\n" "${OPTARG}" >&2 + echo "${USAGE}" + exit 1 + ;; + \?) + printf "%s: illegal option: -%s\n" "${OPTARG}" >&2 + echo "${USAGE}" + exit 1 + ;; + esac +done + +if [ -z ${var+x} ]; then + AUTHOR="$(git config user.email)" +fi + +DATE=$(date "+%a %b %d %Y") + +ENTRY_HEADER="* $DATE $AUTHOR - $VERSION" +ENTRY_LOG="- $MESSAGE" + +sed -i "1s/^/$ENTRY_HEADER\n$ENTRY_LOG\n\n/" $FILE diff --git a/scripts/packaging/package.sh b/scripts/packaging/package.sh index 9232ce2dfe8..afd1ad062ef 100644 --- a/scripts/packaging/package.sh +++ b/scripts/packaging/package.sh @@ -4,41 +4,74 @@ ELEKTRA_PLUGINS='ALL;mozprefs;multifile;-gitresolver;jni;-ruby;-haskell;yamlcpp; ELEKTRA_TOOLS='ALL' ELEKTRA_BINDINGS='cpp;lua;python;jna;INTERCEPT' -# workaround for hardening flags -CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS) -CFLAGS=$(dpkg-buildflags --get CFLAGS) -CXXFLAGS=$(dpkg-buildflags --get CXXFLAGS) -LDFLAGS=$(dpkg-buildflags --get LDFLAGS) - -PY3VER=$(py3versions -d -v) - -CMAKE_ARGS="-DTARGET_PLUGIN_FOLDER='elektra4' \ - -DBUILD_STATIC=OFF \ - -DPython_ADDITIONAL_VERSIONS=$PY3VER \ - -DGTEST_ROOT='/usr/src/gtest' \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DPLUGINS=$ELEKTRA_PLUGINS \ - -DTOOLS=$ELEKTRA_TOOLS \ - -DBINDINGS=$ELEKTRA_BINDINGS \ - -DKDB_DB_SYSTEM:PATH=/etc/kdb \ - -DKDB_DB_HOME:PATH=/home \ - -DKDB_DB_USER:PATH=.config \ - -DINSTALL_DOCUMENTATION=ON \ - -DSWIG_EXECUTABLE=/usr/bin/swig3.0 \ - -DPYTHON_EXECUTABLE:PATH=/usr/bin/python3 \ - -DENABLE_TESTING=ON \ - -DINSTALL_TESTING=ON \ - -DENABLE_KDB_TESTING=OFF \ - -DINSTALL_SYSTEM_FILES=ON \ - -DBUILD_PDF=OFF \ - -DBUILD_FULL=ON \ - -DTARGET_DOCUMENTATION_HTML_FOLDER=share/doc/libelektra-doc/html \ - -DTARGET_TEST_DATA_FOLDER=share/libelektra-test/test-data \ - -DCMAKE_C_FLAGS=$CFLAGS \ - -DCMAKE_CXX_FLAGS=$CXXFLAGS \ - -DCMAKE_EXE_LINKER_FLAGS=$LDFLAGS \ - -DCMAKE_MODULE_LINKER_FLAGS=$LDFLAGS \ - -DCMAKE_SHARED_LINKER_FLAGS=$LDFLAGS" +OS_NAME=$(grep "^NAME=" /etc/os-release | awk -F= {' print $2'} | sed 's/\"//g') + +echo "DIST: $OS_NAME" + +if [[ $OS_NAME == "Fedora" ]]; then + + CMAKE_ARGS="-DTARGET_PLUGIN_FOLDER='elektra4' \ + -DBUILD_STATIC=OFF \ + -DGTEST_ROOT='/usr/src/gtest' \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DPLUGINS=$ELEKTRA_PLUGINS \ + -DTOOLS=$ELEKTRA_TOOLS \ + -DBINDINGS=$ELEKTRA_BINDINGS \ + -DKDB_DB_SYSTEM:PATH=/etc/kdb \ + -DKDB_DB_HOME:PATH=/home \ + -DKDB_DB_USER:PATH=.config \ + -DINSTALL_DOCUMENTATION=ON \ + -DSWIG_EXECUTABLE=/usr/bin/swig \ + -DPYTHON_EXECUTABLE:PATH=/usr/bin/python3 \ + -DENABLE_TESTING=ON \ + -DINSTALL_TESTING=ON \ + -DENABLE_KDB_TESTING=OFF \ + -DINSTALL_SYSTEM_FILES=ON \ + -DBUILD_PDF=OFF \ + -DBUILD_FULL=ON \ + -DTARGET_DOCUMENTATION_HTML_FOLDER=share/doc/libelektra-doc/html \ + -DTARGET_TEST_DATA_FOLDER=share/libelektra-test/test-data" +else + + PY3VER=$(py3versions -d -v) + # workaround for hardening flags + CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS) + CFLAGS=$(dpkg-buildflags --get CFLAGS) + CXXFLAGS=$(dpkg-buildflags --get CXXFLAGS) + LDFLAGS=$(dpkg-buildflags --get LDFLAGS) + + CMAKE_ARGS="-DTARGET_PLUGIN_FOLDER='elektra4' \ + -DBUILD_STATIC=OFF \ + -DPython_ADDITIONAL_VERSIONS=$PY3VER \ + -DGTEST_ROOT='/usr/src/gtest' \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DPLUGINS=$ELEKTRA_PLUGINS \ + -DTOOLS=$ELEKTRA_TOOLS \ + -DBINDINGS=$ELEKTRA_BINDINGS \ + -DKDB_DB_SYSTEM:PATH=/etc/kdb \ + -DKDB_DB_HOME:PATH=/home \ + -DKDB_DB_USER:PATH=.config \ + -DINSTALL_DOCUMENTATION=ON \ + -DSWIG_EXECUTABLE=/usr/bin/swig3.0 \ + -DPYTHON_EXECUTABLE:PATH=/usr/bin/python3 \ + -DENABLE_TESTING=ON \ + -DINSTALL_TESTING=ON \ + -DENABLE_KDB_TESTING=OFF \ + -DINSTALL_SYSTEM_FILES=ON \ + -DBUILD_PDF=OFF \ + -DBUILD_FULL=ON \ + -DTARGET_DOCUMENTATION_HTML_FOLDER=share/doc/libelektra-doc/html \ + -DTARGET_TEST_DATA_FOLDER=share/libelektra-test/test-data \ + -DCMAKE_C_FLAGS=$CFLAGS \ + -DCMAKE_CXX_FLAGS=$CXXFLAGS \ + -DCMAKE_EXE_LINKER_FLAGS=$LDFLAGS \ + -DCMAKE_MODULE_LINKER_FLAGS=$LDFLAGS \ + -DCMAKE_SHARED_LINKER_FLAGS=$LDFLAGS" +fi + + cmake $CMAKE_ARGS .. LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH} make package + +# TODO: change swig back to swig3.0 and add some kind of version handling for differnet distribitions \ No newline at end of file From b33c2cb182b2cafbd192c678f50e3c93be84b11d Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Sun, 20 Dec 2020 20:06:02 +0100 Subject: [PATCH 2/4] doc: add release notes --- doc/news/_preparation_next_release.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md index f3f0a76298d..9f269227293 100644 --- a/doc/news/_preparation_next_release.md +++ b/doc/news/_preparation_next_release.md @@ -26,7 +26,7 @@ You can also read the news [on our website](https://www.libelektra.org/news/0.9. ## Highlights - Important Changes to Keynames -- Debian Packaging with CPack +- Debian and Fedora Packaging with CPack - <> ### Important Changes to Keynames @@ -46,9 +46,10 @@ If you rely on specific behaviour of Elektra's Keynames and have already taken t - Fix combining dot-dot parts and escapes in key names. _(Klemens Böswirth)_ - Fix adding more than 10 warnings to a key. _(Klemens Böswirth)_ -### Debian Packaging with CPack +### Debian and Fedora Packaging with CPack - We are now using CPack to generate modular Debian and Ubuntu packages. This simplifies the packaging process and solves problems where a PR that introduces changes to installed files, fails. We can now also set distribution specifc dependencies with CPack, which is needed for some packages. _(Robert Sowula)_ +- We now also generate RPM packages for Fedora. _(Robert Sowula)_ ### <> From a031929b9c89125466c5b581657a2581891b239b Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Sun, 20 Dec 2020 20:09:09 +0100 Subject: [PATCH 3/4] packaging: fix missing last line --- scripts/packaging/package.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/packaging/package.sh b/scripts/packaging/package.sh index afd1ad062ef..5333ac368f6 100644 --- a/scripts/packaging/package.sh +++ b/scripts/packaging/package.sh @@ -73,5 +73,3 @@ fi cmake $CMAKE_ARGS .. LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH} make package - -# TODO: change swig back to swig3.0 and add some kind of version handling for differnet distribitions \ No newline at end of file From 1b5bb9775290022b89822f6c7b856de5af210e4e Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Sun, 20 Dec 2020 19:13:39 +0000 Subject: [PATCH 4/4] Restyled by shfmt --- scripts/packaging/fedora/map_licenses.sh | 4 ++-- .../packaging/fedora/update-rpm-changelog.sh | 2 +- scripts/packaging/package.sh | 20 +++++++++---------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/scripts/packaging/fedora/map_licenses.sh b/scripts/packaging/fedora/map_licenses.sh index fa33ad4ebf5..aeebaff72dd 100644 --- a/scripts/packaging/fedora/map_licenses.sh +++ b/scripts/packaging/fedora/map_licenses.sh @@ -2,7 +2,7 @@ LICENSE_FILE=$1 -LICENSES_WITHOUT_BSD=$(cat $LICENSE_FILE | grep "License:" | awk -F": " {' print $2'} | grep -v "^BSD.*" | sort | uniq | tr '\n' ',' | sed '$s/,$/\n/' | sed 's/,/ and /g') +LICENSES_WITHOUT_BSD=$(cat $LICENSE_FILE | grep "License:" | awk -F": " {' print $2'} | grep -v "^BSD.*" | sort | uniq | tr '\n' ',' | sed '$s/,$/\n/' | sed 's/,/ and /g') declare -A arr @@ -13,7 +13,7 @@ arr["Zlib"]="zlib" arr["public-domain"]="Public Domain" for key in ${!arr[@]}; do - LICENSES_WITHOUT_BSD=$(echo $LICENSES_WITHOUT_BSD | sed "s/$key[^ ]*/${arr[${key}]}/g" ) + LICENSES_WITHOUT_BSD=$(echo $LICENSES_WITHOUT_BSD | sed "s/$key[^ ]*/${arr[${key}]}/g") done echo "BSD and $LICENSES_WITHOUT_BSD" diff --git a/scripts/packaging/fedora/update-rpm-changelog.sh b/scripts/packaging/fedora/update-rpm-changelog.sh index a66bf872f8d..04aac122529 100644 --- a/scripts/packaging/fedora/update-rpm-changelog.sh +++ b/scripts/packaging/fedora/update-rpm-changelog.sh @@ -54,7 +54,7 @@ while getopts "ha:m:v:f:" opt; do done if [ -z ${var+x} ]; then - AUTHOR="$(git config user.email)" + AUTHOR="$(git config user.email)" fi DATE=$(date "+%a %b %d %Y") diff --git a/scripts/packaging/package.sh b/scripts/packaging/package.sh index 5333ac368f6..4e70659c831 100644 --- a/scripts/packaging/package.sh +++ b/scripts/packaging/package.sh @@ -10,7 +10,7 @@ echo "DIST: $OS_NAME" if [[ $OS_NAME == "Fedora" ]]; then - CMAKE_ARGS="-DTARGET_PLUGIN_FOLDER='elektra4' \ + CMAKE_ARGS="-DTARGET_PLUGIN_FOLDER='elektra4' \ -DBUILD_STATIC=OFF \ -DGTEST_ROOT='/usr/src/gtest' \ -DCMAKE_INSTALL_PREFIX=/usr \ @@ -30,17 +30,17 @@ if [[ $OS_NAME == "Fedora" ]]; then -DBUILD_PDF=OFF \ -DBUILD_FULL=ON \ -DTARGET_DOCUMENTATION_HTML_FOLDER=share/doc/libelektra-doc/html \ - -DTARGET_TEST_DATA_FOLDER=share/libelektra-test/test-data" + -DTARGET_TEST_DATA_FOLDER=share/libelektra-test/test-data" else - PY3VER=$(py3versions -d -v) - # workaround for hardening flags - CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS) - CFLAGS=$(dpkg-buildflags --get CFLAGS) - CXXFLAGS=$(dpkg-buildflags --get CXXFLAGS) - LDFLAGS=$(dpkg-buildflags --get LDFLAGS) + PY3VER=$(py3versions -d -v) + # workaround for hardening flags + CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS) + CFLAGS=$(dpkg-buildflags --get CFLAGS) + CXXFLAGS=$(dpkg-buildflags --get CXXFLAGS) + LDFLAGS=$(dpkg-buildflags --get LDFLAGS) - CMAKE_ARGS="-DTARGET_PLUGIN_FOLDER='elektra4' \ + CMAKE_ARGS="-DTARGET_PLUGIN_FOLDER='elektra4' \ -DBUILD_STATIC=OFF \ -DPython_ADDITIONAL_VERSIONS=$PY3VER \ -DGTEST_ROOT='/usr/src/gtest' \ @@ -69,7 +69,5 @@ else -DCMAKE_SHARED_LINKER_FLAGS=$LDFLAGS" fi - - cmake $CMAKE_ARGS .. LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH} make package