stagex/packages/pcsc-lite/Containerfile

63 lines
1.5 KiB
Text
Raw Normal View History

2024-02-13 17:43:33 +00:00
FROM scratch as base
ENV VERSION=2.0.0
2024-02-13 17:43:33 +00:00
ENV SRC_HASH=d6c3e2b64510e5ed6fcd3323febf2cc2a8e5fda5a6588c7671f2d77f9f189356
ENV SRC_FILE=pcsc-lite-${VERSION}.tar.bz2
2024-02-13 17:43:33 +00:00
ENV SRC_SITE=https://pcsclite.apdu.fr/files/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/m4 . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/perl . /
COPY --from=stagex/flex . /
2024-02-26 21:24:28 +00:00
COPY --from=stagex/pkgconf . /
COPY --from=stagex/eudev . /
2024-02-13 17:43:33 +00:00
RUN tar -xvf $SRC_FILE
WORKDIR pcsc-lite-${VERSION}
2024-02-13 17:43:33 +00:00
RUN --network=none <<-EOF
set -eux
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--disable-libusb \
--enable-libudev \
--disable-maintainer-mode \
--disable-silent-rules \
--without-systemdsystemunitdir \
--enable-ipcdir=/run/pcscd \
--enable-usbdropdir=/usr/lib/pcsc/drivers \
--disable-libsystemd \
--disable-polkit \
--disable-strict \
--enable-static
make -j "$(nproc)"
2024-02-13 17:43:33 +00:00
EOF
FROM build as install
RUN make DESTDIR=/rootfs install
2024-02-15 04:00:43 +00:00
RUN find /rootfs -exec touch -hcd "@0" "{}" +
2024-02-13 17:43:33 +00:00
FROM base as test
COPY --from=install /rootfs/. /
COPY --from=stagex/busybox . /
2024-02-13 17:43:33 +00:00
RUN /bin/sh <<-EOF
set -eux
PCSC_FILES_FOUND=\$(ls /usr/lib/ | grep pcsc || true)
if [ -z "\$PCSC_FILES_FOUND" ]; then
echo "pcsc-lite not found"
exit 1
fi
EOF
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /