From: Pieter Lexis Date: Tue, 10 Nov 2020 13:56:17 +0000 (+0100) Subject: Allow setting a fake-ish version number when building release images X-Git-Tag: dnsdist-1.6.0-alpha0~5^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F9700%2Fhead;p=thirdparty%2Fpdns.git Allow setting a fake-ish version number when building release images --- diff --git a/Dockerfile-auth b/Dockerfile-auth index 42bdf88e2f..f56c6b6afc 100644 --- a/Dockerfile-auth +++ b/Dockerfile-auth @@ -28,11 +28,18 @@ COPY m4 /source/m4 COPY ext /source/ext COPY .git /source/.git ADD configure.ac Makefile.am /source/ +COPY builder/helpers/set-configure-ac-version.sh /usr/local/bin ARG MAKEFLAGS= ENV MAKEFLAGS ${MAKEFLAGS:--j2} -RUN BUILDER_MODULES=authoritative autoreconf -vfi +ARG DOCKER_FAKE_RELEASE=NO +ENV DOCKER_FAKE_RELEASE ${DOCKER_FAKE_RELEASE} + +RUN if [ "${DOCKER_FAKE_RELEASE}" = "YES" ]; then \ + BUILDER_VERSION="$(BUILDER_MODULES=authoritative ./builder-support/gen-version | sed 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/')" set-configure-ac-version.sh;\ + fi && \ + BUILDER_MODULES=authoritative autoreconf -vfi # simplify repeated -C calls with SUBDIRS? RUN mkdir /build && \ diff --git a/Dockerfile-dnsdist b/Dockerfile-dnsdist index 75dab70de0..ee61975c12 100644 --- a/Dockerfile-dnsdist +++ b/Dockerfile-dnsdist @@ -19,6 +19,7 @@ COPY pdns /source/pdns COPY build-aux /source/build-aux COPY m4 /source/m4 COPY ext /source/ext +COPY builder/helpers/set-configure-ac-version.sh /usr/local/bin COPY .git /source/.git # build and install (TODO: before we hit this line, rearrange /source structure if we are coming from a tarball) @@ -27,9 +28,15 @@ WORKDIR /source/pdns/dnsdistdist ARG MAKEFLAGS= ENV MAKEFLAGS ${MAKEFLAGS:--j2} +ARG DOCKER_FAKE_RELEASE=NO +ENV DOCKER_FAKE_RELEASE ${DOCKER_FAKE_RELEASE} + RUN touch dnsdist.1 # avoid having to install pandoc and venv -RUN BUILDER_MODULES=dnsdist autoreconf -vfi +RUN if [ "${DOCKER_FAKE_RELEASE}" = "YES" ]; then \ + BUILDER_VERSION="$(BUILDER_MODULES=dnsdist ./builder-support/gen-version | sed 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/')" set-configure-ac-version.sh;\ + fi && \ + BUILDER_MODULES=dnsdist autoreconf -vfi RUN mkdir /build && \ ./configure \ diff --git a/Dockerfile-recursor b/Dockerfile-recursor index 268417bb09..3f1a487237 100644 --- a/Dockerfile-recursor +++ b/Dockerfile-recursor @@ -25,6 +25,7 @@ COPY build-aux /source/build-aux COPY m4 /source/m4 COPY ext /source/ext COPY .git /source/.git +COPY builder/helpers/set-configure-ac-version.sh /usr/local/bin # build and install (TODO: before we hit this line, rearrange /source structure if we are coming from a tarball) WORKDIR /source/pdns/recursordist @@ -32,13 +33,19 @@ WORKDIR /source/pdns/recursordist ARG MAKEFLAGS= ENV MAKEFLAGS ${MAKEFLAGS:--j2} +ARG DOCKER_FAKE_RELEASE=NO +ENV DOCKER_FAKE_RELEASE ${DOCKER_FAKE_RELEASE} + # Manpage deps # RUN apt-get install -y virtualenv && apt-get clean # Manpage prevent RUN touch pdns_recursor.1 rec_control.1 # avoid installing pandoc -RUN BUILDER_MODULES=recursor autoreconf -vfi +RUN if [ "${DOCKER_FAKE_RELEASE}" = "YES" ]; then \ + BUILDER_VERSION="$(BUILDER_MODULES=recursor ./builder-support/gen-version | sed 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/')" set-configure-ac-version.sh;\ + fi && \ + BUILDER_MODULES=recursor autoreconf -vfi RUN mkdir /build && \ ./configure \ diff --git a/pdns/recursordist/configure.ac b/pdns/recursordist/configure.ac index 0b756510ae..d5de20b845 100644 --- a/pdns/recursordist/configure.ac +++ b/pdns/recursordist/configure.ac @@ -174,7 +174,7 @@ AS_IF([test "x$pdns_configure_args" != "x"], [summary_conf_opts=$pdns_configure_args], [summary_conf_opts="(no options)"] ) -AC_MSG_NOTICE([PowerDNS Recursor configured with: $summary_conf_opts]) +AC_MSG_NOTICE([PowerDNS Recursor $VERSION configured with: $summary_conf_opts]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([CC: $CC]) AC_MSG_NOTICE([CXX: $CXX])