Skip to content
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

submit a Debian package for 2.6.1+ #135

Open
mheily opened this issue Apr 29, 2022 · 6 comments
Open

submit a Debian package for 2.6.1+ #135

mheily opened this issue Apr 29, 2022 · 6 comments
Assignees

Comments

@mheily
Copy link
Owner

mheily commented Apr 29, 2022

The official Debian package is several years old now, and it would be good to push a new version downstream.

I plan to make a few other improvements to support this:

  1. Update the README to describe the process for generating a new Debian package
  2. Tweak the CMakeFile to allow building a source archive that meets Debian naming requirements
  3. Consider how to make the build process more accessible, potentially moving the packaging files to a branch in the libkqueue repository.
@mheily mheily self-assigned this Apr 29, 2022
mheily added a commit that referenced this issue Apr 29, 2022
This directory contained experimental Debian packaging files
that were not used to create the actual Debian package, and
were not as good as using CPack's native DEB support.

Related to #135
mheily added a commit that referenced this issue Apr 29, 2022
@mheily
Copy link
Owner Author

mheily commented Apr 29, 2022

There's a Debian patch to CMakelists.txt that does not apply cleanly to the new version. Perhaps we should incorporate this upstream, and drop the patch?

$ cat patches/cmake-debian-updates 
Description: Update CMake config for debian package
 A few updates to the CMakeLists.txt file to be more relevant for the
 Debian package.
Author: Matthew Newton <[email protected]>
Last-Update: 2019-01-15

Index: libkqueue-2.3.1/CMakeLists.txt
===================================================================
--- libkqueue-2.3.1.orig/CMakeLists.txt
+++ libkqueue-2.3.1/CMakeLists.txt
@@ -120,22 +120,28 @@ else()
 endif()
 
 add_library(kqueue ${LIBRARY_TYPE} ${LIBKQUEUE_SOURCES} ${LIBKQUEUE_HEADERS})
-set_target_properties(kqueue PROPERTIES DEBUG_POSTFIX "d")
+set_target_properties(kqueue PROPERTIES DEBUG_POSTFIX "d" SOVERSION 0)
+
+add_library(kqueue_static STATIC ${LIBKQUEUE_SOURCES} ${LIBKQUEUE_HEADERS})
+set_target_properties(kqueue_static PROPERTIES DEBUG_POSTFIX "d" OUTPUT_NAME kqueue)
 
 if(WIN32)
   target_compile_definitions(kqueue PRIVATE _USRDLL;_WINDLL)
   target_compile_definitions(kqueue PRIVATE _CRT_SECURE_NO_WARNINGS)
 else()
   target_compile_definitions(kqueue PRIVATE _XOPEN_SOURCE=600)
+  target_compile_definitions(kqueue_static PRIVATE _XOPEN_SOURCE=600)
 endif()
 
 target_include_directories(kqueue PRIVATE include)
 if(NOT WIN32)
   target_include_directories(kqueue PRIVATE src/common)
+  target_include_directories(kqueue_static PRIVATE src/common include)
 endif()
 
 if(CMAKE_C_COMPILER_ID MATCHES GNU)
   target_compile_options(kqueue PRIVATE -Wall -Werror)
+  target_compile_options(kqueue_static PRIVATE -Wall -Werror)
 endif()
 if(MINGW AND CMAKE_C_COMPILER_ID MATCHES GNU)
   target_compile_options(kqueue PRIVATE -march=i486)
@@ -145,6 +151,7 @@ if(WIN32)
   target_link_libraries(kqueue PRIVATE Ws2_32)
 endif()
 target_link_libraries(kqueue PRIVATE Threads::Threads)
+target_link_libraries(kqueue_static PRIVATE Threads::Threads)
 
 if(ENABLE_TESTING)
   add_subdirectory(test)
@@ -164,10 +171,10 @@ set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST
 install(FILES
           "include/sys/event.h"
         DESTINATION
-          "${CMAKE_INSTALL_FULL_INCLUDEDIR}/sys"
+          "${CMAKE_INSTALL_FULL_INCLUDEDIR}/kqueue/sys"
         COMPONENT headers)
 install(TARGETS
-          kqueue
+          kqueue kqueue_static
         DESTINATION
           "${CMAKE_INSTALL_FULL_LIBDIR}"
         COMPONENT libraries)

@arr2036
Copy link
Collaborator

arr2036 commented Apr 29, 2022

We now already set SOVERSION, so that's fine.

@arr2036
Copy link
Collaborator

arr2036 commented Apr 29, 2022

https://stackoverflow.com/questions/2152077/is-it-possible-to-get-cmake-to-build-both-a-static-and-shared-library-at-the-sam

The second answer here describes a way of building shared or static or both without duplicating library properties.

@arr2036
Copy link
Collaborator

arr2036 commented Apr 29, 2022

If we can get away with just using cpack I think that'd be ideal instead of needing to maintain separate packaging infrastructure.

@mheily
Copy link
Owner Author

mheily commented Jun 24, 2022

Debian doesn't support the use of CPack to build their official packages. I've updated my packaging scripts in this repository to handle the new version: https://github.com/mheily/debian-packages

I've uploaded the package to mentors.debian.net and need to find someone with permission to upload the package to the archive.

@shahn
Copy link

shahn commented Jun 3, 2024

Has there been any update so far, or would it be possible to support this packaging effort?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants