2024-08-17 04:41:04 +00:00
|
|
|
FROM scratch AS base
|
2024-08-16 19:26:04 +00:00
|
|
|
ARG ARCH=x86_64
|
|
|
|
ENV VERSION=0.1.2.2
|
|
|
|
ENV SRC_HASH=f7ffa3714c65973bb95fbcf1501c06fc0478d93a51cea1b373ec6811c2425f52
|
|
|
|
ENV SRC_FILE=utmps-${VERSION}.tar.gz
|
|
|
|
ENV SRC_SITE=https://skarnet.org/software/utmps/${SRC_FILE}
|
|
|
|
|
2024-08-17 04:41:04 +00:00
|
|
|
FROM base AS fetch
|
2024-08-16 19:26:04 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
|
|
|
|
|
|
|
|
FROM fetch as build
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/skalibs . /
|
|
|
|
RUN tar -xf ${SRC_FILE}
|
|
|
|
WORKDIR utmps-${VERSION}
|
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
|
|
|
./configure \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--prefix=/usr \
|
|
|
|
--disable-allstatic \
|
|
|
|
--libdir=/usr/lib \
|
|
|
|
--libexecdir=/lib/utmps \
|
|
|
|
--with-lib=/usr/lib \
|
|
|
|
--with-dynlib=/lib
|
2024-08-17 04:41:04 +00:00
|
|
|
make -j "$(nproc)"
|
2024-08-16 19:26:04 +00:00
|
|
|
EOF
|
|
|
|
|
2024-08-17 04:41:04 +00:00
|
|
|
FROM build AS install
|
2024-08-16 19:26:04 +00:00
|
|
|
RUN make DESTDIR=/rootfs install
|
|
|
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
|
|
|
|
2024-08-17 04:41:04 +00:00
|
|
|
FROM stagex/filesystem AS package
|
2024-08-16 19:26:04 +00:00
|
|
|
COPY --from=install /rootfs/. /
|