Skip to content

Conversation

@megha-darda
Copy link

Changes Done:

  1. Added install targets for the executable, library, and header files.

  2. Added CPack configuration to generate .tar.gz and .deb packages.

  3. Configured Debian package with Debian package naming scheme.

  4. (Optional) Updated Dockerfile so that libyaml-cpp is detected correctly.

  5. Enabled binary stripping to reduce package size.

  6. (Optional) Checked size before and after stripping.

    Before:

    du -h cpackexample_0.1.0_amd64.deb
    4.4M    cpackexample_0.1.0_amd64.deb
    

    After:

    du -h cpackexample_0.1.0_amd64.deb
    2.5M    cpackexample_0.1.0_amd64.deb
    
  7. (Optional) Checked lintian errors and fixed few errors. (See the lintian.txt file added)

    • For description-synopsis-is-duplicated: The CPACK_PACKAGE_DESCRIPTION_SUMMARY and CPACK_DEBIAN_PACKAGE_DESCRIPTION were same, so I changed CPACK_DEBIAN_PACKAGE_DESCRIPTION
    • For malformed-contact Maintainer Megha: I added email as debian requires name and email in the Maintainer field.
    • For unstripped-binary-or-object: It got resolved when Step 5 was done.

 

How to run:

docker build -t cpack-exercise .
docker run --rm -it   --mount type=bind,source="$(pwd)",target=/mnt/cpack-exercise   cpack-exercise

Inside container

cd /mnt/cpack-exercise
mkdir build && cd build
cmake ..
make -j
make install
cpack
apt install ./cpackexample_0.1.0_amd64.deb
cpackexample

To check lintian errors:

lintian ./cpackexample_0.1.0_amd64.deb


Gitlab id: dardama

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