dpkg

Details
Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-musl . /
COPY --from=stagex/core-gcc . /
COPY --from=stagex/core-make . /
COPY --from=stagex/core-m4 . /
COPY --from=stagex/core-perl . /
COPY --from=stagex/core-binutils . /
COPY --from=stagex/core-pkgconf . /
COPY --from=stagex/core-autoconf . /
COPY --from=stagex/core-automake . /
COPY --from=stagex/core-zlib . /
COPY --from=stagex/core-bzip2 . /
COPY --from=stagex/core-gettext . /
COPY --from=stagex/core-libtool . /
COPY --from=stagex/core-tar . /
COPY --from=stagex/user-libmd . /
COPY --from=stagex/user-patch . /
ADD fetch/dpkg-${VERSION}.tar.bz2 .
WORKDIR /dpkg-${VERSION}
ENV SOURCE_DATE_EPOCH=1
RUN --network=none <<-EOF
	set -eux
	echo ${VERSION} > .dist-version
	autoreconf -fvi

	# On the builders /home/buildozer has S_ISGID set this is
	# inherited in $srcdir and causes some dpkg test to end up with
	# a permission mismatch. To fix this remove the S_ISGID from
	# $srcdir.
	chmod -R g-s .

	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-libz \
		--with-libbz2 \
		--disable-dselect \
		--disable-start-stop-daemon \
		--disable-nls \
		--disable-static \
		--with-zshcompletionsdir=/usr/share/zsh/site-functions
	make -j "$(nproc)"
	make install DESTDIR=/rootfs
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /