From a1fa4bf4abd40eddc0904e546bc9efdc38274949 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Sun, 20 Dec 2020 19:54:52 +0100 Subject: [PATCH 01/21] 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 92c6c4a3de1d2dc271e2c02406f3ded460818596 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Sun, 20 Dec 2020 20:06:02 +0100 Subject: [PATCH 02/21] doc: add release notes --- doc/news/_preparation_next_release.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md index a7437b19cd3..bbdc0da1bf5 100644 --- a/doc/news/_preparation_next_release.md +++ b/doc/news/_preparation_next_release.md @@ -34,7 +34,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 - <> @@ -125,6 +125,10 @@ kdb upgrade pr3555 values ### Debian 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 specific dependencies with CPack, which is needed for some packages. _(Robert Sowula)_ +### 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 91320d9269f4a06493d4d09b89e986b70c7ec461 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Sun, 20 Dec 2020 20:09:09 +0100 Subject: [PATCH 03/21] 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 e3e52a22d959aa481f8305f805c8237728669170 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Sun, 20 Dec 2020 19:13:39 +0000 Subject: [PATCH 04/21] 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 From bdcf3616f6e790f59e33071b9e3e7a9b184e1434 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Mon, 21 Dec 2020 03:26:09 +0100 Subject: [PATCH 05/21] scripts: remove bashism --- scripts/packaging/package.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/packaging/package.sh b/scripts/packaging/package.sh index 4e70659c831..10db5d35fdf 100644 --- a/scripts/packaging/package.sh +++ b/scripts/packaging/package.sh @@ -8,7 +8,7 @@ OS_NAME=$(grep "^NAME=" /etc/os-release | awk -F= {' print $2'} | sed 's/\"//g') echo "DIST: $OS_NAME" -if [[ $OS_NAME == "Fedora" ]]; then +if [ $OS_NAME = "Fedora" ]; then CMAKE_ARGS="-DTARGET_PLUGIN_FOLDER='elektra4' \ -DBUILD_STATIC=OFF \ From 0db67f5c5ed898311e8ed8344bfdacd037318d04 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Tue, 22 Dec 2020 19:51:35 +0100 Subject: [PATCH 06/21] packaging: generate yamlcpp debuginfo package on debian --- scripts/cmake/ElektraPackaging.cmake | 1 - scripts/cmake/Modules/PackagingDebian.cmake | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/ElektraPackaging.cmake b/scripts/cmake/ElektraPackaging.cmake index 9db2e268b4a..3e010abf7a1 100644 --- a/scripts/cmake/ElektraPackaging.cmake +++ b/scripts/cmake/ElektraPackaging.cmake @@ -43,7 +43,6 @@ set ( elektra-dbg libelektra-dev libelektra4-all - libelektra4-yamlcpp elektra-bin-extra java-elektra ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}) diff --git a/scripts/cmake/Modules/PackagingDebian.cmake b/scripts/cmake/Modules/PackagingDebian.cmake index fbb8b0c64dc..fe26849f80b 100644 --- a/scripts/cmake/Modules/PackagingDebian.cmake +++ b/scripts/cmake/Modules/PackagingDebian.cmake @@ -119,6 +119,7 @@ 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-YAMLCPP_DEBUGINFO_PACKAGE "ON") set (CPACK_DEBIAN_LIBELEKTRA4-LUA_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-LUA_DISPLAY_NAME}") set (CPACK_DEBIAN_LIBELEKTRA4-LUA_PACKAGE_SECTION "libs") From 66d3fad4289fabfc4ef1def1e2ef5bbbce5de372 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Fri, 25 Dec 2020 15:33:43 +0100 Subject: [PATCH 07/21] packaging: exclude components where deps are not fulfilled --- scripts/cmake/ElektraPackaging.cmake | 105 ++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/ElektraPackaging.cmake b/scripts/cmake/ElektraPackaging.cmake index 3e010abf7a1..cbea5b52432 100644 --- a/scripts/cmake/ElektraPackaging.cmake +++ b/scripts/cmake/ElektraPackaging.cmake @@ -1,3 +1,75 @@ +# ~~~ +# check_component_dependencies +# +# check and excludes a component from packaging if +# the plugin/binding/tool the component depends on +# is missing +# +# dependency_name name of the dependency the component depends on +# component_name name of the component +# PLUGIN whether the dependency is a plugin +# BINDING whether the dependency is a binding +# TOOL whether the dependency is a tool +# ADDITIONAL_DEPENDENCIES additional dependencies if the component +# has multiple dependencies +# ~~~ +macro (check_component_dependencies dependency_name component_name) + cmake_parse_arguments ( + ARG + "PLUGIN;BINDING;TOOL" # optional keywords + "" # one value keywords + "ADDITIONAL_DEPENDENCIES" # multi value keywords + ${ARGN}) + + set (TMP_DEPENDENCY_NAMES ${dependency_name}) + if (ARG_ADDITIONAL_DEPENDENCIES) + list (APPEND TMP_DEPENDENCY_NAMES "${ARG_ADDITIONAL_DEPENDENCIES}") + endif () + + set (TMP_UNFULFILLED_DEPENDENCIES "") + + foreach (name ${TMP_DEPENDENCY_NAMES}) + + if (ARG_PLUGIN) + if (NOT ${name} IN_LIST ADDED_PLUGINS) + set (TMP_DEPENDENCY_TYPE "plugin") + list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name}) + endif () + endif () + if (ARG_BINDING) + if (NOT ${name} IN_LIST ADDED_BINDINGS) + set (TMP_DEPENDENCY_TYPE "binding") + list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name}) + endif () + endif () + if (ARG_TOOL) + if (NOT ${name} IN_LIST TOOLS) + message (STATUS "ADDED_TOOLS: ${ADDED_TOOLS}") + set (TMP_DEPENDENCY_TYPE "tool") + list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name}) + endif () + endif () + + endforeach () + + list (LENGTH TMP_UNFULFILLED_DEPENDENCIES UNFULFILLED_DEPENDENCIES_AMOUNT) + list (LENGTH TMP_DEPENDENCY_NAMES EXPECTED_DEPENDENCIES_AMOUNT) + if (${UNFULFILLED_DEPENDENCIES_AMOUNT} GREATER 1) + set (TMP_DEPENDENCY_TYPE "${TMP_DEPENDENCY_TYPE}s") + endif () + string (REPLACE ";" ", " TMP_UNFULFILLED_DEPENDENCIES_STR "${TMP_UNFULFILLED_DEPENDENCIES}") + if (TMP_UNFULFILLED_DEPENDENCIES AND ${UNFULFILLED_DEPENDENCIES_AMOUNT} EQUAL ${EXPECTED_DEPENDENCIES_AMOUNT}) + # all dependencies of component are missing + message (STATUS "Exclude component ${component_name} because ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE} excluded.") + list (APPEND EXCLUDED_COMPONENTS ${component_name}) + elseif (TMP_UNFULFILLED_DEPENDENCIES AND ${UNFULFILLED_DEPENDENCIES_AMOUNT} LESS ${EXPECTED_DEPENDENCIES_AMOUNT}) + # at least one but not all dependencies of a component are missing + message (STATUS "Component ${component_name} is missing ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE}. This package will still be generated.") + endif () + +endmacro (check_component_dependencies) + + set (PACKAGE_URL "https://www.libelektra.org/") set (PACKAGE_BUGREPORT "https://bugs.libelektra.org/") set (PROJECT_VERSION "${KDB_VERSION}") @@ -55,6 +127,8 @@ foreach (component ${PACKAGES}) endforeach () string (REPLACE ";" ", " ALL_PLUGINS_STR "${ALL_PLUGINS}") +set (EXCLUDED_COMPONENTS "") + 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." @@ -127,10 +201,12 @@ if (UNIX) 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") + check_component_dependencies(augeas libelektra4-augeas PLUGIN) 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") + check_component_dependencies(dbus libelektra4-dbus PLUGIN) 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.") @@ -139,58 +215,72 @@ if (UNIX) 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") + check_component_dependencies(zeromqrecv libelektra4-zeromq PLUGIN ADDITIONAL_DEPENDENCIES zeromqsend) 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") + check_component_dependencies(xmltool libelektra4-xmltool PLUGIN) 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") + check_component_dependencies(xerces libelektra4-xerces PLUGIN) 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") + check_component_dependencies(yajl libelektra4-yajl PLUGIN) 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") + check_component_dependencies(crypto libelektra4-crypto PLUGIN) 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") + check_component_dependencies(curlget libelektra4-curl PLUGIN) 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") + check_component_dependencies(journald libelektra4-journald PLUGIN) 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") + check_component_dependencies(yamlcpp libelektra4-yamlcpp PLUGIN) 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") + check_component_dependencies(jni libelektra4-java PLUGIN) 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") + check_component_dependencies(lua libelektra4-lua PLUGIN) 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") + check_component_dependencies(jna java-elektra BINDING) 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") + check_component_dependencies(lua lua-elektra BINDING) 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") + check_component_dependencies(python python3-elektra BINDING) 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") + check_component_dependencies(python libelektra4-python PLUGIN) set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DISPLAY_NAME "elektra-bin-extra") set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DESCRIPTION @@ -200,6 +290,7 @@ if (UNIX) 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") + check_component_dependencies(qt-gui elektra-qt-gui TOOL) set (CPACK_COMPONENT_ELEKTRA-TESTS_DISPLAY_NAME "elektra-tests") set (CPACK_COMPONENT_ELEKTRA-TESTS_DESCRIPTION "This package contains the Elektra test suite.") @@ -210,7 +301,7 @@ if (UNIX) 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.") + "This package provides the dependencies for all Elektra packages.") set ( CPACK_COMPONENT_LIBELEKTRA4-ALL_DEPENDS "libelektra4" @@ -240,6 +331,17 @@ if (UNIX) 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.") + # exclude components for package generation where dependencies are not fulfilled. + foreach(component ${EXCLUDED_COMPONENTS}) + list (REMOVE_ITEM PACKAGES ${component}) + endforeach(component) + # remove libelektra4-all package if a component is excluded + if (EXCLUDED_COMPONENTS) + list (REMOVE_ITEM PACKAGES libelektra4-all) + string (REPLACE ";" ", " EXCLUDED_COMPONENTS_STR "${EXCLUDED_COMPONENTS}") + message (STATUS "Excluding libelektra4-all because following components are excluded: ${EXCLUDED_COMPONENTS_STR}".) + list (APPEND EXCLUDED_COMPONENTS libelektra4-all) + endif() # For Debian-based distros we want to create DEB packages. if ("${OS_NAME}" MATCHES "Ubuntu|Debian") set (DEBIAN_DBG_PACKAGE_NAMES "") @@ -250,7 +352,6 @@ if (UNIX) endforeach () string (REPLACE ";" ", " DEBIAN_DBG_PACKAGE_NAMES_STR "${DEBIAN_DBG_PACKAGE_NAMES}") - # needed by ifs below include (PackagingDebian) elseif ("${OS_NAME}" MATCHES "Fedora|CentOS") From 90c96e8bf1a9d2f1e643ec8c0e960909f6559d44 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Fri, 25 Dec 2020 16:59:13 +0100 Subject: [PATCH 08/21] packaging: disable debuginfo packages on Release build type --- scripts/cmake/ElektraPackaging.cmake | 7 ++++ scripts/cmake/Modules/PackagingDebian.cmake | 44 ++++++++++----------- scripts/cmake/Modules/PackagingFedora.cmake | 42 ++++++++++---------- 3 files changed, 50 insertions(+), 43 deletions(-) diff --git a/scripts/cmake/ElektraPackaging.cmake b/scripts/cmake/ElektraPackaging.cmake index cbea5b52432..9a37cff3358 100644 --- a/scripts/cmake/ElektraPackaging.cmake +++ b/scripts/cmake/ElektraPackaging.cmake @@ -129,6 +129,13 @@ string (REPLACE ";" ", " ALL_PLUGINS_STR "${ALL_PLUGINS}") set (EXCLUDED_COMPONENTS "") +if (CMAKE_BUILD_TYPE MATCHES "Release") + set (PACKAGE_DEBUGINFO "OFF") + list (REMOVE_ITEM PACKAGES elektra-dbg) +else () + set (PACKAGE_DEBUGINFO "ON") +endif () + 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." diff --git a/scripts/cmake/Modules/PackagingDebian.cmake b/scripts/cmake/Modules/PackagingDebian.cmake index fe26849f80b..599309352b3 100644 --- a/scripts/cmake/Modules/PackagingDebian.cmake +++ b/scripts/cmake/Modules/PackagingDebian.cmake @@ -25,7 +25,7 @@ set ( "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_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-FULL_DISPLAY_NAME}") set (CPACK_DEBIAN_LIBELEKTRA4-FULL_PACKAGE_SECTION "libs") @@ -40,7 +40,7 @@ set ( 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-FULL_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-EXPERIMENTAL_DISPLAY_NAME}") set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_SECTION "libs") @@ -49,7 +49,7 @@ set (CPACK_DEBIAN_LIBELEKTRA4-EXPERIMENTAL_PACKAGE_BREAKS 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-EXPERIMENTAL_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-EXTRA_DISPLAY_NAME}") set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_SECTION "libs") @@ -58,7 +58,7 @@ set (CPACK_DEBIAN_LIBELEKTRA4-EXTRA_PACKAGE_BREAKS 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_LIBELEKTRA4-EXTRA_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-BIN_DISPLAY_NAME}") set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_SECTION "misc") @@ -66,69 +66,69 @@ set (CPACK_DEBIAN_ELEKTRA-BIN_PACKAGE_BREAKS "elektra-bin (<< ${DEBIAN_VERSION_R 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_ELEKTRA-BIN_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-AUGEAS_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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_LIBELEKTRA4-DBUS_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-ZEROMQ_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-XMLTOOL_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-XERCES_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-YAJL_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-CRYPTO_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-CURL_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-JOURNALD_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-YAMLCPP_DEBUGINFO_PACKAGE "ON") +set (CPACK_DEBIAN_LIBELEKTRA4-YAMLCPP_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-LUA_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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_LIBELEKTRA4-JAVA_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_DEBIAN_JAVA-ELEKTRA_PACKAGE_NAME "${CPACK_COMPONENT_JAVA-ELEKTRA_DISPLAY_NAME}") set (CPACK_DEBIAN_JAVA-ELEKTRA_PACKAGE_DEPENDS "default-jdk") @@ -136,7 +136,7 @@ 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_LUA-ELEKTRA_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_NAME "${CPACK_COMPONENT_PYTHON3-ELEKTRA_DISPLAY_NAME}") set (CPACK_DEBIAN_PYTHON3-ELEKTRA_PACKAGE_DEPENDS "python3") @@ -146,13 +146,13 @@ file (GLOB CONTROL_FILES_PYTHON3-ELEKTRA "${CMAKE_SOURCE_DIR}/scripts/packaging/ 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_PYTHON3-ELEKTRA_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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_LIBELEKTRA4-PYTHON_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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") @@ -174,7 +174,7 @@ else () ) endif () set (CPACK_DEBIAN_ELEKTRA-QT-GUI_PACKAGE_SECTION "misc") -set (CPACK_DEBIAN_ELEKTRA-QT-GUI_DEBUGINFO_PACKAGE "ON") +set (CPACK_DEBIAN_ELEKTRA-QT-GUI_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-TESTS_DISPLAY_NAME}") set (CPACK_DEBIAN_ELEKTRA-TESTS_PACKAGE_SECTION "misc") @@ -183,7 +183,7 @@ 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-TESTS_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-DOC_DISPLAY_NAME}") set (CPACK_DEBIAN_ELEKTRA-DOC_PACKAGE_ARCHITECTURE "all") diff --git a/scripts/cmake/Modules/PackagingFedora.cmake b/scripts/cmake/Modules/PackagingFedora.cmake index f6102cfb617..e6895bedbe6 100644 --- a/scripts/cmake/Modules/PackagingFedora.cmake +++ b/scripts/cmake/Modules/PackagingFedora.cmake @@ -34,7 +34,7 @@ set (CPACK_RPM_LIBELEKTRA4_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4_DISPLAY_N 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_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_RPM_LIBELEKTRA4-FULL_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA4-FULL_DISPLAY_NAME}") set (CPACK_RPM_LIBELEKTRA4-FULL_PACKAGE_CONFLICTS @@ -42,25 +42,25 @@ set (CPACK_RPM_LIBELEKTRA4-FULL_PACKAGE_CONFLICTS 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-FULL_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-EXPERIMENTAL_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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_LIBELEKTRA4-EXTRA_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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_ELEKTRA-BIN_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_RPM_LIBELEKTRA-DEV_PACKAGE_NAME "libelektra-devel") set (CPACK_RPM_LIBELEKTRA-DEV_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA-DEV_DESCRIPTION}") @@ -69,63 +69,63 @@ 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-AUGEAS_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-DBUS_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-ZEROMQ_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-XMLTOOL_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-XERCES_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-YAJL_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-CRYPTO_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-CURL_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-JOURNALD_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-YAMLCPP_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-LUA_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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_LIBELEKTRA4-JAVA_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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") @@ -135,7 +135,7 @@ 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_LUA-ELEKTRA_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_RPM_PYTHON3-ELEKTRA_PACKAGE_NAME "${CPACK_COMPONENT_PYTHON3-ELEKTRA_DISPLAY_NAME}") set (CPACK_RPM_PYTHON3-ELEKTRA_PACKAGE_REQUIRES "python3") @@ -146,7 +146,7 @@ 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_LIBELEKTRA4-PYTHON_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") set (CPACK_RPM_ELEKTRA-BIN-EXTRA_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DISPLAY_NAME}") set (CPACK_RPM_ELEKTRA-BIN-EXTRA_PACKAGE_REQUIRES "python3") @@ -159,12 +159,12 @@ set (CPACK_RPM_ELEKTRA-QT-GUI_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-QT-GUI_DIS 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-QT-GUI_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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-TESTS_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}") 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}") From 6f7e8a3bdd05586626a2eeeee48dc64d258fa42e Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Fri, 25 Dec 2020 17:03:57 +0100 Subject: [PATCH 09/21] doc: update install.md for packaging --- doc/INSTALL.md | 63 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 18 deletions(-) diff --git a/doc/INSTALL.md b/doc/INSTALL.md index c62bc56784c..09acaf6210a 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -88,11 +88,9 @@ apt-get source -b elektra To build Debian Packages from the source you might want to use: ```sh -dpkg-buildpackage -us -uc -sa +make package ``` -(You need to be in the Debian branch, see [GIT](GIT.md)) - ## macOS You can install Elektra using [Homebrew](http://brew.sh) via the shell command: @@ -111,7 +109,50 @@ Please refer to the section OS Independent below. First follow the steps in [COMPILE](COMPILE.md). -After you completed building Elektra on your own, there are multiple options how to install it. For example, with make or cPack tools. +After you completed building Elektra on your own, there are multiple options how to install it. For example, with make or CPack tools. +We recommend that you generate your own packages with CPack so ensure compatibility with future releases. + +### CPack + +The current supported systems are: Debian, Ubuntu and Fedora. + +First follow the steps in [COMPILE](COMPILE.md). + +Then use: + +```sh +make package +``` +which will create a package for distributions where a Generator is implemented. + +You can find the generated packages in the `packages` directory of the build directory. + +> NOTE: If all plugins/bindings/tools a package includes are excluded, the package will be not generated. + +#### Debian/Ubuntu + +On Debian based distributions you will need to set LD_LIBRARY_PATH before generating the package. +Simply `cd` into the build directory and run following command: + +```sh +LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH} make package +``` + +To install the packages run this in the `packages` directory: + +```sh +dpkg -i * +``` + +#### Fedora + +To install the packages run this in the `packages` directory: + +```sh +rpm -U * +``` + + ### make @@ -134,20 +175,6 @@ or in the build directory (will not honor `DESTDIR`!): xargs rm < install_manifest.txt ``` -### CPack - -First follow the steps in [COMPILE](COMPILE.md). - -Then use: - -```sh -cpack -``` - -which should create a package for distributions where a Generator is -implemented. See [this cmake file](/scripts/cmake/ElektraPackaging.cmake) for available Generators -and send a merge request for your system. - ## Troubleshooting ### Error Loading Libraries From 1a867da80c2cba12e474aaeca9544a5c64288763 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 25 Dec 2020 16:16:58 +0000 Subject: [PATCH 10/21] Restyled by prettier-markdown --- doc/INSTALL.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/INSTALL.md b/doc/INSTALL.md index 09acaf6210a..8d234e905c4 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -123,7 +123,8 @@ Then use: ```sh make package ``` -which will create a package for distributions where a Generator is implemented. + +which will create a package for distributions where a Generator is implemented. You can find the generated packages in the `packages` directory of the build directory. @@ -152,8 +153,6 @@ To install the packages run this in the `packages` directory: rpm -U * ``` - - ### make ```sh From 75b36508f411bdc192a8ce639d2df39cbbdaeda9 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Fri, 25 Dec 2020 17:21:56 +0100 Subject: [PATCH 11/21] style: reformat cmake --- scripts/cmake/ElektraPackaging.cmake | 74 +++++++++++++++------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/scripts/cmake/ElektraPackaging.cmake b/scripts/cmake/ElektraPackaging.cmake index 9a37cff3358..f0d3fe10df2 100644 --- a/scripts/cmake/ElektraPackaging.cmake +++ b/scripts/cmake/ElektraPackaging.cmake @@ -1,7 +1,7 @@ # ~~~ # check_component_dependencies # -# check and excludes a component from packaging if +# check and excludes a component from packaging if # the plugin/binding/tool the component depends on # is missing # @@ -11,15 +11,15 @@ # BINDING whether the dependency is a binding # TOOL whether the dependency is a tool # ADDITIONAL_DEPENDENCIES additional dependencies if the component -# has multiple dependencies +# has multiple dependencies # ~~~ macro (check_component_dependencies dependency_name component_name) cmake_parse_arguments ( - ARG - "PLUGIN;BINDING;TOOL" # optional keywords - "" # one value keywords - "ADDITIONAL_DEPENDENCIES" # multi value keywords - ${ARGN}) + ARG + "PLUGIN;BINDING;TOOL" # optional keywords + "" # one value keywords + "ADDITIONAL_DEPENDENCIES" # multi value keywords + ${ARGN}) set (TMP_DEPENDENCY_NAMES ${dependency_name}) if (ARG_ADDITIONAL_DEPENDENCIES) @@ -29,7 +29,7 @@ macro (check_component_dependencies dependency_name component_name) set (TMP_UNFULFILLED_DEPENDENCIES "") foreach (name ${TMP_DEPENDENCY_NAMES}) - + if (ARG_PLUGIN) if (NOT ${name} IN_LIST ADDED_PLUGINS) set (TMP_DEPENDENCY_TYPE "plugin") @@ -53,22 +53,27 @@ macro (check_component_dependencies dependency_name component_name) endforeach () list (LENGTH TMP_UNFULFILLED_DEPENDENCIES UNFULFILLED_DEPENDENCIES_AMOUNT) - list (LENGTH TMP_DEPENDENCY_NAMES EXPECTED_DEPENDENCIES_AMOUNT) + list (LENGTH TMP_DEPENDENCY_NAMES EXPECTED_DEPENDENCIES_AMOUNT) if (${UNFULFILLED_DEPENDENCIES_AMOUNT} GREATER 1) set (TMP_DEPENDENCY_TYPE "${TMP_DEPENDENCY_TYPE}s") endif () string (REPLACE ";" ", " TMP_UNFULFILLED_DEPENDENCIES_STR "${TMP_UNFULFILLED_DEPENDENCIES}") if (TMP_UNFULFILLED_DEPENDENCIES AND ${UNFULFILLED_DEPENDENCIES_AMOUNT} EQUAL ${EXPECTED_DEPENDENCIES_AMOUNT}) # all dependencies of component are missing - message (STATUS "Exclude component ${component_name} because ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE} excluded.") + message ( + STATUS + "Exclude component ${component_name} because ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE} excluded." + ) list (APPEND EXCLUDED_COMPONENTS ${component_name}) elseif (TMP_UNFULFILLED_DEPENDENCIES AND ${UNFULFILLED_DEPENDENCIES_AMOUNT} LESS ${EXPECTED_DEPENDENCIES_AMOUNT}) # at least one but not all dependencies of a component are missing - message (STATUS "Component ${component_name} is missing ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE}. This package will still be generated.") + message ( + STATUS + "Component ${component_name} is missing ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE}. This package will still be generated." + ) endif () - -endmacro (check_component_dependencies) +endmacro (check_component_dependencies) set (PACKAGE_URL "https://www.libelektra.org/") set (PACKAGE_BUGREPORT "https://bugs.libelektra.org/") @@ -208,12 +213,12 @@ if (UNIX) 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") - check_component_dependencies(augeas libelektra4-augeas PLUGIN) + check_component_dependencies (augeas libelektra4-augeas PLUGIN) 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") - check_component_dependencies(dbus libelektra4-dbus PLUGIN) + check_component_dependencies (dbus libelektra4-dbus PLUGIN) 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.") @@ -222,72 +227,72 @@ if (UNIX) 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") - check_component_dependencies(zeromqrecv libelektra4-zeromq PLUGIN ADDITIONAL_DEPENDENCIES zeromqsend) + check_component_dependencies (zeromqrecv libelektra4-zeromq PLUGIN ADDITIONAL_DEPENDENCIES zeromqsend) 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") - check_component_dependencies(xmltool libelektra4-xmltool PLUGIN) + check_component_dependencies (xmltool libelektra4-xmltool PLUGIN) 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") - check_component_dependencies(xerces libelektra4-xerces PLUGIN) + check_component_dependencies (xerces libelektra4-xerces PLUGIN) 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") - check_component_dependencies(yajl libelektra4-yajl PLUGIN) + check_component_dependencies (yajl libelektra4-yajl PLUGIN) 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") - check_component_dependencies(crypto libelektra4-crypto PLUGIN) + check_component_dependencies (crypto libelektra4-crypto PLUGIN) 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") - check_component_dependencies(curlget libelektra4-curl PLUGIN) + check_component_dependencies (curlget libelektra4-curl PLUGIN) 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") - check_component_dependencies(journald libelektra4-journald PLUGIN) + check_component_dependencies (journald libelektra4-journald PLUGIN) 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") - check_component_dependencies(yamlcpp libelektra4-yamlcpp PLUGIN) + check_component_dependencies (yamlcpp libelektra4-yamlcpp PLUGIN) 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") - check_component_dependencies(jni libelektra4-java PLUGIN) + check_component_dependencies (jni libelektra4-java PLUGIN) 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") - check_component_dependencies(lua libelektra4-lua PLUGIN) + check_component_dependencies (lua libelektra4-lua PLUGIN) 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") - check_component_dependencies(jna java-elektra BINDING) + check_component_dependencies (jna java-elektra BINDING) 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") - check_component_dependencies(lua lua-elektra BINDING) + check_component_dependencies (lua lua-elektra BINDING) 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") - check_component_dependencies(python python3-elektra BINDING) + check_component_dependencies (python python3-elektra BINDING) 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") - check_component_dependencies(python libelektra4-python PLUGIN) + check_component_dependencies (python libelektra4-python PLUGIN) set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DISPLAY_NAME "elektra-bin-extra") set (CPACK_COMPONENT_ELEKTRA-BIN-EXTRA_DESCRIPTION @@ -297,7 +302,7 @@ if (UNIX) 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") - check_component_dependencies(qt-gui elektra-qt-gui TOOL) + check_component_dependencies (qt-gui elektra-qt-gui TOOL) set (CPACK_COMPONENT_ELEKTRA-TESTS_DISPLAY_NAME "elektra-tests") set (CPACK_COMPONENT_ELEKTRA-TESTS_DESCRIPTION "This package contains the Elektra test suite.") @@ -307,8 +312,7 @@ if (UNIX) 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 provides the dependencies for all Elektra packages.") + set (CPACK_COMPONENT_LIBELEKTRA4-ALL_DESCRIPTION "This package provides the dependencies for all Elektra packages.") set ( CPACK_COMPONENT_LIBELEKTRA4-ALL_DEPENDS "libelektra4" @@ -339,16 +343,16 @@ if (UNIX) set (CPACK_COMPONENT_ELEKTRA-MISC_DESCRIPTION "This package contains all files not part of any of the released Elektra packages.") # exclude components for package generation where dependencies are not fulfilled. - foreach(component ${EXCLUDED_COMPONENTS}) + foreach (component ${EXCLUDED_COMPONENTS}) list (REMOVE_ITEM PACKAGES ${component}) - endforeach(component) + endforeach (component) # remove libelektra4-all package if a component is excluded if (EXCLUDED_COMPONENTS) list (REMOVE_ITEM PACKAGES libelektra4-all) string (REPLACE ";" ", " EXCLUDED_COMPONENTS_STR "${EXCLUDED_COMPONENTS}") message (STATUS "Excluding libelektra4-all because following components are excluded: ${EXCLUDED_COMPONENTS_STR}".) list (APPEND EXCLUDED_COMPONENTS libelektra4-all) - endif() + endif () # For Debian-based distros we want to create DEB packages. if ("${OS_NAME}" MATCHES "Ubuntu|Debian") set (DEBIAN_DBG_PACKAGE_NAMES "") From f107879a2cc75c36adff4055f0ae17780a4224a3 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Sun, 27 Dec 2020 00:50:42 +0100 Subject: [PATCH 12/21] cmake: fix syntax error --- scripts/cmake/ElektraPackaging.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/ElektraPackaging.cmake b/scripts/cmake/ElektraPackaging.cmake index f0d3fe10df2..2cd3ddae049 100644 --- a/scripts/cmake/ElektraPackaging.cmake +++ b/scripts/cmake/ElektraPackaging.cmake @@ -350,7 +350,7 @@ if (UNIX) if (EXCLUDED_COMPONENTS) list (REMOVE_ITEM PACKAGES libelektra4-all) string (REPLACE ";" ", " EXCLUDED_COMPONENTS_STR "${EXCLUDED_COMPONENTS}") - message (STATUS "Excluding libelektra4-all because following components are excluded: ${EXCLUDED_COMPONENTS_STR}".) + message (STATUS "Excluding libelektra4-all because following components are excluded: ${EXCLUDED_COMPONENTS_STR}") list (APPEND EXCLUDED_COMPONENTS libelektra4-all) endif () # For Debian-based distros we want to create DEB packages. From ddfbdfbc59eb57e2f2d6793dcdffd217548701f0 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Sun, 27 Dec 2020 01:19:24 +0100 Subject: [PATCH 13/21] packaging: only exclude libelektra4-all if dependent packages excluded --- scripts/cmake/ElektraPackaging.cmake | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/cmake/ElektraPackaging.cmake b/scripts/cmake/ElektraPackaging.cmake index 2cd3ddae049..8e5b0deb896 100644 --- a/scripts/cmake/ElektraPackaging.cmake +++ b/scripts/cmake/ElektraPackaging.cmake @@ -347,10 +347,20 @@ if (UNIX) list (REMOVE_ITEM PACKAGES ${component}) endforeach (component) # remove libelektra4-all package if a component is excluded - if (EXCLUDED_COMPONENTS) + set (MISSING_COMPONENTS_LIBELEKTRA4-ALL "") + foreach (component ${CPACK_COMPONENT_LIBELEKTRA4-ALL_DEPENDS}) + if (component IN_LIST EXCLUDED_COMPONENTS) + list (APPEND MISSING_COMPONENTS_LIBELEKTRA4-ALL "${component}") + endif () + endforeach (component) + + if (MISSING_COMPONENTS_LIBELEKTRA4-ALL) + string (REPLACE ";" ", " MISSING_COMPONENTS_LIBELEKTRA4-ALL_STR "${MISSING_COMPONENTS_LIBELEKTRA4-ALL}") + message ( + STATUS + "Excluding libelektra4-all because following components are excluded: ${MISSING_COMPONENTS_LIBELEKTRA4-ALL_STR}" + ) list (REMOVE_ITEM PACKAGES libelektra4-all) - string (REPLACE ";" ", " EXCLUDED_COMPONENTS_STR "${EXCLUDED_COMPONENTS}") - message (STATUS "Excluding libelektra4-all because following components are excluded: ${EXCLUDED_COMPONENTS_STR}") list (APPEND EXCLUDED_COMPONENTS libelektra4-all) endif () # For Debian-based distros we want to create DEB packages. From 621978e3df52ea716c00c067278dad4eaf6ba74e Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Sun, 27 Dec 2020 16:31:08 +0100 Subject: [PATCH 14/21] packaging: cache package revision number Caching the revision number makes package revisions possible without changing any CMake files --- scripts/cmake/ElektraCache.cmake | 14 ++++++++++++++ scripts/cmake/ElektraPackaging.cmake | 1 - scripts/cmake/Modules/PackagingDebian.cmake | 1 - scripts/cmake/Modules/PackagingFedora.cmake | 1 - 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/cmake/ElektraCache.cmake b/scripts/cmake/ElektraCache.cmake index 4a1668d6b74..fc0e3de1efc 100644 --- a/scripts/cmake/ElektraCache.cmake +++ b/scripts/cmake/ElektraCache.cmake @@ -354,6 +354,20 @@ if (CMAKE_SKIP_BUILD_RPATH AND BUILD_TESTING) message (WARNING "You specified to remove RPATH, but did not disable tests. Please read doc/COMPILE.md#RPATH") endif () +# +# Packaging options +# + +set ( + CPACK_DEBIAN_PACKAGE_RELEASE + "1" + CACHE STRING "Revision number of the DEB package.") + +set ( + CPACK_RPM_PACKAGE_RELEASE + "1" + CACHE STRING "Revision number of the RPM package.") + # # Misc. # diff --git a/scripts/cmake/ElektraPackaging.cmake b/scripts/cmake/ElektraPackaging.cmake index 8e5b0deb896..5c8c680f65a 100644 --- a/scripts/cmake/ElektraPackaging.cmake +++ b/scripts/cmake/ElektraPackaging.cmake @@ -44,7 +44,6 @@ macro (check_component_dependencies dependency_name component_name) endif () if (ARG_TOOL) if (NOT ${name} IN_LIST TOOLS) - message (STATUS "ADDED_TOOLS: ${ADDED_TOOLS}") set (TMP_DEPENDENCY_TYPE "tool") list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name}) endif () diff --git a/scripts/cmake/Modules/PackagingDebian.cmake b/scripts/cmake/Modules/PackagingDebian.cmake index 599309352b3..0e2a952e6b3 100644 --- a/scripts/cmake/Modules/PackagingDebian.cmake +++ b/scripts/cmake/Modules/PackagingDebian.cmake @@ -1,5 +1,4 @@ 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 ") diff --git a/scripts/cmake/Modules/PackagingFedora.cmake b/scripts/cmake/Modules/PackagingFedora.cmake index e6895bedbe6..3051c2a433c 100644 --- a/scripts/cmake/Modules/PackagingFedora.cmake +++ b/scripts/cmake/Modules/PackagingFedora.cmake @@ -1,5 +1,4 @@ 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") From 2f0b58bffaf2b2303cd8a9580688f2385a635837 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Thu, 31 Dec 2020 14:39:53 +0100 Subject: [PATCH 15/21] doc: update package installation commands to resolve dependencies --- doc/INSTALL.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/INSTALL.md b/doc/INSTALL.md index 8d234e905c4..433e83da5d6 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -124,7 +124,7 @@ Then use: make package ``` -which will create a package for distributions where a Generator is implemented. +which will create packages for distributions where a Generator is implemented. You can find the generated packages in the `packages` directory of the build directory. @@ -145,12 +145,20 @@ To install the packages run this in the `packages` directory: dpkg -i * ``` +If any dependency problems appear, run following command to install the missing dependencies: + +```sh +apt-get -f install +``` + #### Fedora -To install the packages run this in the `packages` directory: +To install RPM packages we recommend using `yum localinstall` since installing with `rpm` doesn't resolve missing dependencies. + +Run following command in the `packages` directory: ```sh -rpm -U * +yum localinstall * ``` ### make From c36bd93c026b433de5e03af348eec98fe8716906 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Thu, 31 Dec 2020 15:23:48 +0100 Subject: [PATCH 16/21] packaging: rename packaging output directory --- doc/INSTALL.md | 6 +++--- scripts/cmake/ElektraPackaging.cmake | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/INSTALL.md b/doc/INSTALL.md index 433e83da5d6..c1c43d14249 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -126,7 +126,7 @@ make package which will create packages for distributions where a Generator is implemented. -You can find the generated packages in the `packages` directory of the build directory. +You can find the generated packages in the `package` directory of the build directory. > NOTE: If all plugins/bindings/tools a package includes are excluded, the package will be not generated. @@ -139,7 +139,7 @@ Simply `cd` into the build directory and run following command: LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH} make package ``` -To install the packages run this in the `packages` directory: +To install the packages run this in the `package` directory: ```sh dpkg -i * @@ -155,7 +155,7 @@ apt-get -f install To install RPM packages we recommend using `yum localinstall` since installing with `rpm` doesn't resolve missing dependencies. -Run following command in the `packages` directory: +Run following command in the `package` directory: ```sh yum localinstall * diff --git a/scripts/cmake/ElektraPackaging.cmake b/scripts/cmake/ElektraPackaging.cmake index 5c8c680f65a..dc862223f21 100644 --- a/scripts/cmake/ElektraPackaging.cmake +++ b/scripts/cmake/ElektraPackaging.cmake @@ -79,7 +79,7 @@ set (PACKAGE_BUGREPORT "https://bugs.libelektra.org/") set (PROJECT_VERSION "${KDB_VERSION}") set (CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") -set (CPACK_OUTPUT_FILE_PREFIX "packages") +set (CPACK_OUTPUT_FILE_PREFIX "package") set ( PACKAGES From 4737e050a00e9fe0e336fc7fe7ecb4034b170992 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Thu, 31 Dec 2020 16:39:57 +0100 Subject: [PATCH 17/21] doc: update ubuntu-bionic installation and remove debian-jessy --- doc/INSTALL.md | 51 ++++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/doc/INSTALL.md b/doc/INSTALL.md index c1c43d14249..5903e1f494d 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -23,21 +23,31 @@ For [OpenSUSE, CentOS, Fedora, RHEL and SLE](https://build.opensuse.org/package/ Kai-Uwe Behrmann kindly provides packages [for download](http://software.opensuse.org/download.html?project=home%3Abekun%3Adevel&package=libelektra4). ### Ubuntu-Bionic - -To use the Ubuntu-Bionic packages, the following steps need to be made: +--- +To use the Ubuntu Bionic repository of the latest builds from master following steps need to be made: 1. Run `sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D919CE8B27A64C16656FCA9FF1532673651F9C6C` to obtain the key. 2. Add `deb https://ubuntu-bionic-repo.libelektra.org/ bionic main` into `/etc/apt/sources.list` -3. `sudo apt-get update` + Which can also be done using: -### Debian + ```sh + apt-get install software-properties-common apt-transport-https + echo "deb https://ubuntu-bionic-repo.libelektra.org/ bionic main" | sudo tee /etc/apt/sources.list.d/elektra.list + ``` -To use the debian repository of the latest builds from master put following lines in -`/etc/apt/sources.list`: + Or alternatively, you can use (if you do not mind many dependences just to add one line to a config file): + + ```sh + sudo apt-get install software-properties-common apt-transport-https + sudo add-apt-repository "deb https://ubuntu-bionic-repo.libelektra.org/ bionic main" + ``` -For Stretch: +### Debian-Buster + +To use the Debian Buster repository of the latest builds from master put following lines in +`/etc/apt/sources.list`: ``` deb [trusted=yes] https://debian-buster-repo.libelektra.org/ buster main @@ -47,7 +57,7 @@ deb-src [trusted=yes] https://debian-buster-repo.libelektra.org/ buster main Which can also be done using: ```sh -sudo apt-get install apt-transport-https +sudo apt-get install software-properties-common apt-transport-https echo "deb [trusted=yes] https://debian-buster-repo.libelektra.org/ buster main" | sudo tee /etc/apt/sources.list.d/elektra.list ``` @@ -58,13 +68,16 @@ sudo apt-get install software-properties-common apt-transport-https sudo add-apt-repository "deb [trusted=yes] https://debian-buster-repo.libelektra.org/ buster main" ``` -For Jessie (not updated anymore, contains 0.8.24 packages which were created shortly before 0.8.25 release) +If you want to rebuild Elektra from Debian unstable or +our repositories, add a `deb-src` entry to `/etc/apt/sources.list` +and then run: -``` -deb [trusted=yes] https://debian-stable.libelektra.org/elektra-stable/ jessie main -deb-src [trusted=yes] https://debian-stable.libelektra.org/elektra-stable/ jessie main +```sh +apt-get source -b elektra ``` +### Install + To get all packaged plugins, bindings and tools install: ```sh @@ -77,18 +90,10 @@ For a small installation with command-line tools available use: apt-get install elektra-bin ``` -If you want to rebuild Elektra from Debian unstable or -our repositories, add a `deb-src` entry to `/etc/apt/sources.list` -and then run: - -```sh -apt-get source -b elektra -``` - -To build Debian Packages from the source you might want to use: +To build Debian/Ubuntu Packages from the source you might want to use: ```sh -make package +make package # See CPack below ``` ## macOS @@ -116,8 +121,6 @@ We recommend that you generate your own packages with CPack so ensure compatibil The current supported systems are: Debian, Ubuntu and Fedora. -First follow the steps in [COMPILE](COMPILE.md). - Then use: ```sh From 928eb37687e20e3dc007eaa4a84103bb0748315c Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 31 Dec 2020 15:43:43 +0000 Subject: [PATCH 18/21] Restyled by prettier-markdown --- doc/INSTALL.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/doc/INSTALL.md b/doc/INSTALL.md index 5903e1f494d..1211fd34f31 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -23,26 +23,28 @@ For [OpenSUSE, CentOS, Fedora, RHEL and SLE](https://build.opensuse.org/package/ Kai-Uwe Behrmann kindly provides packages [for download](http://software.opensuse.org/download.html?project=home%3Abekun%3Adevel&package=libelektra4). ### Ubuntu-Bionic + --- + To use the Ubuntu Bionic repository of the latest builds from master following steps need to be made: 1. Run `sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D919CE8B27A64C16656FCA9FF1532673651F9C6C` to obtain the key. 2. Add `deb https://ubuntu-bionic-repo.libelektra.org/ bionic main` into `/etc/apt/sources.list` - Which can also be done using: + Which can also be done using: - ```sh - apt-get install software-properties-common apt-transport-https - echo "deb https://ubuntu-bionic-repo.libelektra.org/ bionic main" | sudo tee /etc/apt/sources.list.d/elektra.list - ``` + ```sh + apt-get install software-properties-common apt-transport-https + echo "deb https://ubuntu-bionic-repo.libelektra.org/ bionic main" | sudo tee /etc/apt/sources.list.d/elektra.list + ``` - Or alternatively, you can use (if you do not mind many dependences just to add one line to a config file): + Or alternatively, you can use (if you do not mind many dependences just to add one line to a config file): - ```sh - sudo apt-get install software-properties-common apt-transport-https - sudo add-apt-repository "deb https://ubuntu-bionic-repo.libelektra.org/ bionic main" - ``` + ```sh + sudo apt-get install software-properties-common apt-transport-https + sudo add-apt-repository "deb https://ubuntu-bionic-repo.libelektra.org/ bionic main" + ``` ### Debian-Buster From 708e311ea59b1f07e6e30db34f2f5c40ea3310f5 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Mon, 11 Jan 2021 15:20:59 +0100 Subject: [PATCH 19/21] doc: resolve merge problems release notes --- doc/news/_preparation_next_release.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md index bbdc0da1bf5..58044e4c535 100644 --- a/doc/news/_preparation_next_release.md +++ b/doc/news/_preparation_next_release.md @@ -122,9 +122,6 @@ kdb upgrade pr3555 values > _Note:_ The original `system:/elektra/mountpoints` data will be moved to `system:/elektra/mountpoints-backup` -### Debian 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 specific dependencies with CPack, which is needed for some packages. _(Robert Sowula)_ ### 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)_ From b62a6583222fd827ccea5d50a6c2e1fe2df0cd86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihael=20Pranji=C4=87?= Date: Tue, 12 Jan 2021 09:07:49 +0100 Subject: [PATCH 20/21] Update doc/INSTALL.md --- doc/INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/INSTALL.md b/doc/INSTALL.md index 1211fd34f31..4fd2bc0b510 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -39,7 +39,7 @@ To use the Ubuntu Bionic repository of the latest builds from master following s echo "deb https://ubuntu-bionic-repo.libelektra.org/ bionic main" | sudo tee /etc/apt/sources.list.d/elektra.list ``` - Or alternatively, you can use (if you do not mind many dependences just to add one line to a config file): + Or alternatively, you can use (if you do not mind many dependencies just to add one line to a config file): ```sh sudo apt-get install software-properties-common apt-transport-https From c5e708afa1911ae293d62d7f2cfac5bef9462272 Mon Sep 17 00:00:00 2001 From: Robert Sowula Date: Tue, 12 Jan 2021 19:51:49 +0100 Subject: [PATCH 21/21] packaging: apply suggestions from review --- doc/INSTALL.md | 4 +- scripts/cmake/ElektraCache.cmake | 14 ---- scripts/cmake/ElektraPackaging.cmake | 80 ++------------------- scripts/cmake/Modules/PackagingDebian.cmake | 7 ++ scripts/cmake/Modules/PackagingFedora.cmake | 26 ++++--- scripts/cmake/Modules/PackagingMacros.cmake | 75 +++++++++++++++++++ scripts/packaging/package.sh | 2 +- 7 files changed, 106 insertions(+), 102 deletions(-) create mode 100644 scripts/cmake/Modules/PackagingMacros.cmake diff --git a/doc/INSTALL.md b/doc/INSTALL.md index 4fd2bc0b510..92524f90c10 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -117,7 +117,7 @@ Please refer to the section OS Independent below. First follow the steps in [COMPILE](COMPILE.md). After you completed building Elektra on your own, there are multiple options how to install it. For example, with make or CPack tools. -We recommend that you generate your own packages with CPack so ensure compatibility with future releases. +We recommend to use the packages from our build server or that you generate your own packages with CPack. ### CPack @@ -147,7 +147,7 @@ LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH} make package To install the packages run this in the `package` directory: ```sh -dpkg -i * +apt-get install ./* ``` If any dependency problems appear, run following command to install the missing dependencies: diff --git a/scripts/cmake/ElektraCache.cmake b/scripts/cmake/ElektraCache.cmake index fc0e3de1efc..4a1668d6b74 100644 --- a/scripts/cmake/ElektraCache.cmake +++ b/scripts/cmake/ElektraCache.cmake @@ -354,20 +354,6 @@ if (CMAKE_SKIP_BUILD_RPATH AND BUILD_TESTING) message (WARNING "You specified to remove RPATH, but did not disable tests. Please read doc/COMPILE.md#RPATH") endif () -# -# Packaging options -# - -set ( - CPACK_DEBIAN_PACKAGE_RELEASE - "1" - CACHE STRING "Revision number of the DEB package.") - -set ( - CPACK_RPM_PACKAGE_RELEASE - "1" - CACHE STRING "Revision number of the RPM package.") - # # Misc. # diff --git a/scripts/cmake/ElektraPackaging.cmake b/scripts/cmake/ElektraPackaging.cmake index dc862223f21..d935e0debb8 100644 --- a/scripts/cmake/ElektraPackaging.cmake +++ b/scripts/cmake/ElektraPackaging.cmake @@ -1,84 +1,14 @@ -# ~~~ -# check_component_dependencies -# -# check and excludes a component from packaging if -# the plugin/binding/tool the component depends on -# is missing -# -# dependency_name name of the dependency the component depends on -# component_name name of the component -# PLUGIN whether the dependency is a plugin -# BINDING whether the dependency is a binding -# TOOL whether the dependency is a tool -# ADDITIONAL_DEPENDENCIES additional dependencies if the component -# has multiple dependencies -# ~~~ -macro (check_component_dependencies dependency_name component_name) - cmake_parse_arguments ( - ARG - "PLUGIN;BINDING;TOOL" # optional keywords - "" # one value keywords - "ADDITIONAL_DEPENDENCIES" # multi value keywords - ${ARGN}) - - set (TMP_DEPENDENCY_NAMES ${dependency_name}) - if (ARG_ADDITIONAL_DEPENDENCIES) - list (APPEND TMP_DEPENDENCY_NAMES "${ARG_ADDITIONAL_DEPENDENCIES}") - endif () - - set (TMP_UNFULFILLED_DEPENDENCIES "") - - foreach (name ${TMP_DEPENDENCY_NAMES}) - - if (ARG_PLUGIN) - if (NOT ${name} IN_LIST ADDED_PLUGINS) - set (TMP_DEPENDENCY_TYPE "plugin") - list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name}) - endif () - endif () - if (ARG_BINDING) - if (NOT ${name} IN_LIST ADDED_BINDINGS) - set (TMP_DEPENDENCY_TYPE "binding") - list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name}) - endif () - endif () - if (ARG_TOOL) - if (NOT ${name} IN_LIST TOOLS) - set (TMP_DEPENDENCY_TYPE "tool") - list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name}) - endif () - endif () - - endforeach () - - list (LENGTH TMP_UNFULFILLED_DEPENDENCIES UNFULFILLED_DEPENDENCIES_AMOUNT) - list (LENGTH TMP_DEPENDENCY_NAMES EXPECTED_DEPENDENCIES_AMOUNT) - if (${UNFULFILLED_DEPENDENCIES_AMOUNT} GREATER 1) - set (TMP_DEPENDENCY_TYPE "${TMP_DEPENDENCY_TYPE}s") - endif () - string (REPLACE ";" ", " TMP_UNFULFILLED_DEPENDENCIES_STR "${TMP_UNFULFILLED_DEPENDENCIES}") - if (TMP_UNFULFILLED_DEPENDENCIES AND ${UNFULFILLED_DEPENDENCIES_AMOUNT} EQUAL ${EXPECTED_DEPENDENCIES_AMOUNT}) - # all dependencies of component are missing - message ( - STATUS - "Exclude component ${component_name} because ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE} excluded." - ) - list (APPEND EXCLUDED_COMPONENTS ${component_name}) - elseif (TMP_UNFULFILLED_DEPENDENCIES AND ${UNFULFILLED_DEPENDENCIES_AMOUNT} LESS ${EXPECTED_DEPENDENCIES_AMOUNT}) - # at least one but not all dependencies of a component are missing - message ( - STATUS - "Component ${component_name} is missing ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE}. This package will still be generated." - ) - endif () - -endmacro (check_component_dependencies) +include (PackagingMacros) 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}") +if (NOT CPACK_PACKAGE_RELEASE) + set (CPACK_PACKAGE_RELEASE "1") +endif () + set (CPACK_OUTPUT_FILE_PREFIX "package") set ( diff --git a/scripts/cmake/Modules/PackagingDebian.cmake b/scripts/cmake/Modules/PackagingDebian.cmake index 0e2a952e6b3..d5503df6ef0 100644 --- a/scripts/cmake/Modules/PackagingDebian.cmake +++ b/scripts/cmake/Modules/PackagingDebian.cmake @@ -1,4 +1,11 @@ +# ~~~ +# In this file CPACK_DEBIAN_* vars necessary by CPack DEB +# to generate DEB packages are set. Also DEB package specifc +# files are installed. +# ~~~ + set (CPACK_DEBIAN_PACKAGE_VERSION "${PROJECT_VERSION}") +set (CPACK_DEBIAN_PACKAGE_RELEASE "${CPACK_PACKAGE_RELEASE}") set (DEBIAN_VERSION_RELEASE "${CPACK_DEBIAN_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}") set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Robert Sowula ") diff --git a/scripts/cmake/Modules/PackagingFedora.cmake b/scripts/cmake/Modules/PackagingFedora.cmake index 3051c2a433c..cdf2aed789f 100644 --- a/scripts/cmake/Modules/PackagingFedora.cmake +++ b/scripts/cmake/Modules/PackagingFedora.cmake @@ -1,4 +1,11 @@ +# ~~~ +# In this file CPACK_RPM_* vars necessary by CPack RPM +# to generate RPM packages are set. Also RPM package specifc +# files are installed. +# ~~~ + set (CPACK_RPM_PACKAGE_VERSION "${PROJECT_VERSION}") +set (CPACK_RPM_PACKAGE_RELEASE "${CPACK_PACKAGE_RELEASE}") set (RPM_VERSION_RELEASE "${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}") set (CPACK_GENERATOR "RPM") @@ -15,6 +22,15 @@ set (CPACK_RPM_CHANGELOG_FILE "${CMAKE_SOURCE_DIR}/scripts/packaging/fedora/chan 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") +# install license files +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 () set ( CPACK_RPM_BUILDREQUIRES @@ -187,13 +203,3 @@ set (CPACK_RPM_ELEKTRA-DOC_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-DOC_DISPLAY_N 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/cmake/Modules/PackagingMacros.cmake b/scripts/cmake/Modules/PackagingMacros.cmake new file mode 100644 index 00000000000..b13a3e9be55 --- /dev/null +++ b/scripts/cmake/Modules/PackagingMacros.cmake @@ -0,0 +1,75 @@ +# ~~~ +# check_component_dependencies +# +# check and excludes a component from packaging if +# the plugin/binding/tool the component depends on +# is missing +# +# dependency_name name of the dependency the component depends on +# component_name name of the component +# PLUGIN whether the dependency is a plugin +# BINDING whether the dependency is a binding +# TOOL whether the dependency is a tool +# ADDITIONAL_DEPENDENCIES additional dependencies if the component +# has multiple dependencies +# ~~~ +macro (check_component_dependencies dependency_name component_name) + cmake_parse_arguments ( + ARG + "PLUGIN;BINDING;TOOL" # optional keywords + "" # one value keywords + "ADDITIONAL_DEPENDENCIES" # multi value keywords + ${ARGN}) + + set (TMP_DEPENDENCY_NAMES ${dependency_name}) + if (ARG_ADDITIONAL_DEPENDENCIES) + list (APPEND TMP_DEPENDENCY_NAMES "${ARG_ADDITIONAL_DEPENDENCIES}") + endif () + + set (TMP_UNFULFILLED_DEPENDENCIES "") + + foreach (name ${TMP_DEPENDENCY_NAMES}) + + if (ARG_PLUGIN) + if (NOT ${name} IN_LIST ADDED_PLUGINS) + set (TMP_DEPENDENCY_TYPE "plugin") + list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name}) + endif () + endif () + if (ARG_BINDING) + if (NOT ${name} IN_LIST ADDED_BINDINGS) + set (TMP_DEPENDENCY_TYPE "binding") + list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name}) + endif () + endif () + if (ARG_TOOL) + if (NOT ${name} IN_LIST TOOLS) + set (TMP_DEPENDENCY_TYPE "tool") + list (APPEND TMP_UNFULFILLED_DEPENDENCIES ${name}) + endif () + endif () + + endforeach () + + list (LENGTH TMP_UNFULFILLED_DEPENDENCIES UNFULFILLED_DEPENDENCIES_AMOUNT) + list (LENGTH TMP_DEPENDENCY_NAMES EXPECTED_DEPENDENCIES_AMOUNT) + if (${UNFULFILLED_DEPENDENCIES_AMOUNT} GREATER 1) + set (TMP_DEPENDENCY_TYPE "${TMP_DEPENDENCY_TYPE}s") + endif () + string (REPLACE ";" ", " TMP_UNFULFILLED_DEPENDENCIES_STR "${TMP_UNFULFILLED_DEPENDENCIES}") + if (TMP_UNFULFILLED_DEPENDENCIES AND ${UNFULFILLED_DEPENDENCIES_AMOUNT} EQUAL ${EXPECTED_DEPENDENCIES_AMOUNT}) + # all dependencies of component are missing + message ( + STATUS + "Exclude component ${component_name} because ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE} excluded." + ) + list (APPEND EXCLUDED_COMPONENTS ${component_name}) + elseif (TMP_UNFULFILLED_DEPENDENCIES AND ${UNFULFILLED_DEPENDENCIES_AMOUNT} LESS ${EXPECTED_DEPENDENCIES_AMOUNT}) + # at least one but not all dependencies of a component are missing + message ( + STATUS + "Component ${component_name} is missing ${TMP_UNFULFILLED_DEPENDENCIES_STR} ${TMP_DEPENDENCY_TYPE}. This package will still be generated." + ) + endif () + +endmacro (check_component_dependencies) diff --git a/scripts/packaging/package.sh b/scripts/packaging/package.sh index 10db5d35fdf..38b53aa556b 100644 --- a/scripts/packaging/package.sh +++ b/scripts/packaging/package.sh @@ -21,7 +21,7 @@ if [ $OS_NAME = "Fedora" ]; then -DKDB_DB_HOME:PATH=/home \ -DKDB_DB_USER:PATH=.config \ -DINSTALL_DOCUMENTATION=ON \ - -DSWIG_EXECUTABLE=/usr/bin/swig \ + -DSWIG_EXECUTABLE=/usr/bin/swig \ -DPYTHON_EXECUTABLE:PATH=/usr/bin/python3 \ -DENABLE_TESTING=ON \ -DINSTALL_TESTING=ON \