@@ -53,24 +53,46 @@ RUN set -x \
5353 ;; \
5454 *) \
5555# we're on an architecture upstream doesn't officially build for
56- # let's build binaries from the published source packages
57- echo "deb-src [signed-by=$NGINX_GPGKEY_PATH] https://nginx.org/packages/mainline/debian/ bookworm nginx" >> /etc/apt/sources.list.d/nginx.list \
58- \
56+ # let's build binaries from the published packaging sources
5957# new directory for storing sources and .deb files
60- && tempDir="$(mktemp -d)" \
58+ tempDir="$(mktemp -d)" \
6159 && chmod 777 "$tempDir" \
6260# (777 to ensure APT's "_apt" user can access it too)
6361 \
6462# save list of currently-installed packages so build dependencies can be cleanly removed later
6563 && savedAptMark="$(apt-mark showmanual)" \
6664 \
67- # build .deb files from upstream's source packages (which are verified by apt-get)
65+ # build .deb files from upstream's packaging sources
6866 && apt-get update \
69- && apt-get build-dep -y $nginxPackages \
67+ && apt-get install --no-install-recommends --no-install-suggests -y \
68+ curl \
69+ devscripts \
70+ equivs \
71+ git \
72+ libxml2-utils \
73+ lsb-release \
74+ xsltproc \
7075 && ( \
7176 cd "$tempDir" \
72- && DEB_BUILD_OPTIONS="nocheck parallel=$(nproc)" \
73- apt-get source --compile $nginxPackages \
77+ && REVISION="${NGINX_VERSION}-${PKG_RELEASE}" \
78+ && REVISION=${REVISION%~*} \
79+ && curl -f -O https://hg.nginx.org/pkg-oss/archive/${REVISION}.tar.gz \
80+ && PKGOSSCHECKSUM="b9fbdf1779186fc02aa59dd87597fe4e906892391614289a4e6eedba398a3e770347b5b07110cca8c11fa3ba85bb711626ae69832e74c69ca8340d040a465907 *${REVISION}.tar.gz" \
81+ && if [ "$(openssl sha512 -r ${REVISION}.tar.gz)" = "$PKGOSSCHECKSUM" ]; then \
82+ echo "pkg-oss tarball checksum verification succeeded!" ; \
83+ else \
84+ echo "pkg-oss tarball checksum verification failed!" ; \
85+ exit 1; \
86+ fi \
87+ && tar xzvf ${REVISION}.tar.gz \
88+ && cd pkg-oss-${REVISION} \
89+ && cd debian \
90+ && for target in base module-geoip module-image-filter module-njs module-xslt; do \
91+ make rules-$target; \
92+ mk-build-deps --install --tool="apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes" \
93+ debuild-$target/nginx-$NGINX_VERSION/debian/control; \
94+ done \
95+ && make base module-geoip module-image-filter module-njs module-xslt \
7496 ) \
7597# we don't remove APT lists here because they get re-downloaded and removed later
7698 \
0 commit comments