Skip to content

Commit 44c274f

Browse files
committed
cmake: follow Debian soname convention for DEB package names
The runtime DEB package was named 'libkqueue' but Debian convention requires the soversion suffix (e.g. 'libkqueue0'). This caused dependency resolution failures when installing packages that depend on 'libkqueue0'. Extract the soversion into a KQUEUE_SOVERSION variable and use it to construct CPACK_DEBIAN_MAIN_PACKAGE_NAME. Also fix the -dev package dependency to reference the correct runtime package name.
1 parent cf6e9ce commit 44c274f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ if(ENABLE_SHARED)
266266
add_library(kqueue SHARED $<TARGET_OBJECTS:objlib>)
267267
# We should have absolute ABI compatibility between versions as none
268268
# of the public function signatures of variables will change.
269-
set_target_properties(kqueue PROPERTIES SOVERSION 0)
269+
set(KQUEUE_SOVERSION 0)
270+
set_target_properties(kqueue PROPERTIES SOVERSION ${KQUEUE_SOVERSION})
270271
endif()
271272
if(ENABLE_STATIC)
272273
add_library(kqueue_static STATIC $<TARGET_OBJECTS:objlib>)
@@ -420,7 +421,9 @@ endif()
420421
#
421422
# DEB Specific configuration
422423
#
423-
set(CPACK_DEBIAN_MAIN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
424+
# Use soversion suffix for the runtime package name (e.g. libkqueue0)
425+
# to follow the Debian shared library packaging convention.
426+
set(CPACK_DEBIAN_MAIN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}${KQUEUE_SOVERSION}")
424427
set(CPACK_DEBIAN_MAIN_PACKAGE_SECTION "libs")
425428

426429
set(CPACK_DEBIAN_DEVEL_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-dev")
@@ -437,10 +440,10 @@ set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
437440
# library package is in sync with the headers.
438441
#
439442
if (PROJECT_VERSION_RELEASE)
440-
set(CPACK_DEBIAN_DEVEL_PACKAGE_DEPENDS "${CPACK_PACKAGE_NAME} (= ${PROJECT_VERSION}-${PROJECT_VERSION_RELEASE})")
443+
set(CPACK_DEBIAN_DEVEL_PACKAGE_DEPENDS "${CPACK_DEBIAN_MAIN_PACKAGE_NAME} (= ${PROJECT_VERSION}-${PROJECT_VERSION_RELEASE})")
441444
set(CPACK_DEBIAN_PACKAGE_RELEASE ${PROJECT_VERSION_RELEASE})
442445
else()
443-
set(CPACK_DEBIAN_DEVEL_PACKAGE_DEPENDS "${CPACK_PACKAGE_NAME} (= ${PROJECT_VERSION})")
446+
set(CPACK_DEBIAN_DEVEL_PACKAGE_DEPENDS "${CPACK_DEBIAN_MAIN_PACKAGE_NAME} (= ${PROJECT_VERSION})")
444447
endif()
445448

446449
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}")

0 commit comments

Comments
 (0)