Skip to content

Commit 8ab3029

Browse files
committed
cmake: Handle conflict between generated .deb and Debian package
Update the generated .deb's metadata to enforce that it cannot be installed alongside the version of libiio shipped in the Debian repositories. Fixes #923. Signed-off-by: Paul Cercueil <[email protected]>
1 parent 508e4bd commit 8ab3029

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmake/LinuxPackaging.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,14 @@ if(${CMAKE_MAJOR_VERSION} LESS 3)
137137
OUTPUT_STRIP_TRAILING_WHITESPACE)
138138
ENDIF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
139139
endif()
140+
141+
# Make sure the generated .deb cannot be installed alongside the Debian ones
142+
set(CPACK_DEBIAN_PACKAGE_PROVIDES
143+
"libiio0 (= ${LIBIIO_VERSION}), "
144+
"libiio-dev (= ${LIBIIO_VERSION}), "
145+
"libiio-utils (= ${LIBIIO_VERSION}), "
146+
"iiod (= ${LIBIIO_VERSION})")
147+
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "libiio0, libiio-dev, libiio-utils, iiod")
148+
set(CPACK_DEBIAN_PACKAGE_REPLACES "libiio0, libiio-dev, libiio-utils, iiod")
149+
140150
include(CPack)

0 commit comments

Comments
 (0)