Skip to content

Conversation

@Simonandy28
Copy link

@Simonandy28 Simonandy28 commented Dec 8, 2025

Testing the code

Running Docker

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

Building and Packaging the Code

Inside the Docker container, navigate to the mounted directory:

cd /mnt/cpack-exercise

Build the project:

mkdir build && cd build
cmake ..
make install
make package

Alternative to install executable and into the project directory:

cmake -DCMAKE_INSTALL_PREFIX=./install ..
make install

Testing the packages

TGZ Package

To unpack the package, use:
tar -xzf TARGZFILE

To inspect the package content, use:
tar -tf TARGZFILE

Debian Package

To install the package and run the executable:

apt install ./DEBFILE
cpackexample

To inspect the Debian package contents:

dpkg -I DEBFILE
# OR
dpkg-deb -R DEBFILE DIRECTORY_FOR_UNPACKED_DEBFILE

To check for errors (Lintian):

lintian ./DEBFILENAME

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