File tree Expand file tree Collapse file tree 3 files changed +65
-0
lines changed
Expand file tree Collapse file tree 3 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -302,3 +302,24 @@ else()
302302 COMMAND ${CMAKE_COMMAND} -E echo "uncrustify not found; install it"
303303 )
304304endif ()
305+
306+ # Debian package configuration
307+ set (CPACK_GENERATOR "DEB" )
308+ set (CPACK_PACKAGE_NAME "libserial" )
309+ set (CPACK_PACKAGE_VERSION "${PROJECT_VERSION} " )
310+ set (CPACK_PACKAGE_CONTACT
"Nestor Pereira Neto <[email protected] >" )
311+ set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Modern C++ serial port communication library" )
312+ set (CPACK_PACKAGE_DESCRIPTION "A modern C++ library for serial port communication on Linux systems using termios2 for arbitrary baud rates." )
313+ set (CPACK_DEBIAN_PACKAGE_MAINTAINER
"Nestor Pereira Neto <[email protected] >" )
314+ set (CPACK_DEBIAN_PACKAGE_SECTION "libs" )
315+ set (CPACK_DEBIAN_PACKAGE_PRIORITY "optional" )
316+ set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/NestorDP/cppserial" )
317+
318+ # Debian dependencies
319+ set (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.27)" )
320+
321+ # Generate package files
322+ set (CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR} /debian/postinst;${CMAKE_CURRENT_SOURCE_DIR} /debian/postrm" )
323+
324+ # Include CPack
325+ include (CPack)
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # postinst script for libserial
3+ # This script runs after the package is installed
4+
5+ set -e
6+
7+ case " $1 " in
8+ configure)
9+ # Update the shared library cache
10+ ldconfig
11+ ;;
12+
13+ abort-upgrade|abort-remove|abort-deconfigure)
14+ ;;
15+
16+ * )
17+ echo " postinst called with unknown argument \` $1 '" >&2
18+ exit 1
19+ ;;
20+ esac
21+
22+ exit 0
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # postrm script for libserial
3+ # This script runs after the package is removed
4+
5+ set -e
6+
7+ case " $1 " in
8+ remove|purge)
9+ # Update the shared library cache
10+ ldconfig
11+ ;;
12+
13+ upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
14+ ;;
15+
16+ * )
17+ echo " postrm called with unknown argument \` $1 '" >&2
18+ exit 1
19+ ;;
20+ esac
21+
22+ exit 0
You can’t perform that action at this time.
0 commit comments