-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a cpack configuration for library packaging #426
Open
baptistepetit
wants to merge
1
commit into
CopernicaMarketingSoftware:master
Choose a base branch
from
baptistepetit:feature/361
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,3 +133,49 @@ if(AMQP-CPP_LINUX_TCP) | |
find_package(OpenSSL REQUIRED) | ||
target_include_directories(${PROJECT_NAME} PRIVATE ${OPENSSL_INCLUDE_DIR}) | ||
endif() | ||
|
||
# software packaging | ||
# ------------------------------------------------------------------------------------------------------ | ||
|
||
# if unix use deb and rpm generators, else default to .tar.gz | ||
if (UNIX) | ||
set(CPACK_GENERATOR DEB RPM) | ||
endif (UNIX) | ||
|
||
# general cpack settings | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "C++ library for communicating with a RabbitMQ message broker") | ||
set(CPACK_PACKAGE_VENDOR "Coppernica Marketing Software") | ||
set(CPACK_PACKAGE_CONTACT "Copernica <[email protected]>") | ||
set(CPACK_PACKAGE_DESCRIPTION | ||
"AMQP-CPP is a C++ library for communicating with a RabbitMQ message broker. The | ||
library can be used to parse incoming data from a RabbitMQ server, and to | ||
generate frames that can be sent to a RabbitMQ server." | ||
) | ||
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/CopernicaMarketingSoftware/AMQP-CPP") | ||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") | ||
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) | ||
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) | ||
set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) | ||
set(CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS | ||
OWNER_READ | ||
OWNER_WRITE | ||
OWNER_EXECUTE | ||
GROUP_READ | ||
GROUP_EXECUTE | ||
WORLD_READ | ||
WORLD_EXECUTE | ||
) | ||
set(CPACK_STRIP_FILES ON) | ||
|
||
# deb generator related | ||
set(CPACK_DEBIAN_PACKAGE_NAME "amqpcpp-dev") | ||
set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE) | ||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/debian/triggers") | ||
|
||
# rpm generator related | ||
set(CPACK_RPM_PACKAGE_NAME "amqpcpp-devel") | ||
set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION}) | ||
set(CPACK_RPM_PACKAGE_LICENSE "ASL 2.0") | ||
|
||
# create package target | ||
include(CPack) |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
activate-noawait ldconfig |
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.
Not sure if this is wise. Why not leave it at the default?
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 am actually restricting the rights compared with the automatically generated folders by the install commands in this CMakeLists.txt.
As the generated folders were having too lax permissions lintian was complaining.
I believe it is the same issues that happened here: https://gitlab.kitware.com/cmake/cmake/-/issues/17333
But you are right, the more accurate approach would be to set the folder rights at the file install time.
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.
Update:
After a little research it seems CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS and CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS are the only way to set permissions for directories implicitly created at install time.
Next Acions
I can change the way to set it to CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS though to be completely identical between install and package target.