stagex/packages/pcsc-lite/Containerfile

67 lines
1.7 KiB
Text
Raw Normal View History

FROM scratch AS base
ENV VERSION=2.2.3
ENV SRC_HASH=cab1e62755713f62ce1b567954dbb0e9a7e668ffbc3bbad3ce85c53f8f4e00a4
ENV SRC_FILE=pcsc-lite-${VERSION}.tar.xz
2024-02-13 17:43:33 +00:00
ENV SRC_SITE=https://pcsclite.apdu.fr/files/${SRC_FILE}
2024-08-08 07:47:42 +00:00
FROM base AS fetch
2024-02-13 17:43:33 +00:00
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
2024-08-08 07:47:42 +00:00
FROM fetch AS build
COPY --from=stagex/busybox . /
COPY --from=stagex/m4 . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
2024-06-21 00:01:48 +00:00
COPY --from=stagex/libusb . /
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/autoconf . /
COPY --from=stagex/autoconf-archive . /
COPY --from=stagex/automake . /
COPY --from=stagex/libtool . /
2024-02-13 17:43:33 +00:00
RUN tar -xvf $SRC_FILE
2024-08-26 01:18:52 +00:00
WORKDIR /pcsc-lite-${VERSION}
2024-02-13 17:43:33 +00:00
RUN --network=none <<-EOF
set -eux
./bootstrap && \
2024-02-13 17:43:33 +00:00
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
2024-06-21 03:44:08 +00:00
--enable-libusb \
--disable-libudev \
2024-02-13 17:43:33 +00:00
--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
2024-08-08 07:47:42 +00:00
FROM build AS install
2024-04-11 20:09:20 +00:00
RUN --network=none make DESTDIR=/rootfs install
2024-02-13 17:43:33 +00:00
2024-08-08 07:47:42 +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
2024-08-08 07:47:42 +00:00
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /