2024-08-08 07:47:42 +00:00
|
|
|
FROM scratch AS base
|
2024-02-15 15:22:38 +00:00
|
|
|
ENV VERSION=2.4.4
|
2024-02-12 02:47:17 +00:00
|
|
|
ENV SRC_HASH=67ebe016ca90fa7688ce67a387ebd82c6261e95897db7b23df24ff335be85bc6
|
2024-02-15 15:22:38 +00:00
|
|
|
ENV SRC_FILE=gnupg-${VERSION}.tar.bz2
|
2024-02-12 02:47:17 +00:00
|
|
|
ENV SRC_SITE=https://gnupg.org/ftp/gcrypt/gnupg/${SRC_FILE}
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM base AS fetch
|
2024-02-12 02:47:17 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
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 . /
|
|
|
|
COPY --from=stagex/libksba . /
|
|
|
|
COPY --from=stagex/libgpg-error . /
|
|
|
|
COPY --from=stagex/libassuan . /
|
|
|
|
COPY --from=stagex/libgcrypt . /
|
2024-02-12 02:47:17 +00:00
|
|
|
RUN tar -xvf $SRC_FILE
|
2024-02-15 15:22:38 +00:00
|
|
|
WORKDIR gnupg-${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 \
|
|
|
|
--prefix=/usr \
|
2024-03-01 18:30:23 +00:00
|
|
|
--bindir=/usr/bin \
|
2024-02-12 02:47:17 +00:00
|
|
|
--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
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM build AS install
|
2024-02-12 02:47:17 +00:00
|
|
|
RUN make DESTDIR=/rootfs install
|
|
|
|
|
2024-08-08 07:47:42 +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 . /
|
|
|
|
COPY --from=stagex/npth . /
|
|
|
|
COPY --from=stagex/libksba . /
|
|
|
|
COPY --from=stagex/libgpg-error . /
|
|
|
|
COPY --from=stagex/libassuan . /
|
|
|
|
COPY --from=stagex/libgcrypt . /
|
2024-02-12 02:47:17 +00:00
|
|
|
|
|
|
|
RUN /bin/sh <<-EOF
|
|
|
|
set -eux
|
2024-02-15 15:22:38 +00:00
|
|
|
EXPECTED_GPG_VERSION="gpg version ${VERSION}"
|
2024-02-12 02:47:17 +00:00
|
|
|
GPG_VERSION=\$(gpg --version)
|
|
|
|
if [ "\$GPG_VERSION" != "\$EXPECTED_GPG_VERSION" ]; then
|
|
|
|
echo "Expected gpg version is \$EXPECTED_GPG_VERSION, but got \$GPG_VERSION"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
EOF
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM stagex/filesystem AS package
|
2024-03-01 18:30:23 +00:00
|
|
|
COPY --from=install /rootfs/. /
|