Skip to content

Conversation

@gufarui
Copy link

@gufarui gufarui commented Dec 7, 2025

Gitlab Username: gufg

Summary

  • Add full install rules so cpackexample, libcpackexamplelib, and headers land in ${CMAKE_INSTALL_PREFIX}/bin|lib|include/cpackexamplelib, and install README, MIT license (as copyright), a compressed Debian changelog, and a compressed man page.
  • Introduce cmake/CPackConfig.cmake with maintainer/contact/vendor/description/homepage metadata, enable only TGZ and DEB generators, make the package stripped, and let CPACK_DEBIAN_PACKAGE_SHLIBDEPS derive dependencies.
  • Provide Debian-specific docs (debian/changelog.Debian(.gz) and docs/cpackexample.1(.gz)) that satisfy lintian’s changelog/man checks so the .deb passes lintian (except the usual root warning).

Testing

  1. docker run --rm --mount type=bind,source="$(pwd)",target=/mnt/cpack-exercise cpackexercise /bin/bash -lc "set -euo pipefail && cd /mnt/cpack-exercise && rm -rf build && cmake -S . -B build && cmake --build build && cmake --build build --target package"
  2. tar -tzf build/cpackexample-0.1.0-Linux.tar.gz
  3. dpkg-deb -c build/cpackexample_0.1.0-1_arm64.deb
  4. docker run --rm --mount type=bind,source="$(pwd)",target=/mnt/cpack-exercise cpackexercise /bin/bash -lc "cd /mnt/cpack-exercise/build && apt-get -qq update && apt-get -y install ./cpackexample_0.1.0-1_arm64.deb && which cpackexample && cpackexample > /tmp/cpackexample.log && head -n 10 /tmp/cpackexample.log"
  5. docker run --rm --mount type=bind,source="$(pwd)",target=/mnt/cpack-exercise cpackexercise /bin/bash -lc "cd /mnt/cpack-exercise/build && lintian ./cpackexample_0.1.0-1_arm64.deb"

lintian output:

running with root privileges is not recommended!

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

Successfully merging this pull request may close these issues.

1 participant