From fd0548baa90d902bcfcbfc27be5ab664b4e2406e Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Thu, 22 Feb 2024 13:26:55 -0500 Subject: [PATCH 1/3] Update build system for v1.9.0, use cmake --- Dockerfile | 36 +++++++++--------- Dockerfile.aarch64 | 37 ++++++++++--------- README.md | 3 +- readme-vars.yml | 5 ++- .../s6-overlay/s6-rc.d/init-znc-config/run | 2 +- root/etc/s6-overlay/s6-rc.d/svc-znc/run | 2 +- 6 files changed, 45 insertions(+), 40 deletions(-) diff --git a/Dockerfile b/Dockerfile index cbc73af..64be1a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,17 @@ FROM ghcr.io/linuxserver/baseimage-alpine:3.19 as buildstage # package version ARG ZNC_RELEASE +# common env +ENV \ + MAKEFLAGS="-j4" + RUN \ echo "**** install build packages ****" && \ apk add -U --update --no-cache \ + argon2-dev \ autoconf \ automake \ + boost-dev\ build-base \ c-ares-dev \ cyrus-sasl-dev \ @@ -21,7 +27,11 @@ RUN \ perl-dev \ python3-dev \ swig \ - tcl-dev + tar \ + tcl-dev && \ + python3 -m venv /lsiopy && \ + pip install -U --no-cache-dir pip setuptools && \ + pip install -U --no-cache-dir cmake RUN \ echo "**** compile znc ****" && \ @@ -62,26 +72,18 @@ RUN \ /tmp/znc-palaver.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ cd /tmp/znc && \ - export CFLAGS="$CFLAGS -D_GNU_SOURCE" && \ - ./configure \ - --build=$CBUILD \ - --enable-cyrus \ - --enable-perl \ - --enable-python \ - --enable-swig \ - --enable-tcl \ - --host=$CHOST \ - --infodir=/usr/share/info \ - --localstatedir=/var \ - --mandir=/usr/share/man \ - --prefix=/usr \ - --sysconfdir=/etc && \ + mkdir -p build && \ + cd build && \ + cmake .. \ + -DWANT_PYTHON=yes \ + -DWANT_PERL=yes \ + -DWANT_TCL=yes && \ make && \ make DESTDIR=/tmp/znc install RUN \ echo "**** determine runtime packages ****" && \ - scanelf --needed --nobanner /tmp/znc/usr/bin/znc \ + scanelf --needed --nobanner /tmp/znc/usr/local/bin/znc \ | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ | sort -u \ | xargs -r apk info --installed \ @@ -95,7 +97,7 @@ FROM ghcr.io/linuxserver/baseimage-alpine:3.19 ARG BUILD_DATE ARG VERSION LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="sparklyballs" +LABEL maintainer="notaptalca" # copy files from build stage COPY --from=buildstage /tmp/znc/usr/ /usr/ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index b25e001..52f293c 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -6,11 +6,16 @@ FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.19 as buildstage # package version ARG ZNC_RELEASE +# common env +ENV \ + MAKEFLAGS="-j4" + RUN \ - echo "**** install build packages ****" && \ apk add -U --update --no-cache \ + argon2-dev \ autoconf \ automake \ + boost-dev\ build-base \ c-ares-dev \ cyrus-sasl-dev \ @@ -21,7 +26,11 @@ RUN \ perl-dev \ python3-dev \ swig \ - tcl-dev + tar \ + tcl-dev && \ + python3 -m venv /lsiopy && \ + pip install -U --no-cache-dir pip setuptools && \ + pip install -U --no-cache-dir cmake RUN \ echo "**** compile znc ****" && \ @@ -62,26 +71,18 @@ RUN \ /tmp/znc-palaver.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ cd /tmp/znc && \ - export CFLAGS="$CFLAGS -D_GNU_SOURCE" && \ - ./configure \ - --build=$CBUILD \ - --enable-cyrus \ - --enable-perl \ - --enable-python \ - --enable-swig \ - --enable-tcl \ - --host=$CHOST \ - --infodir=/usr/share/info \ - --localstatedir=/var \ - --mandir=/usr/share/man \ - --prefix=/usr \ - --sysconfdir=/etc && \ + mkdir -p build && \ + cd build && \ + cmake .. \ + -DWANT_PYTHON=yes \ + -DWANT_PERL=yes \ + -DWANT_TCL=yes && \ make && \ make DESTDIR=/tmp/znc install RUN \ echo "**** determine runtime packages ****" && \ - scanelf --needed --nobanner /tmp/znc/usr/bin/znc \ + scanelf --needed --nobanner /tmp/znc/usr/local/bin/znc \ | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ | sort -u \ | xargs -r apk info --installed \ @@ -95,7 +96,7 @@ FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.19 ARG BUILD_DATE ARG VERSION LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="sparklyballs" +LABEL maintainer="notaptalca" # copy files from build stage COPY --from=buildstage /tmp/znc/usr/ /usr/ diff --git a/README.md b/README.md index c4fa767..7aff2e6 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ The architectures supported by this image are: ## Application Setup -To log in to the application, browse to http://:6501. +To log in to the application, browse to `http://:6501`. * Default User: admin * Default Password: admin @@ -275,6 +275,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **22.02.24:** - Update build system for v1.9.0 (use cmake). * **23.12.23:** - Rebase to Alpine 3.19. * **12.07.23:** - Rebasing to Alpine 3.18. * **07.07.23:** - Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf) diff --git a/readme-vars.yml b/readme-vars.yml index d114be7..6bd4a39 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -38,14 +38,15 @@ optional_block_1: false # application setup block app_setup_block_enabled: true app_setup_block: | - To log in to the application, browse to http://:6501. + To log in to the application, browse to `http://:6501`. * Default User: admin * Default Password: admin `change password ASAP.` # changelog changelogs: - - { date: "23.12.23:", desc: "Rebase to Alpine 3.19."} + - {date: "22.02.24:", desc: "Update build system for v1.9.0 (use cmake)."} + - {date: "23.12.23:", desc: "Rebase to Alpine 3.19."} - {date: "12.07.23:", desc: "Rebasing to Alpine 3.18."} - {date: "07.07.23:", desc: "Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"} - {date: "13.02.23:", desc: "Rebase to Alpine 3.17, migrate to s6v3."} diff --git a/root/etc/s6-overlay/s6-rc.d/init-znc-config/run b/root/etc/s6-overlay/s6-rc.d/init-znc-config/run index 3119ec8..bf1f90c 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-znc-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-znc-config/run @@ -7,7 +7,7 @@ mkdir -p \ # generate license file if [[ ! -f /config/znc.pem ]]; then - /usr/bin/znc -d /config -p + /usr/local/bin/znc -d /config -p fi while [[ ! -f "/config/znc.pem" ]]; do diff --git a/root/etc/s6-overlay/s6-rc.d/svc-znc/run b/root/etc/s6-overlay/s6-rc.d/svc-znc/run index 69a1207..5a84d62 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-znc/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-znc/run @@ -5,5 +5,5 @@ PORT=$(grep "Port =" /config/configs/znc.conf | awk -F '=' '{print $2;exit}') exec \ s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${PORT}" \ - s6-setuidgid abc /usr/bin/znc -d /config \ + s6-setuidgid abc /usr/local/bin/znc -d /config \ --foreground From 55732d46ad76283f425785eb8c5cbe641431ffdf Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Thu, 22 Feb 2024 13:35:08 -0500 Subject: [PATCH 2/3] build single threaded multi threaded builds suffer from an intermittent inability to untar a `generated` tarball, likely a race condition as a result of parallel build steps --- Dockerfile | 4 ---- Dockerfile.aarch64 | 4 ---- 2 files changed, 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 64be1a7..b315433 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,10 +6,6 @@ FROM ghcr.io/linuxserver/baseimage-alpine:3.19 as buildstage # package version ARG ZNC_RELEASE -# common env -ENV \ - MAKEFLAGS="-j4" - RUN \ echo "**** install build packages ****" && \ apk add -U --update --no-cache \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 52f293c..bd01202 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -6,10 +6,6 @@ FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.19 as buildstage # package version ARG ZNC_RELEASE -# common env -ENV \ - MAKEFLAGS="-j4" - RUN \ apk add -U --update --no-cache \ argon2-dev \ From 9af49b6c6693bcc5a23fe18e97ef86b13055516c Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:42:13 -0500 Subject: [PATCH 3/3] Use github repo instead of binary from website --- Dockerfile | 26 ++++++++++++-------------- Dockerfile.aarch64 | 26 ++++++++++++-------------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index b315433..96861d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,35 +37,33 @@ RUN \ fi && \ mkdir -p \ /tmp/znc && \ + git clone --branch "${ZNC_RELEASE}" --depth 1 \ + --recurse-submodules \ + https://github.com/znc/znc.git \ + /tmp/znc && \ curl -o \ - /tmp/znc-src.tar.gz -L \ - "https://znc.in/releases/archive/${ZNC_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/znc-src.tar.gz -C \ - /tmp/znc --strip-components=1 && \ - curl -o \ - /tmp/playback.tar.gz -L \ + /tmp/playback.tar.gz -L \ https://github.com/jpnurmi/znc-playback/archive/master.tar.gz && \ tar xf \ - /tmp/playback.tar.gz -C \ + /tmp/playback.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ curl -o \ - /tmp/znc-push.tar.gz -L \ + /tmp/znc-push.tar.gz -L \ https://github.com/jreese/znc-push/archive/master.tar.gz && \ tar xf \ - /tmp/znc-push.tar.gz -C \ + /tmp/znc-push.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ curl -o \ - /tmp/znc-clientbuffer.tar.gz -L \ + /tmp/znc-clientbuffer.tar.gz -L \ https://github.com/CyberShadow/znc-clientbuffer/archive/master.tar.gz && \ tar xf \ - /tmp/znc-clientbuffer.tar.gz -C \ + /tmp/znc-clientbuffer.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ curl -o \ - /tmp/znc-palaver.tar.gz -L \ + /tmp/znc-palaver.tar.gz -L \ https://github.com/cocodelabs/znc-palaver/archive/master.tar.gz && \ tar xf \ - /tmp/znc-palaver.tar.gz -C \ + /tmp/znc-palaver.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ cd /tmp/znc && \ mkdir -p build && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index bd01202..3d2e499 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -36,35 +36,33 @@ RUN \ fi && \ mkdir -p \ /tmp/znc && \ + git clone --branch "${ZNC_RELEASE}" --depth 1 \ + --recurse-submodules \ + https://github.com/znc/znc.git \ + /tmp/znc && \ curl -o \ - /tmp/znc-src.tar.gz -L \ - "https://znc.in/releases/archive/${ZNC_RELEASE}.tar.gz" && \ - tar xf \ - /tmp/znc-src.tar.gz -C \ - /tmp/znc --strip-components=1 && \ - curl -o \ - /tmp/playback.tar.gz -L \ + /tmp/playback.tar.gz -L \ https://github.com/jpnurmi/znc-playback/archive/master.tar.gz && \ tar xf \ - /tmp/playback.tar.gz -C \ + /tmp/playback.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ curl -o \ - /tmp/znc-push.tar.gz -L \ + /tmp/znc-push.tar.gz -L \ https://github.com/jreese/znc-push/archive/master.tar.gz && \ tar xf \ - /tmp/znc-push.tar.gz -C \ + /tmp/znc-push.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ curl -o \ - /tmp/znc-clientbuffer.tar.gz -L \ + /tmp/znc-clientbuffer.tar.gz -L \ https://github.com/CyberShadow/znc-clientbuffer/archive/master.tar.gz && \ tar xf \ - /tmp/znc-clientbuffer.tar.gz -C \ + /tmp/znc-clientbuffer.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ curl -o \ - /tmp/znc-palaver.tar.gz -L \ + /tmp/znc-palaver.tar.gz -L \ https://github.com/cocodelabs/znc-palaver/archive/master.tar.gz && \ tar xf \ - /tmp/znc-palaver.tar.gz -C \ + /tmp/znc-palaver.tar.gz -C \ /tmp/znc/modules --strip-components=1 && \ cd /tmp/znc && \ mkdir -p build && \