Skip to content

Conversation

@bossbeagle1509
Copy link

Added installation and packaging targets

Gitlab Username: manojpv

Steps to Test

Building Docker Image:

docker build -t cpack-exercise .

Run the container with the folder mounted

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

Test from within the running container

cd /mnt/cpack-exercise
mkdir build && cd build
cmake ..
make -j4

# test installation target
make install DESTDIR=/tmp/test-install && tree /tmp/test-install

# create packages
make package

# check packages
tar -tzf cpackexample-0.1.0-Linux.tar.gz && dpkg-deb -c cpackexample_0.1.0_amd64.deb

# Install and run Debian package
apt install -y ./cpackexample_0.1.0_amd64.deb && cpackexample

# Check with lintian
lintian ./cpackexample_0.1.0_amd64.deb

Changes Made by PR

  • The following install targets were added:

    • Executable: /bin/
    • Library: /lib/
    • Headers: /include/cpackexamplelib/
  • Created cmake/CPackConfig.cmake with the following features:

    • Package Metadata
    • Debian naming scheme
    • Generates DEB, TGZ packages
    • Binary Stripping

Lintian Output

Initial output:

E: cpackexample: no-changelog usr/share/doc/cpackexample/changelog.gz (native package)
E: cpackexample: no-copyright-file
E: cpackexample: no-phrase Maintainer bossbeagle1509@gmail.com
W: cpackexample: extended-description-line-too-long line 2
W: cpackexample: no-manual-page [usr/bin/cpackexample]

Completed output:

E: cpackexample: no-changelog usr/share/doc/cpackexample/changelog.gz (native package)
E: cpackexample: no-copyright-file
W: cpackexample: no-manual-page [usr/bin/cpackexample]

Fixes:

  • extended-description-line-too-long --> Shortened package description
  • no-phrase Maintainer --> Fixed maintainer format to Name

Binary Stripping Verification

  • Build directory (unstripped): 4.4M
  • Package (stripped): 1.7M

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