From 751bcb9aec11a421e4496428d544574dc8836834 Mon Sep 17 00:00:00 2001 From: Acheev Bhagat Date: Tue, 20 Sep 2022 04:10:19 -0400 Subject: [PATCH] feat(packaging): create deb packaging #249 (#313) --- CMakeLists.txt | 2 ++ cmake/Packing.cmake | 39 +++++++++++++++++++++++++++++++++++++++ src/CMakeLists.txt | 1 - 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 cmake/Packing.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 64f168e21..ff8a169d4 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,3 +24,5 @@ include_directories(helio) add_subdirectory(helio) add_subdirectory(src) + +include(cmake/Packing.cmake) diff --git a/cmake/Packing.cmake b/cmake/Packing.cmake new file mode 100644 index 000000000..7aefe9ba0 --- /dev/null +++ b/cmake/Packing.cmake @@ -0,0 +1,39 @@ +# Packages the dragonfly binary into a .deb package +# Use this to generate .deb package from build directory +# cpack -G DEB +# +# Resulting packages can be found under _packages/ + +set(CPACK_PACKAGE_NAME "dragonflydb" + CACHE STRING "dragonflydb" +) + +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A modern replacement for Redis and Memcached" + CACHE STRING "A modern replacement for Redis and Memcached" +) + +set(CPACK_PACKAGE_VENDOR "DragonflyDB") + +set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_SOURCE_DIR}/_packages") + +set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/share/dragonfly") + +set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) + +set(CPACK_PACKAGE_CONTACT "support@dragonflydb.io") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "DragonflyDB maintainers") + +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md") +set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") + +set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE) + +set(CPACK_DEB_COMPONENT_INSTALL YES) + +install(TARGETS dragonfly DESTINATION . COMPONENT dragonfly) + +set(CPACK_COMPONENTS_ALL dragonfly) + +include(CPack) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 771a316ab..b7df123cc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,7 +19,6 @@ add_third_party( jsoncons URL https://github.com/danielaparker/jsoncons/archive/refs/tags/v0.168.7.tar.gz CMAKE_PASS_FLAGS "-DJSONCONS_BUILD_TESTS=OFF" - LIB "none" )