This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
CPack debian packaging #3583
Merged
mpranj
merged 32 commits into
ElektraInitiative:master
from
robaerd:cpack-debian-packaging
Dec 17, 2020
Merged
CPack debian packaging #3583
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
e949962
cpack: generate modular debian packages
robaerd 1e88436
cpack: add debian package descriptions
robaerd 74186bf
cpack: add missing debian package properties
robaerd ff1ad5f
package: add hardening flags, fix install location
robaerd b09f918
cpack: fix libraries in wrong packages
robaerd c3159cc
cpack: add debian control files
robaerd ac17b16
cpack: remove rpath
robaerd c9fcabb
cmake: remove debug messages
robaerd e210171
style: reformat with cmake-format 0.6.3
robaerd 66cd977
package: move script to packaging folder
robaerd 9b56875
doc: add release notes
robaerd 9293bc7
cmake: add symlink kdb.1 to kdb-static.1
robaerd d7817d4
packaging: add copyright file for debian
robaerd 5d0d079
cpack: install debian copyright file on debian based distros
robaerd 22cf55f
cpack: add elektra-dbg package
robaerd ab4a1b1
doc: convert THIRD_PARTY_LICENSES into dep5 format
robaerd 37aad1e
cpack: add maintainer and missing package dependency
robaerd 06877ff
style: reformat
robaerd 2121a44
cmake: add docu for component parameter
robaerd e324b22
cmake: fix incompatibility with cmake 3.5
robaerd 7223844
cmake: fix error on optional macro parameter
robaerd 7f02c6b
style: reformat
robaerd ab6d936
packaging: apply suggestions from review
robaerd 6681054
doc: change copyright field to reference authors file
robaerd 97da809
packaging: add debian changelog
robaerd 546d7a0
packaging: change folder structure
robaerd 882feb3
news: add cpack as highlight to release notes
robaerd 9446af2
doc: add myself to authors.md
robaerd b72b85a
packaging: add default component elektra-misc
robaerd 959ac98
style: reformat
robaerd 71bc1ce
news: fix release notes format
robaerd e9f83c4
packaging: apply suggestions from review
robaerd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
set (PACKAGE_NAME "elektra") | ||
set (CPACK_PACKAGE_NAME "${PACKAGE_NAME}") | ||
set (PACKAGE_URL "https://www.libelektra.org/") | ||
set (PACKAGE_BUGREPORT "https://bugs.libelektra.org/") | ||
|
||
|
@@ -14,7 +13,7 @@ set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Robert Sowula <[email protected]>") | |
set (CPACK_OUTPUT_FILE_PREFIX "packages") | ||
|
||
set ( | ||
CPACK_COMPONENTS_ALL | ||
DEBIAN_PACKAGES | ||
libelektra4 | ||
libelektra4-all | ||
libelektra4-full | ||
|
@@ -25,13 +24,16 @@ set ( | |
libelektra4-curl | ||
libelektra4-dbus | ||
libelektra-dev | ||
libelektra4-java | ||
libelektra4-journald | ||
libelektra4-lua | ||
libelektra4-python | ||
libelektra4-xerces | ||
libelektra4-xmltool | ||
libelektra4-yajl | ||
libelektra4-yamlcpp | ||
libelektra4-zeromq | ||
java-elektra | ||
lua-elektra | ||
python3-elektra | ||
elektra-bin | ||
|
@@ -40,21 +42,30 @@ set ( | |
elektra-qt-gui | ||
elektra-tests | ||
elektra-dbg | ||
elektra-misc) | ||
${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}) | ||
|
||
set (COMPONENTS_WITHOUT_DBGSYM elektra-doc elektra-dbg libelektra-dev libelektra4-all elektra-bin-extra) | ||
set ( | ||
COMPONENTS_WITHOUT_DBGSYM | ||
elektra-doc | ||
elektra-dbg | ||
libelektra-dev | ||
libelektra4-all | ||
libelektra4-yamlcpp | ||
elektra-bin-extra | ||
java-elektra | ||
${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}) | ||
|
||
set (ALL_PLUGINS "") | ||
foreach (component ${CPACK_COMPONENTS_ALL}) | ||
foreach (component ${DEBIAN_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 ${CPACK_COMPONENTS_ALL}) | ||
if (NOT component IN_LIST COMPONENTS_WITHOUT_DBGSYM AND NOT component STREQUAL "elektra-misc") | ||
foreach (component ${DEBIAN_PACKAGES}) | ||
if (NOT component IN_LIST COMPONENTS_WITHOUT_DBGSYM) | ||
list (APPEND DBG_PACKAGE_NAMES "${component}-dbgsym") | ||
endif () | ||
endforeach () | ||
|
@@ -108,6 +119,7 @@ if (UNIX) | |
if (NOT LSB_DISTRIB) | ||
set (LSB_DISTRIB "unix") | ||
endif (NOT LSB_DISTRIB) | ||
message (STATUS "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME: ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}") | ||
|
||
# For Debian-based distros we want to create DEB packages. | ||
if ("${LSB_DISTRIB}" MATCHES "Ubuntu|Debian") | ||
|
@@ -268,13 +280,34 @@ if (UNIX) | |
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.") | ||
|
@@ -369,11 +402,13 @@ if (UNIX) | |
"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" | ||
|
@@ -400,11 +435,10 @@ if (UNIX) | |
"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") | ||
set (CPACK_DEBIAN_ELEKTRA-MISC_DEBUGINFO_PACKAGE "ON") | ||
|
||
# install copyright file | ||
configure_file ("${CMAKE_SOURCE_DIR}/doc/THIRD-PARTY-LICENSES" "${CMAKE_BINARY_DIR}/doc/copyright" COPYONLY) | ||
foreach (component ${CPACK_COMPONENTS_ALL}) | ||
foreach (component ${DEBIAN_PACKAGES}) | ||
install ( | ||
FILES "${CMAKE_BINARY_DIR}/doc/copyright" | ||
COMPONENT ${component} | ||
|
@@ -420,7 +454,7 @@ if (UNIX) | |
|
||
add_custom_target (changelog ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/changelog.Debian.gz") | ||
|
||
foreach (component ${CPACK_COMPONENTS_ALL}) | ||
foreach (component ${DEBIAN_PACKAGES}) | ||
install ( | ||
FILES "${CMAKE_CURRENT_BINARY_DIR}/changelog.Debian.gz" | ||
COMPONENT ${component} | ||
|
@@ -473,3 +507,10 @@ set ( | |
"%ignore /usr/share/man") | ||
|
||
include (CPack) | ||
|
||
foreach (component ${CPACK_COMPONENTS_ALL}) | ||
if (NOT component IN_LIST DEBIAN_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.") | ||
endif () | ||
endforeach () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really need to be in the cache? If yes, put it to scripts/cmake/ElektraCache.cmake and use mark_as_advanced as it is not something a normal user wants to change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently a previous configuration issue led me to cache this variable. This is definetly not needed and a mistake from my side. I will fix this in the upcoming PR, since this one is already merged, if this is fine for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, of course it can be fixed with the next PR. But it would be good if it will be fixed before the release as cmake cache variables are user-facing (to maintainers) and should be documented and so on. So better to never introduce this cache variable to any release. Anyway: would be great to have RPM+DEB for next release. Is it your plan to do so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was currently working on extending the release automation (ABI tests, external test suites etc) but I can of course also create RPM packages for this release. With our current CPack setup this probably shouldn't be that much work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3519