Skip to content

Conversation

@Noxaster
Copy link

Gitlab Username

shayo

Description

This PR implements the CMake installation targets and CPack configuration to generate .tar.gz and .deb packages.

Changelog

  • Modified CMakeLists.txt to install executable, library, and headers to standard locations (bin, lib, include).
  • Created cmake/CPackConfig.cmake.
  • Configured Generators: TGZ and DEB.
  • Added package description and other metadata.
  • Enabled CPACK_DEBIAN_PACKAGE_SHLIBDEPS.
  • (Optional) Modified Dockerfile to install libyaml-cpp-dev from system repositories instead of building from source. This ensures libyaml-cpp is correctly identified as a system dependency in the generated .deb package.
  • Enabled CPACK_STRIP_FILES.
  • (Optional) Fixed lintian errors and warnings.
    • installed the LICENSE file to /usr/share/doc/cpackexample/copyright in CMakeLists.txt.
    • corrected the email format to Name <Email> format in CPackConfig.cmake.
    • added CPACK_PACKAGE_DESCRIPTION

Lintian Output

  • Initital output of lintian

    running with root privileges is not recommended!
    E: cpackexample: extended-description-is-empty
    E: cpackexample: lacks-ldconfig-trigger usr/lib/libcpackexamplelib.so
    E: cpackexample: no-changelog usr/share/doc/cpackexample/changelog.gz (native package)
    E: cpackexample: no-copyright-file
    E: cpackexample: no-phrase Maintainer st196528@stud.uni-stuttgart.de
    W: cpackexample: description-synopsis-starts-with-article
    W: cpackexample: maintscript-calls-ldconfig [postinst]
    W: cpackexample: maintscript-calls-ldconfig [postrm]
    W: cpackexample: no-manual-page [usr/bin/cpackexample]
    W: cpackexample: package-name-doesnt-match-sonames libcpackexamplelib
    W: cpackexample: shared-library-lacks-version usr/lib/libcpackexamplelib.so libcpackexamplelib.so
    
  • Final output of lintian

    running with root privileges is not recommended!
    E: cpackexample: no-changelog usr/share/doc/cpackexample/changelog.gz (native package)
    W: cpackexample: no-manual-page [usr/bin/cpackexample]
    

Test

  1. Build Docker Image: docker build -t cpack-exercise-img .
  2. Run Container: docker run --rm -it --mount type=bind,source="$(pwd)",target=/mnt/cpack-exercise cpack-exercise-img
  3. Build & Package
cd /mnt/cpack-exercise
rm -rf build && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make package
lintian ./cpackexample_0.1.0_amd64.deb

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