From 61d7ac2beb24769890818c8764501d4037dec946 Mon Sep 17 00:00:00 2001 From: Jo Date: Mon, 4 Mar 2024 18:24:56 +0100 Subject: [PATCH 01/19] Merge friendly formaating for debian/control --- debian/control | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/debian/control b/debian/control index d12470df..1d4d6434 100644 --- a/debian/control +++ b/debian/control @@ -2,11 +2,23 @@ Source: vzlogger Section: net Priority: optional Maintainer: Joachim Zobel -Build-Depends: debhelper (>= 12), pkgconf, - libjson-c-dev, libcurl4-openssl-dev, - libmicrohttpd-dev (>= 0.4.6), libsml-dev (>= 1.0), cmake, libsasl2-dev, - libssl-dev, libgcrypt-dev, libgnutls28-dev, uuid-dev, libunistring-dev, - libgmock-dev, libgtest-dev, pandoc, libmosquitto-dev +Build-Depends: debhelper (>= 12), + pkgconf, + libjson-c-dev, + libcurl4-openssl-dev, + libmicrohttpd-dev (>= 0.4.6), + libsml-dev (>= 1.0), + cmake, + libsasl2-dev, + libssl-dev, + libgcrypt-dev, + libgnutls28-dev, + uuid-dev, + libunistring-dev, + libgmock-dev, + libgtest-dev, + pandoc, + libmosquitto-dev Standards-Version: 4.6.2 Rules-Requires-Root: no Homepage: http://wiki.volkszaehler.org/software/controller/vzlogger From 15ae6f29c570f75a56193a5f253fe3364a69aaac Mon Sep 17 00:00:00 2001 From: Jo Date: Mon, 4 Mar 2024 18:27:07 +0100 Subject: [PATCH 02/19] Removed files for patch release workflow --- debian/DEBIAN_RELEASE.txt | 18 -------- debian/Debian_release.patch | 85 ------------------------------------- 2 files changed, 103 deletions(-) delete mode 100644 debian/DEBIAN_RELEASE.txt delete mode 100644 debian/Debian_release.patch diff --git a/debian/DEBIAN_RELEASE.txt b/debian/DEBIAN_RELEASE.txt deleted file mode 100644 index 14cb8a33..00000000 --- a/debian/DEBIAN_RELEASE.txt +++ /dev/null @@ -1,18 +0,0 @@ - -Steps for creating an official Debian release - -1. Create a branch debian- -2. Apply the patch Debian_release.patch - patch -p1 < debian/Debian_release.patch - and - git add .gitattributes -3. Append to the Vcs-Git entry -4. Retrieve the current changelog with - curl -o debian/changelog https://metadata.ftp-master.debian.org/changelogs//main/libs/vzlogger/vzlogger__changelog -5. Prepend a new changelog entry. -6. Remove the debian relase files - git rm debian/Debian_release.patch debian/DEBIAN_RELEASE.txt -7. Commit. -8. Create orig tarball - git archive --output=../vzlogger_$(dpkg-parsechangelog --show-field Version 2>/dev/null | cut -f1 -d-).orig.tar.gz --format=tar.gz HEAD - diff --git a/debian/Debian_release.patch b/debian/Debian_release.patch deleted file mode 100644 index b701f341..00000000 --- a/debian/Debian_release.patch +++ /dev/null @@ -1,85 +0,0 @@ -From faa2a55d0565c4cb6c987ff524779a984d52b258 Mon Sep 17 00:00:00 2001 -From: Joachim Zobel -Date: Sat, 24 Feb 2024 15:16:30 +0100 -Subject: Patch to make a release suitable for Debian - ---- - debian/compat | 1 - - debian/source/format | 2 +- - debian/source/lintian-overrides | 4 ---- - etc/vzlogger.conf | 23 +++++++++++++++++++++++ - 4 files changed, 24 insertions(+), 6 deletions(-) - delete mode 100644 debian/compat - delete mode 100644 debian/source/lintian-overrides - -diff --git a/debian/compat b/debian/compat -deleted file mode 100644 -index 48082f7..0000000 ---- a/debian/compat -+++ /dev/null -@@ -1 +0,0 @@ --12 -diff --git a/debian/source/format b/debian/source/format -index 89ae9db..163aaf8 100644 ---- a/debian/source/format -+++ b/debian/source/format -@@ -1 +1 @@ --3.0 (native) -+3.0 (quilt) -diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides -deleted file mode 100644 -index 8261c3d..0000000 ---- a/debian/source/lintian-overrides -+++ /dev/null -@@ -1,4 +0,0 @@ --# May be odd, but I don't want to change the (non debian) past --odd-historical-debian-changelog-version *0.3.4-rc1* --# Having a debian watch file in the native package is easier to maintain --debian-watch-file-in-native-package * -diff --git a/etc/vzlogger.conf b/etc/vzlogger.conf -index f30363e..48aa76b 100644 ---- a/etc/vzlogger.conf -+++ b/etc/vzlogger.conf -@@ -29,9 +29,11 @@ - - // realtime notification settings - "push": [ -+ /* - { - "url": "http://127.0.0.1:5582" // notification destination, e.g. frontend push-server - } -+ */ - ], - - // mqtt client support (if ENABLE_MQTT set at cmake generation) -@@ -153,6 +155,27 @@ - "middleware": "http://localhost/middleware.php" - } - }, -+ { -+ /* A minimal example that "just works" on Debian. -+ The steps needed are: -+ 1. Install influxdb: sudo apt install influxdb influxdb-client -+ 2. Start the client by calling influx on the command line and -+ create db: CREATE DATABASE vzlogger -+ */ -+ "enabled": false, // disabled meters will be ignored -+ "allowskip": false, // errors when opening meter may be ignored if enabled -+ -+ "protocol": "random", -+ "interval": 2, -+ "max": 40.0, // has to be double! -+ "min": -5.0, // has to be double! -+ "channel": { -+ "uuid": "25a53b28-75ec-4764-a8a6-68587722ddab", -+ // For details on the influxdb configuration see vzlogger.conf.InfluxDB -+ "api": "influxdb", -+ "host": "localhost:8086" -+ } -+ }, - { - "enabled": false, // disabled meters will be ignored - "allowskip": false, // errors when opening meter may be ignored if enabled --- -2.39.2 - From 5811525724ba9cd7c53ca54eda164d4589f54ff1 Mon Sep 17 00:00:00 2001 From: Joachim Zobel Date: Tue, 12 Mar 2024 06:38:31 +0100 Subject: [PATCH 03/19] More changes from Review (copyright, postinst) (#634) --- debian/copyright | 40 +++++++++++++++++++++++++++++++++++----- debian/vzlogger.postinst | 4 +++- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/debian/copyright b/debian/copyright index 9b3caab4..e0c2762d 100644 --- a/debian/copyright +++ b/debian/copyright @@ -8,15 +8,19 @@ Copyright: Copyright 2011 Steffen Vogel Copyright (c) 2011, DAI-Labor, TU-Berlin Copyright 2011 Fraunhofer ITWM Copyright (c) 2015, 2018 Matthias Behr - Copyright (c) 2011 - 2023, The volkszaehler.org project -License: GPL-3 + Copyright (c) 2011 - 2024, The volkszaehler.org project +License: GPL-3.0-or-later + +Files: modules/GetGitRevisionDescription.cmake* +Copyright: Copyright Iowa State University 2009-2010. +License: BSL-1.0 Files: debian/* Copyright: Copyright 2011 Steffen Vogel - Copyright 2023 Joachim Zobel -License: GPL-3 + Copyright 2023 - 2024 Joachim Zobel +License: GPL-3.0-or-later -License: GPL-3 +License: GPL-3.0-or-later This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or @@ -34,3 +38,29 @@ License: GPL-3 License version 3 can be found in the file `/usr/share/common-licenses/GPL-3'. +License: + Boost Software License - Version 1.0 - August 17th, 2003 + . + Permission is hereby granted, free of charge, to any person or organization + obtaining a copy of the software and accompanying documentation covered by + this license (the "Software") to use, reproduce, display, distribute, + execute, and transmit the Software, and to prepare derivative works of the + Software, and to permit third-parties to whom the Software is furnished to + do so, all subject to the following: + . + The copyright notices in the Software and this entire statement, including + the above license grant, this restriction and the following disclaimer, + must be included in all copies of the Software, in whole or in part, and + all derivative works of the Software, unless such copies or derivative + works are solely in the form of machine-executable object code generated by + a source language processor. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT + SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE + FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + diff --git a/debian/vzlogger.postinst b/debian/vzlogger.postinst index cbed30d7..c0c5c04e 100755 --- a/debian/vzlogger.postinst +++ b/debian/vzlogger.postinst @@ -4,7 +4,9 @@ set -e case "$1" in configure) - if id vzlogger > /dev/null 2>&1 ; then + if id vzlogger > /dev/null 2>&1 \ + && dpkg --compare-versions $2 le-nl 0.8.3 \ + && dpkg --compare-versions $2 ge 0.8.2; then # maintain compatibility with existing native installations usermod -l _vzlogger vzlogger groupmod --new-name _vzlogger vzlogger From 02bfe8382375a4a652f8dc9378a237d821506919 Mon Sep 17 00:00:00 2001 From: Jo Date: Tue, 12 Mar 2024 13:54:32 +0100 Subject: [PATCH 04/19] Fixed stupid mistake in debian/copyright --- debian/copyright | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/copyright b/debian/copyright index e0c2762d..23182ddd 100644 --- a/debian/copyright +++ b/debian/copyright @@ -38,7 +38,7 @@ License: GPL-3.0-or-later License version 3 can be found in the file `/usr/share/common-licenses/GPL-3'. -License: +License: BSL-1.0 Boost Software License - Version 1.0 - August 17th, 2003 . Permission is hereby granted, free of charge, to any person or organization From c03f9b704106e4ce2d6e7a5ff4aa0efcff73288e Mon Sep 17 00:00:00 2001 From: Joachim Zobel Date: Sat, 16 Mar 2024 13:52:30 +0100 Subject: [PATCH 05/19] Fixed stupid postinst bug (#638) --- debian/vzlogger.postinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/vzlogger.postinst b/debian/vzlogger.postinst index c0c5c04e..40ee766a 100755 --- a/debian/vzlogger.postinst +++ b/debian/vzlogger.postinst @@ -5,8 +5,8 @@ set -e case "$1" in configure) if id vzlogger > /dev/null 2>&1 \ - && dpkg --compare-versions $2 le-nl 0.8.3 \ - && dpkg --compare-versions $2 ge 0.8.2; then + && dpkg --compare-versions "$2" le-nl 0.8.3 \ + && dpkg --compare-versions "$2" ge 0.8.2; then # maintain compatibility with existing native installations usermod -l _vzlogger vzlogger groupmod --new-name _vzlogger vzlogger From 7cea3939bf88fba20051c84d0bc121805af021d2 Mon Sep 17 00:00:00 2001 From: Jo Date: Sat, 30 Mar 2024 06:34:15 +0100 Subject: [PATCH 06/19] Applied libsml changes adding Raspian build --- .github/workflows/debuild.yml | 51 +++++++++++++++++++++++++---------- README.md | 18 ++++++++----- debian/changelog | 8 ++++++ 3 files changed, 57 insertions(+), 20 deletions(-) diff --git a/.github/workflows/debuild.yml b/.github/workflows/debuild.yml index f401736c..a3d99e09 100644 --- a/.github/workflows/debuild.yml +++ b/.github/workflows/debuild.yml @@ -14,7 +14,7 @@ env: KEYSERVER: keyserver.ubuntu.com # Cloudsmith package repository KEYFILE: /usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg - CLOUDURL: https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb/debian + CLOUDURL: https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb CLOUD_KEY_ID: 21DBDAC56DF44DA1 REPO: volkszaehler/volkszaehler-org-project @@ -29,7 +29,7 @@ jobs: run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: add cloudsmith repo run: | - LISTENTRY="deb [signed-by=$KEYFILE] $CLOUDURL trixie main" + LISTENTRY="deb [signed-by=$KEYFILE] $CLOUDURL/debian trixie main" echo "$LISTENTRY" | sudo tee -a /etc/apt/sources.list gpg --keyserver $KEYSERVER --recv-key $CLOUD_KEY_ID sudo -E gpg -v --output "$KEYFILE" --export $CLOUD_KEY_ID @@ -85,19 +85,41 @@ jobs: needs: debuild strategy: matrix: - architecture: [armel, armhf, arm64, amd64] + os: [debian, raspbian] distribution: [trixie, bookworm, bullseye] - runs-on: ubuntu-latest + architecture: [armhf, arm64, amd64] + exclude: + - os: raspbian + architecture: arm64 + - os: raspbian + architecture: amd64 + - os: raspbian + distribution: trixie + include: + - mirrorsite: http://ftp2.de.debian.org/debian/ + - mirrorsite: http://mirror.netcologne.de/raspbian/raspbian/ + os: raspbian + - keyring: debian-archive-keyring + - keyring: raspbian-archive-keyring + os: raspbian + runs-on: ubuntu-latest environment: main env: PBRT: /var/cache/pbuilder steps: - name: update repo information run: sudo apt-get update + - name: install archive keyring + run: | + if [[ ${{ matrix.os }} == raspbian ]]; then + wget http://raspbian.raspberrypi.org/raspbian/pool/main/r/raspbian-archive-keyring/raspbian-archive-keyring_20120528.2_all.deb + sudo apt-get install ./raspbian-archive-keyring_20120528.2_all.deb + else + sudo apt-get install debian-archive-keyring + fi - name: install pbuilder run: | - sudo apt-get install pbuilder qemu-user-static \ - debian-archive-keyring hub + sudo apt-get install pbuilder mmdebstrap qemu-user-static pipx hub # Needed for the release download - uses: actions/checkout@v4 - name: Set env @@ -110,18 +132,18 @@ jobs: ls -l - name: configure pbuilder run: | - echo "MIRRORSITE=http://ftp2.de.debian.org/debian/ + echo "MIRRORSITE=${{ matrix.mirrorsite }} HOOKDIR=$PBRT/hooks" | \ sudo tee /root/.pbuilderrc sudo mkdir -p $PBRT/hooks echo "#!/bin/sh - apt-get -y install gnupg debian-archive-keyring ca-certificates + apt-get -y install gnupg ${{ matrix.keyring }} ca-certificates apt-key adv --keyserver $KEYSERVER --recv-keys $SIGNING_KEY_ID" | \ sudo tee $PBRT/hooks/G70Keys sudo chmod a+x $PBRT/hooks/G70Keys # OTHERMIRRORS can't do signed-by echo "#!/bin/sh - LISTENTRY=\"deb [signed-by=$KEYFILE] $CLOUDURL ${{ matrix.distribution }} main\" + LISTENTRY=\"deb [signed-by=$KEYFILE] $CLOUDURL/${{ matrix.os }} ${{ matrix.distribution }} main\" gpg --keyserver $KEYSERVER --recv-key $CLOUD_KEY_ID gpg -v --output '$KEYFILE' --export $CLOUD_KEY_ID echo \"\$LISTENTRY\" >> /etc/apt/sources.list @@ -136,10 +158,11 @@ jobs: run: | sudo pbuilder create --architecture ${{ matrix.architecture }} \ --distribution ${{ matrix.distribution }} \ - --debootstrap qemu-debootstrap \ --basetgz $PBRT/current.tgz \ - --debootstrapopts --keyring=/usr/share/keyrings/debian-archive-keyring.gpg - - name: pbuild ${{ matrix.architecture }} ${{ matrix.distribution }} + --debootstrap mmdebstrap \ + --debootstrapopts \ + --keyring=/usr/share/keyrings/${{ matrix.keyring }}.gpg + - name: pbuild ${{ matrix.os }} ${{ matrix.architecture }} ${{ matrix.distribution }} # https://stackoverflow.com/questions/70435286/resource-not-accessible-by-integration-on-github-post-repos-owner-repo-ac run: | VERSION="${GITHUB_REF##*/v}" @@ -166,7 +189,7 @@ jobs: CHANGES_FILE="$PBRT/result/${PKG}_${VERSION}_${{ matrix.architecture }}.changes" for DEB in $(dcmd --deb $CHANGES_FILE); do cloudsmith push deb \ - ${REPO}/debian/${{ matrix.distribution }} "$DEB" - done + ${REPO}/${{ matrix.os }}/${{ matrix.distribution }} "$DEB" + done env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} diff --git a/README.md b/README.md index 4afd1a4d..0dcd8e46 100644 --- a/README.md +++ b/README.md @@ -43,15 +43,19 @@ You can start it: where /home/pi/projects/vzlogger-docker is the path to the directory containing the vzlogger.conf file and /dev/serial/by-id/usb-FTDI_FT230X_Basic_UART_D30A8U6N-if00-port0 is your device. You can pass several devices if you have them. -Debian Packages +Debian and Raspbian Packages ------------- [![Hosted By: Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith&style=flat-square)](https://cloudsmith.com) -We now build debian packages for amd64, armhf and arm64 as part of our releases. -The ones attached to the release are meant for trixie. These and packages for -bookworm and bullseye are also provided through a repository graciously provided by -[Cloudsmith](https://cloudsmith.com). +We now build Debian packages for amd64, armhf and arm64 and Raspbian packages +for armhf as part of our releases. Unfortunately Debian armhf packages do not +run on Raspberry Pi 1 although the architecture on the RPi is named armhf. +Using Raspian armhf packages fixes that. + +The ones attached to the release are meant for debian trixie. These and +packages for bookworm and bullseye are also provided through a repository +graciously provided by [Cloudsmith](https://cloudsmith.com). Those debian packages are built with MQTT support. @@ -62,7 +66,9 @@ This boils down to adding a file to /etc/apt/sources.list.d/ containing deb [signed-by=/usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg] https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb/debian bookworm main deb-src [signed-by=/usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg] https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb/debian bookworm main ``` -(replace bookworm with your current distro) and retrieving the key as a trusted one +You need to replace bookworm with your distro and debian with raspbian in case +you are using an RPi 1. You also need to retrieve our repository key as a +trusted one. ``` curl -1sLf "https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/gpg.21DBDAC56DF44DA1.key" | \ gpg --dearmor > /usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg diff --git a/debian/changelog b/debian/changelog index e661b387..83aa5ba4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +vzlogger (0.8.4) unstable; urgency=medium + + * Added build for Raspbian. + * Removed armel architecture. + * Renamed service user to _vzlogger + + -- Joachim Zobel Sat, 30 Mar 2024 06:24:25 +0100 + vzlogger (0.8.3) unstable; urgency=medium * Added armel as release architecture From ec723ec71174566e93c92d6ab79bc9abfba44e6e Mon Sep 17 00:00:00 2001 From: Jo Date: Sat, 30 Mar 2024 07:01:46 +0100 Subject: [PATCH 07/19] Fixed indentiation --- .github/workflows/debuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/debuild.yml b/.github/workflows/debuild.yml index a3d99e09..1766745c 100644 --- a/.github/workflows/debuild.yml +++ b/.github/workflows/debuild.yml @@ -102,7 +102,7 @@ jobs: - keyring: debian-archive-keyring - keyring: raspbian-archive-keyring os: raspbian - runs-on: ubuntu-latest + runs-on: ubuntu-latest environment: main env: PBRT: /var/cache/pbuilder From a56f6281fce06489bc057b9dcd697d22d79142d1 Mon Sep 17 00:00:00 2001 From: Jo Date: Tue, 2 Apr 2024 06:34:42 +0200 Subject: [PATCH 08/19] Fixed mmdebstrap build error --- .github/workflows/debuild.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/debuild.yml b/.github/workflows/debuild.yml index 1766745c..dce825ca 100644 --- a/.github/workflows/debuild.yml +++ b/.github/workflows/debuild.yml @@ -137,6 +137,7 @@ jobs: sudo tee /root/.pbuilderrc sudo mkdir -p $PBRT/hooks echo "#!/bin/sh + apt-get update apt-get -y install gnupg ${{ matrix.keyring }} ca-certificates apt-key adv --keyserver $KEYSERVER --recv-keys $SIGNING_KEY_ID" | \ sudo tee $PBRT/hooks/G70Keys From 5deb3ba56b69db22ca6a67c7b58e3246f0d3dcfb Mon Sep 17 00:00:00 2001 From: Jo Date: Sun, 21 Apr 2024 07:08:17 +0200 Subject: [PATCH 09/19] Fixed missing user name rename in logrotate configuration --- debian/changelog | 6 ++++++ etc/logrotate.d/vzlogger | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 83aa5ba4..33b8731f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +vzlogger (0.8.5) unstable; urgency=medium + + * Fixed missing user name rename in logrotate configuration. + + -- Joachim Zobel Sun, 21 Apr 2024 07:03:21 +0200 + vzlogger (0.8.4) unstable; urgency=medium * Added build for Raspbian. diff --git a/etc/logrotate.d/vzlogger b/etc/logrotate.d/vzlogger index 611666b7..2b369587 100644 --- a/etc/logrotate.d/vzlogger +++ b/etc/logrotate.d/vzlogger @@ -4,5 +4,5 @@ copytruncate missingok notifempty - create 0664 vzlogger root + create 0664 _vzlogger root } From 1b74ff6fef02f0920d396f248805fff92fe8854e Mon Sep 17 00:00:00 2001 From: Jo Date: Sun, 21 Apr 2024 18:11:35 +0200 Subject: [PATCH 10/19] Added forgottten cmake version bump to 0.8.5 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5deb13c6..788c55c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ ENDIF() set(VZLOGGER_MAJOR_VERSION 0) set(VZLOGGER_MINOR_VERSION 8) -set(VZLOGGER_SUB_VERSION 3) +set(VZLOGGER_SUB_VERSION 5) set(VERSION_SEP "-") set(VZLOGGER_SHORT_VERSION "${VZLOGGER_MAJOR_VERSION}${VERSION_SEP}${VZLOGGER_MINOR_VERSION}") set(VZLOGGER_VERSION "${VZLOGGER_SHORT_VERSION}${VERSION_SEP}${VZLOGGER_SUB_VERSION}") From dbbdd911c3c8a2f703afd8660af1f42fc2374bf6 Mon Sep 17 00:00:00 2001 From: Jo Date: Mon, 22 Apr 2024 06:05:53 +0200 Subject: [PATCH 11/19] Fixed passing of Debian hardening flags to gcc --- debian/rules | 3 +++ modules/CompilerFlags.cmake | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 21627923..f2f2c8d0 100755 --- a/debian/rules +++ b/debian/rules @@ -9,6 +9,9 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + VERSION=$(shell dpkg-parsechangelog --show-field Version 2>/dev/null | cut -f1 -d-) VERSION1=$(shell echo ${VERSION} | cut -f1 -d.) VERSION2=$(shell echo ${VERSION} | cut -f2 -d.) diff --git a/modules/CompilerFlags.cmake b/modules/CompilerFlags.cmake index e88e5a85..eaaae121 100644 --- a/modules/CompilerFlags.cmake +++ b/modules/CompilerFlags.cmake @@ -8,7 +8,7 @@ if(NOT WIN32) message(STATUS "using gcc compiler ${CMAKE_CXX_COMPILER_ID}") include (CheckCXXSourceCompiles) - set(CMAKE_CXX_FLAGS "${CXXFLAGS} -W -Wall -Wextra -Werror -Wnon-virtual-dtor -Wno-system-headers") + set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -W -Wall -Wextra -Werror -Wnon-virtual-dtor -Wno-system-headers") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Winit-self -Wmissing-include-dirs -Wno-pragmas -Wredundant-decls") From 6e71155b58451363f7153be9b3308591a7942f46 Mon Sep 17 00:00:00 2001 From: r00t Date: Thu, 4 Apr 2024 01:19:42 +0200 Subject: [PATCH 12/19] [cmake] print warning if oms not enabled --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 788c55c5..240cdde9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -289,6 +289,10 @@ if( ENABLE_LOCAL AND NOT MICROHTTPD_FOUND ) Install microhttpd or call cmake -DMICROHTTPD_HOME=path_to_microhttpd_install") endif( ENABLE_LOCAL AND NOT MICROHTTPD_FOUND ) +if( ENABLE_OMS AND NOT OMS_SUPPORT) + message(WARNING "oms support not being enabled (libmbus not found)") +endif( ENABLE_OMS AND NOT OMS_SUPPORT) + # add clean-all target that removes the cached files from cmake as well (see e.g. issue #186) add_custom_target(clean-all COMMAND ${CMAKE_BUILD_TOOL} clean From bc864bd19539855dcc984cf6cd53c93c549c41c5 Mon Sep 17 00:00:00 2001 From: Jo Date: Fri, 3 May 2024 19:37:58 +0200 Subject: [PATCH 13/19] Moved vzlogger.8 to debian/clean --- debian/clean | 1 + debian/rules | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) create mode 100644 debian/clean diff --git a/debian/clean b/debian/clean new file mode 100644 index 00000000..8e2cd876 --- /dev/null +++ b/debian/clean @@ -0,0 +1 @@ +vzlogger.8 diff --git a/debian/rules b/debian/rules index f2f2c8d0..ba497b0f 100755 --- a/debian/rules +++ b/debian/rules @@ -38,8 +38,5 @@ endif execute_after_dh_auto_build: pandoc -o vzlogger.8 -s -t man debian/vzlogger.8.md -execute_after_dh_clean: - rm -f vzlogger.8 - %: dh $@ From 7d313f7626174b1d97d5499166dfc8d8e21ce02d Mon Sep 17 00:00:00 2001 From: Jo Date: Sun, 5 May 2024 16:47:31 +0200 Subject: [PATCH 14/19] Fixed linitian info messages debian-rules-parses-dpkg-parsechangelog, systemd-service-file-missing-documentation-key, multiple trailing-whitespace, systemd-service-file-missing-hardening-features, systemd-service-file-missing-hardening-features --- debian/changelog | 18 +++++++++--------- debian/control | 2 +- debian/rules | 11 ++++++----- debian/vzlogger.service | 2 ++ 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 33b8731f..bb149f99 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ vzlogger (0.8.5) unstable; urgency=medium - * Fixed missing user name rename in logrotate configuration. + * Fixed missing user name rename in logrotate configuration. -- Joachim Zobel Sun, 21 Apr 2024 07:03:21 +0200 @@ -8,24 +8,24 @@ vzlogger (0.8.4) unstable; urgency=medium * Added build for Raspbian. * Removed armel architecture. - * Renamed service user to _vzlogger + * Renamed service user to _vzlogger -- Joachim Zobel Sat, 30 Mar 2024 06:24:25 +0100 vzlogger (0.8.3) unstable; urgency=medium - * Added armel as release architecture + * Added armel as release architecture -- Joachim Zobel Tue, 31 Oct 2023 15:38:49 +0100 vzlogger (0.8.2) unstable; urgency=medium - * Fixed service running as root + * Fixed service running as root -- Joachim Zobel Tue, 23 May 2023 06:18:00 +0200 vzlogger (0.8.1) unstable; urgency=low - + * Latest version -- Joachim Zobel Sat, 21 Jan 2023 19:52:01 +0100 @@ -37,21 +37,21 @@ vzlogger (0.3.5) stable; urgency=low -- Justin Otherguy (signing key for debian packages only) Tue, 08 Oct 2013 21:28:01 +0200 vzlogger (0.3.4-rc1) stable; urgency=low - + * updated version to reflect changes in CMakeLists.txt -- Justin Otherguy (signing key for debian packages only) Wed, 15 Apr 2013 23:19:01 +0200 vzlogger (0.3.3-rc3) stable; urgency=low - + * removed a warning in vzlogger.postinst (thx to RG) -- Justin Otherguy (signing key for debian packages only) Wed, 14 Apr 2013 23:45:01 +0200 vzlogger (0.3.3-rc2) stable; urgency=low - + * minor clean-up in default config - + -- Justin Otherguy (signing key for debian packages only) Wed, 10 Apr 2013 23:45:01 +0200 vzlogger (0.3.3-rc1) stable; urgency=low diff --git a/debian/control b/debian/control index 1d4d6434..a9e1bff6 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ Build-Depends: debhelper (>= 12), libgcrypt-dev, libgnutls28-dev, uuid-dev, - libunistring-dev, + libunistring-dev, libgmock-dev, libgtest-dev, pandoc, diff --git a/debian/rules b/debian/rules index ba497b0f..82f9c638 100755 --- a/debian/rules +++ b/debian/rules @@ -9,13 +9,14 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk +include /usr/share/dpkg/pkg-info.mk -VERSION=$(shell dpkg-parsechangelog --show-field Version 2>/dev/null | cut -f1 -d-) -VERSION1=$(shell echo ${VERSION} | cut -f1 -d.) -VERSION2=$(shell echo ${VERSION} | cut -f2 -d.) -VERSION3=$(shell echo ${VERSION} | cut -f3 -d.) +VERSION1=$(shell echo ${DEB_VERSION_UPSTREAM} | cut -f1 -d.) +VERSION2=$(shell echo ${DEB_VERSION_UPSTREAM} | cut -f2 -d.) +VERSION3=$(shell echo ${DEB_VERSION_UPSTREAM} | cut -f3 -d.) execute_before_dh_auto_configure: sed -i "s#set(VZLOGGER_MAJOR_VERSION.*)#set(VZLOGGER_MAJOR_VERSION ${VERSION1})#" CMakeLists.txt @@ -39,4 +40,4 @@ execute_after_dh_auto_build: pandoc -o vzlogger.8 -s -t man debian/vzlogger.8.md %: - dh $@ + dh $@ diff --git a/debian/vzlogger.service b/debian/vzlogger.service index 11ddb828..af96a2f7 100644 --- a/debian/vzlogger.service +++ b/debian/vzlogger.service @@ -1,5 +1,6 @@ [Unit] Description=vzlogger +Documentation=man:vzlogger(8) After=network.target ntp.service [Service] @@ -8,6 +9,7 @@ User=_vzlogger Group=_vzlogger ExecReload= StandardOutput=null +PrivateTmp=yes [Install] WantedBy=multi-user.target From b4e30ce39c75ec9a601c6c2a3ea1678edceedd26 Mon Sep 17 00:00:00 2001 From: Jo Date: Sat, 4 May 2024 14:49:55 +0200 Subject: [PATCH 15/19] Improved Debian/Raspbian section in README --- README.md | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0dcd8e46..7a2cbb2e 100644 --- a/README.md +++ b/README.md @@ -43,25 +43,39 @@ You can start it: where /home/pi/projects/vzlogger-docker is the path to the directory containing the vzlogger.conf file and /dev/serial/by-id/usb-FTDI_FT230X_Basic_UART_D30A8U6N-if00-port0 is your device. You can pass several devices if you have them. -Debian and Raspbian Packages +Debian and Raspberry Pi OS Packages ------------- [![Hosted By: Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith&style=flat-square)](https://cloudsmith.com) -We now build Debian packages for amd64, armhf and arm64 and Raspbian packages -for armhf as part of our releases. Unfortunately Debian armhf packages do not -run on Raspberry Pi 1 although the architecture on the RPi is named armhf. -Using Raspian armhf packages fixes that. +We now build Debian packages for amd64, armhf and arm64. Armel, which would be +needed for Debian on RPi 1 hardware, is not supported. -The ones attached to the release are meant for debian trixie. These and -packages for bookworm and bullseye are also provided through a repository -graciously provided by [Cloudsmith](https://cloudsmith.com). +[Raspberry Pi OS packages for armhf]( +https://cloudsmith.io/~volkszaehler/repos/volkszaehler-org-project/packages/?q=distribution%3Araspbian+AND+architecture%3Aarmhf) +are also part of our releases. Unfortunately +Debian armhf packages do not run on Raspberry Pi 1 although the architecture +has been named armhf in Raspbian. Using "Raspbian armhf" packages fixes that. +For RPi 2 and above Debian packages run on Raspberry Pi OS. -Those debian packages are built with MQTT support. +Our packages are built with MQTT support, but without OMS support. + +The packages attached to the release are meant for Debian trixie. The full set +of packages is provided through a repository graciously provided by +[Cloudsmith](https://cloudsmith.com). The setup of the repository is also [explained by Cloudsmith](https://cloudsmith.io/~volkszaehler/repos/volkszaehler-org-project/setup/#formats-deb). -This boils down to adding a file to /etc/apt/sources.list.d/ containing +The easy way to do it is running +``` +curl -1sLf \ + 'https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/setup.deb.sh' \ + | sudo -E bash +``` +If you do it the easy way you should however be aware of the high amount of +trust you put into cloudsmith not beeing compromised. As an alternative there +is the manual way to achive the same result. That starts with adding a file to +/etc/apt/sources.list.d/ containing ``` deb [signed-by=/usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg] https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb/debian bookworm main deb-src [signed-by=/usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg] https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb/debian bookworm main @@ -74,6 +88,15 @@ curl -1sLf "https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-projec gpg --dearmor > /usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg ``` +After that you can do the usual +``` +apt update +apt install vzlogger +``` + +An official Debian vzlogger package is currently in unstable. + + Mailing List ------------- If you have questions, contact the volkszaehler mailing lists: From 1c531157f6912a95f26c0e2c504a3cc79ada2d13 Mon Sep 17 00:00:00 2001 From: Jo Date: Wed, 15 May 2024 05:51:46 +0200 Subject: [PATCH 16/19] Fixed watch file --- debian/watch | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/debian/watch b/debian/watch index a8cbb2d3..1c32a89c 100644 --- a/debian/watch +++ b/debian/watch @@ -1,4 +1,2 @@ version=4 -opts=filenamemangle=s/.+\/v?([\.\d]+)\.tar\.gz/vzlogger-$1\.tar\.gz/,\ -downloadurlmangle=s/archive\/refs\/tags\/v([\.\d]+)\.tar\.gz/releases\/download\/v$1\/vzlogger-$1\.tar\.gz/ \ - https://github.com/volkszaehler/vzlogger/tags .*/v?([\.\d]+)\.tar\.gz +https://github.com/volkszaehler/vzlogger/tags .*/v?(\d.*)@ARCHIVE_EXT@ From 70e41e96ec5560891298ad9e7ce8eec1f9ecb62d Mon Sep 17 00:00:00 2001 From: Jo Date: Thu, 16 May 2024 21:34:38 +0200 Subject: [PATCH 17/19] Removed README.md from binary package --- debian/vzlogger.docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/vzlogger.docs b/debian/vzlogger.docs index af17a53d..18fca2b0 100644 --- a/debian/vzlogger.docs +++ b/debian/vzlogger.docs @@ -1 +1 @@ -README*.md +README.*.md From cb53b59ed61ecfb832e338827bf9bb54ea324d48 Mon Sep 17 00:00:00 2001 From: Jo Date: Thu, 16 May 2024 21:38:12 +0200 Subject: [PATCH 18/19] Bumped version to 0.8.6 --- CMakeLists.txt | 2 +- debian/changelog | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 240cdde9..89ef0ddd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ ENDIF() set(VZLOGGER_MAJOR_VERSION 0) set(VZLOGGER_MINOR_VERSION 8) -set(VZLOGGER_SUB_VERSION 5) +set(VZLOGGER_SUB_VERSION 6) set(VERSION_SEP "-") set(VZLOGGER_SHORT_VERSION "${VZLOGGER_MAJOR_VERSION}${VERSION_SEP}${VZLOGGER_MINOR_VERSION}") set(VZLOGGER_VERSION "${VZLOGGER_SHORT_VERSION}${VERSION_SEP}${VZLOGGER_SUB_VERSION}") diff --git a/debian/changelog b/debian/changelog index bb149f99..e758033e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +vzlogger (0.8.6) unstable; urgency=medium + + * Release as base for an official Debian release + + -- Joachim Zobel Thu, 16 May 2024 21:35:26 +0200 + vzlogger (0.8.5) unstable; urgency=medium * Fixed missing user name rename in logrotate configuration. From 787c40bec37d6c3b8aabf52cb5758faad5a0f108 Mon Sep 17 00:00:00 2001 From: Jo Date: Sat, 18 May 2024 14:26:08 +0200 Subject: [PATCH 19/19] Fixed lto warnings for google test --- debian/rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/rules b/debian/rules index 82f9c638..11114bd7 100755 --- a/debian/rules +++ b/debian/rules @@ -13,6 +13,9 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/pkg-info.mk +# Debian flags invented usage of LTO, which in combination with google test on +# Ubuntu 22.04.4 causes the errors supressed below +export CXXFLAGS += -Wno-lto-type-mismatch -Wno-odr VERSION1=$(shell echo ${DEB_VERSION_UPSTREAM} | cut -f1 -d.) VERSION2=$(shell echo ${DEB_VERSION_UPSTREAM} | cut -f2 -d.)