feat: package opensc

This commit is contained in:
Lance R. Vick 2024-06-20 23:26:29 -07:00
parent 6b6a67beaa
commit 7cb126d083
No known key found for this signature in database
GPG key ID: 8E47A1EC35A1551D
2 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,60 @@
FROM scratch as base
ENV VERSION=0.25.1
ENV SRC_HASH=989e6305900d4f2f56ef84aa0da07c044459b4f8a508957a4cdefce6a1367c7b
ENV SRC_FILE=${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/opensc/opensc/archive/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/util-linux . /
COPY --from=stagex/perl . /
COPY --from=stagex/openssl . /
COPY --from=stagex/ncurses . /
COPY --from=stagex/readline . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/gettext . /
COPY --from=stagex/pcsc-lite . /
COPY --from=stagex/automake . /
COPY --from=stagex/libtool . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/m4 . /
COPY --from=stagex/zlib . /
RUN tar -xf ${SRC_FILE}
WORKDIR OpenSC-${VERSION}
ENV CFLAGS="-U_FORTIFY_SOURCE -Wno-error"
RUN --network=none <<-EOF
set -eux
./bootstrap
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--enable-zlib \
--enable-readline \
--enable-openssl \
--enable-pcsc \
--enable-sm \
--enable-piv-sm
make -j "$(nproc)"
make -C src/tools
EOF
FROM build as install
RUN --network=none <<-EOF
set -eux
make DESTDIR=/rootfs install
install -D -m644 etc/opensc.conf /rootfs/etc/opensc.conf
EOF
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /

View file

@ -1376,6 +1376,32 @@ out/openpgp-card-tools/index.json: \
out/zlib/index.json
$(call build,openpgp-card-tools)
.PHONY: opensc
opensc: out/opensc/index.json
out/opensc/index.json: \
packages/opensc/Containerfile \
out/autoconf/index.json \
out/automake/index.json \
out/binutils/index.json \
out/busybox/index.json \
out/filesystem/index.json \
out/gcc/index.json \
out/gettext/index.json \
out/libtool/index.json \
out/linux-headers/index.json \
out/m4/index.json \
out/make/index.json \
out/musl/index.json \
out/ncurses/index.json \
out/openssl/index.json \
out/pcsc-lite/index.json \
out/perl/index.json \
out/pkgconf/index.json \
out/readline/index.json \
out/util-linux/index.json \
out/zlib/index.json
$(call build,opensc)
.PHONY: openssl
openssl: out/openssl/index.json
out/openssl/index.json: \