2024-02-12 02:47:17 +00:00
|
|
|
FROM scratch as base
|
2024-02-15 15:22:38 +00:00
|
|
|
ENV VERSION=1.6.5
|
2024-02-12 02:47:17 +00:00
|
|
|
ENV SRC_HASH=a564628c574c99287998753f98d750babd91a4e9db451f46ad140466ef2a6d16
|
2024-02-15 15:22:38 +00:00
|
|
|
ENV SRC_FILE=libksba-${VERSION}.tar.bz2
|
2024-02-12 02:47:17 +00:00
|
|
|
ENV SRC_SITE=https://gnupg.org/ftp/gcrypt/libksba/${SRC_FILE}
|
|
|
|
|
|
|
|
FROM base as fetch
|
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
|
|
|
|
|
|
|
|
FROM fetch as build
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/npth . /
|
2024-03-01 18:30:23 +00:00
|
|
|
COPY --from=stagex/libgpg-error . /
|
2024-02-12 02:47:17 +00:00
|
|
|
RUN tar -xvf $SRC_FILE
|
2024-02-15 15:22:38 +00:00
|
|
|
WORKDIR libksba-${VERSION}
|
2024-02-12 02:47:17 +00:00
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
|
|
|
./configure \
|
|
|
|
--build=x86_64-unknown-linux-musl \
|
|
|
|
--host=x86_64-unknown-linux-musl \
|
2024-03-01 18:30:23 +00:00
|
|
|
--prefix=/usr/ \
|
2024-02-12 02:47:17 +00:00
|
|
|
--bindir=/bin \
|
|
|
|
--mandir=/usr/share/man \
|
2024-03-15 05:41:27 +00:00
|
|
|
--infodir=/usr/share/info
|
2024-03-14 07:16:26 +00:00
|
|
|
make -j "$(nproc)"
|
2024-02-12 02:47:17 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
FROM build as install
|
2024-04-11 20:09:20 +00:00
|
|
|
RUN --network=none make DESTDIR=/rootfs install
|
2024-02-12 02:47:17 +00:00
|
|
|
|
|
|
|
FROM base as test
|
2024-03-01 18:30:23 +00:00
|
|
|
COPY --from=install /rootfs/. /
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/zlib . /
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/busybox . /
|
2024-02-12 02:47:17 +00:00
|
|
|
RUN /bin/sh <<-EOF
|
|
|
|
set -eux
|
|
|
|
LIBKSBA_FILES_FOUND=\$(ls /usr/lib/ | grep libksba || true)
|
|
|
|
if [ -z "\$LIBKSBA_FILES_FOUND" ]; then
|
|
|
|
echo "libksba not found"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
EOF
|
|
|
|
|
2024-03-01 18:30:23 +00:00
|
|
|
FROM stagex/filesystem as package
|
|
|
|
COPY --from=install /rootfs/. /
|