packages/

pcsc-lite

Details
Source
FROM scratch AS base
ENV VERSION=2.2.3
ENV SRC_HASH=cab1e62755713f62ce1b567954dbb0e9a7e668ffbc3bbad3ce85c53f8f4e00a4
ENV SRC_FILE=pcsc-lite-${VERSION}.tar.xz
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/libusb . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/perl . /
COPY --from=stagex/flex . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/autoconf-archive . /
COPY --from=stagex/automake . /
COPY --from=stagex/libtool . /
RUN tar -xvf $SRC_FILE
WORKDIR /pcsc-lite-${VERSION}
RUN --network=none <<-EOF
	set -eux
	./bootstrap && \
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-libusb \
		--disable-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)"
EOF

FROM build AS install
RUN --network=none make DESTDIR=/rootfs install

FROM base AS test
COPY --from=install /rootfs/. /
COPY --from=stagex/busybox . /
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/. /