Skip to content

Conversation

@jnagasawa
Copy link

@jnagasawa jnagasawa commented Dec 10, 2025

GitLab: nagasaji

I completed the optional and bonus tasks.

How to Install:

docker build -t cpack-exercise .
docker run --rm -it --entrypoint /bin/bash -v "$(pwd):/mnt/cpack-exercise" cpack-exercise

lintian output:

root@8b249e6f7d48:/mnt/cpack-exercise# lintian ./cpackexample_0.1.0_arm64.deb 
running with root privileges is not recommended!
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
W: cpackexample: extended-description-line-too-long line 1
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

Copy link
Member

@uekerman uekerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your cmake/CPackConfig.cmake is missing. Could you please still add it?

Comment on lines +32 to +56
RUN echo '#!/bin/bash' > /entrypoint.sh && \
echo 'set -e' >> /entrypoint.sh && \
echo 'SOURCE_DIR="/mnt/cpack-exercise"' >> /entrypoint.sh && \
echo 'BUILD_DIR="/tmp/build"' >> /entrypoint.sh && \
echo 'if [ ! -d "$SOURCE_DIR" ]; then' >> /entrypoint.sh && \
echo ' echo "Error: Source directory $SOURCE_DIR not found. Did you mount the volume?"' >> /entrypoint.sh && \
echo ' exit 1' >> /entrypoint.sh && \
echo 'fi' >> /entrypoint.sh && \
echo 'echo "Setting up build environment..."' >> /entrypoint.sh && \
echo 'mkdir -p "$BUILD_DIR"' >> /entrypoint.sh && \
echo 'rsync -av --exclude "build" "$SOURCE_DIR/" "$BUILD_DIR/"' >> /entrypoint.sh && \
echo 'cd "$BUILD_DIR"' >> /entrypoint.sh && \
echo 'echo "Configuring project..."' >> /entrypoint.sh && \
echo 'cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON .' >> /entrypoint.sh && \
echo 'echo "Building project..."' >> /entrypoint.sh && \
echo 'cmake --build build' >> /entrypoint.sh && \
echo 'echo "Creating packages..."' >> /entrypoint.sh && \
echo 'cd build' >> /entrypoint.sh && \
echo 'cpack -G TGZ' >> /entrypoint.sh && \
echo 'cpack -G DEB' >> /entrypoint.sh && \
echo 'echo "Copying packages to host..."' >> /entrypoint.sh && \
echo 'cp *.tar.gz "$SOURCE_DIR/"' >> /entrypoint.sh && \
echo 'cp *.deb "$SOURCE_DIR/"' >> /entrypoint.sh && \
echo 'echo "Done! Packages are available in $SOURCE_DIR"' >> /entrypoint.sh && \
chmod +x /entrypoint.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better add the script here explicitly and copy it to the container. Not easy to maintain like this.

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.

2 participants