diff --git a/.gitignore b/.gitignore index 2143a2b..ab265ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,30 @@ /wmbusmeters-0.9.27.tar.gz +/wmbusmeters-0.9.28.tar.gz +/wmbusmeters-0.9.29.tar.gz +/wmbusmeters-0.9.30.tar.gz +/wmbusmeters-0.9.31.tar.gz +/wmbusmeters-0.9.32.tar.gz +/wmbusmeters-0.9.35.tar.gz +/wmbusmeters-0.9.36.tar.gz +/wmbusmeters-1.0.4.tar.gz +/wmbusmeters-1.1.0.tar.gz +/wmbusmeters-1.3.0.tar.gz +/wmbusmeters-1.4.0.tar.gz +/wmbusmeters-8dd3e87c44ecb2e3fc46f7bc6df9ea6195c8b988.tar.gz +/wmbusmeters-1.4.1.tar.gz +/wmbusmeters-1.5.0.tar.gz +/wmbusmeters-1.6.0.tar.gz +/wmbusmeters-1.8.0.tar.gz +/wmbusmeters-1.9.0.tar.gz +/wmbusmeters-1.10.1.tar.gz +/wmbusmeters-1.11.0.tar.gz +/wmbusmeters-1.12.0.tar.gz +/wmbusmeters-1.13.0.tar.gz +/wmbusmeters-1.14.0.tar.gz +/wmbusmeters-1.16.1.tar.gz +/wmbusmeters-1.17.1.tar.gz +/wmbusmeters-1.18.0.tar.gz +/wmbusmeters-1.19.0.tar.gz +/wmbusmeters-1.20.0.tar.gz +/wmbusmeters-2.0.0.tar.gz +/wmbusmeters-3.0.0.tar.gz diff --git a/sources b/sources index 8a70424..532e775 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (wmbusmeters-0.9.27.tar.gz) = 4c5845805c0ba3fefdc65c8aec8ca2433a9722c6e9d82b7bfad5e717309d4066a77402b3ada4242ec774edd25f11f348843c56c05737dac0bcea6d125c067eee +SHA512 (wmbusmeters-3.0.0.tar.gz) = 5ba9eaa132c5bfe23faa901d481af1ff84b9ce222434b489dfe205d6532370818606d461d1d51ede1fc58423086a54690151a51adc4eb0db74d5156a91d7d9e1 diff --git a/wmbusmeters-Fix-accessing-empty-string.patch b/wmbusmeters-Fix-accessing-empty-string.patch deleted file mode 100644 index fa6caf6..0000000 --- a/wmbusmeters-Fix-accessing-empty-string.patch +++ /dev/null @@ -1,45 +0,0 @@ -From d840804b31a632cf1e984d949897836a5395b031 Mon Sep 17 00:00:00 2001 -From: Damian Wrobel -Date: Mon, 2 Mar 2020 10:07:04 +0100 -Subject: [PATCH] Fix accessing empty string - -Fixes the following crash: - (gdb) bt - #0 0x00005555555738d0 in abort@plt () - #1 0x0000555555589888 in std::__replacement_assert (__file=, __line=, __function=, __condition=) at /usr/include/c++/9/x86_64-redhat-linux/bits/c++config.h:2533 - #2 0x00005555555d1e37 in std::__cxx11::basic_string, std::allocator >::front (this=0x7ffff7a226d0) at /usr/include/c++/9/bits/basic_string.h:1123 - #3 0x00005555555ce8c5 in doesIdMatchExpression (id=..., match=...) at src/util.cc:513 - #4 0x00005555555cea92 in doesIdMatchExpressions (id=..., mes=...) at src/util.cc:560 - #5 0x000055555558aa56 in MeterCommonImplementation::isTelegramForMe (this=0x555555661c28, t=0x7ffff7a227b0) at src/meters.cc:188 - #6 0x000055555558c0e0 in MeterCommonImplementation::handleTelegram (this=0x555555661c28, input_frame=...) at src/meters.cc:289 - #7 0x000055555558c87a in MeterCommonImplementation:: >)>::operator() (__closure=, input_frame=...) at /usr/include/c++/9/bits/stl_algobase.h:465 - #8 std::_Function_handler >), MeterCommonImplementation::MeterCommonImplementation(WMBus*, MeterInfo&, MeterType, int):: >)> >::_M_invoke(const std::_Any_data &, std::vector > &&) (__functor=..., __args#0=...) at /usr/include/c++/9/bits/std_function.h:285 - #9 0x00005555555da01f in std::function >)>::operator()(std::vector >) const (__args#0=..., this=0x7ffff7a22c70) at /usr/include/c++/9/bits/std_function.h:685 - #10 WMBusCommonImplementation::handleTelegram (this=this@entry=0x555555661b40, frame=...) at src/wmbus.cc:3328 - #11 0x00005555555fbf7b in WMBusRTLWMBUS::processSerialData (this=0x555555661ad0) at /usr/include/c++/9/bits/stl_algobase.h:465 - #12 0x00005555555cb001 in std::function::operator()() const (this=) at /usr/include/c++/9/bits/std_function.h:685 - #13 SerialCommunicationManagerImp::eventLoop (this=0x5555556617c0) at src/serial.cc:795 - #14 0x00007ffff7f554e2 in ?? () - #15 0x0000000000000000 in ?? () - -Signed-off-by: Damian Wrobel ---- - src/util.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/util.cc b/src/util.cc -index bcacb16..22f7b31 100644 ---- a/src/util.cc -+++ b/src/util.cc -@@ -510,7 +510,7 @@ bool doesIdMatchExpression(string id, string match) - } - - bool wildcard_used = false; -- if (match.front() == '*') -+ if (match.length() && match.front() == '*') - { - wildcard_used = true; - match.erase(0,1); --- -2.24.1 - diff --git a/wmbusmeters-Fix-compilation-error-on-gcc-10.x.patch b/wmbusmeters-Fix-compilation-error-on-gcc-10.x.patch deleted file mode 100644 index a9bd2a2..0000000 --- a/wmbusmeters-Fix-compilation-error-on-gcc-10.x.patch +++ /dev/null @@ -1,66 +0,0 @@ -From a8562de6c0a5d80332a83b92f88b48688beabd39 Mon Sep 17 00:00:00 2001 -From: Damian Wrobel -Date: Fri, 28 Feb 2020 18:20:22 +0100 -Subject: [PATCH] Fix compilation error on gcc 10.x -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes the following compilation error: - - In file included from src/config.h:21, - from src/cmdline.h:21, - from src/cmdline.cc:18: - src/units.h:42:11: error: extended character ° is not valid in an identifier - 42 | X(C,c,°C,Temperature,"celsius") \ - | ^ - src/units.h:43:11: error: extended character ° is not valid in an identifier - 43 | X(F,f,°F,Temperature,"fahrenheit") \ - | ^ - make: *** [Makefile:93: build/cmdline.o] Error 1 - -Signed-off-by: Damian Wrobel ---- - src/units.h | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -diff --git a/src/units.h b/src/units.h -index a1c0384..ac0c7ce 100644 ---- a/src/units.h -+++ b/src/units.h -@@ -33,19 +33,19 @@ - X(Time,Hour) \ - - #define LIST_OF_UNITS \ -- X(KWH,kwh,kWh,Energy,"kilo Watt hour") \ -- X(GJ,gj,GJ,Energy,"Giga Joule") \ -- X(M3,m3,m3,Volume,"cubic meter") \ -- X(L,l,l,Volume,"litre") \ -- X(KW,kw,kW,Power,"kilo Watt") \ -- X(M3H,m3h,m3/h,Flow,"cubic meters per hour") \ -- X(C,c,°C,Temperature,"celsius") \ -- X(F,f,°F,Temperature,"fahrenheit") \ -- X(RH,rh,RH,RelativeHumidity,"relative humidity") \ -- X(HCA,hca,hca,HCA,"heat cost allocation") \ -- X(TXT,txt,txt,Text,"text") \ -- X(Second,s,s,Time,"second") \ -- X(Hour,h,h,Time,"hour") -+ X(KWH,kwh,"kWh",Energy,"kilo Watt hour") \ -+ X(GJ,gj,"GJ",Energy,"Giga Joule") \ -+ X(M3,m3,"m3",Volume,"cubic meter") \ -+ X(L,l,"l",Volume,"litre") \ -+ X(KW,kw,"kW",Power,"kilo Watt") \ -+ X(M3H,m3h,"m3/h",Flow,"cubic meters per hour") \ -+ X(C,c,"°C",Temperature,"celsius") \ -+ X(F,f,"°F",Temperature,"fahrenheit") \ -+ X(RH,rh,"RH",RelativeHumidity,"relative humidity") \ -+ X(HCA,hca,"hca",HCA,"heat cost allocation") \ -+ X(TXT,txt,"txt",Text,"text") \ -+ X(Second,s,"s",Time,"second") \ -+ X(Hour,h,"h",Time,"hour") - - enum class Unit - { --- -2.24.1 - diff --git a/wmbusmeters-Fix-compilation-error-on-gcc-12.patch b/wmbusmeters-Fix-compilation-error-on-gcc-12.patch new file mode 100644 index 0000000..f53a31c --- /dev/null +++ b/wmbusmeters-Fix-compilation-error-on-gcc-12.patch @@ -0,0 +1,31 @@ +From e74ab687e5d424dfbb498373dd7e086f098ac203 Mon Sep 17 00:00:00 2001 +From: Damian Wrobel +Date: Mon, 25 Jul 2022 18:17:02 +0200 +Subject: [PATCH] Fix compilation error on gcc 12 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes the following error: + src/util.cc: In function ‘bool enableLogfile(std::string, bool)’: + src/util.cc:379:22: error: ‘time’ was not declared in this scope; did you mean ‘utimes’? + 379 | time_t now = time(NULL); + | ^~~~ + +Signed-off-by: Damian Wrobel +--- + src/util.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/util.cc b/src/util.cc +index d1d16c23..2d57602a 100644 +--- a/src/util.cc ++++ b/src/util.cc +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/wmbusmeters-Make-easier-to-packaging-wmbumeters-for-linux.patch b/wmbusmeters-Make-easier-to-packaging-wmbumeters-for-linux.patch deleted file mode 100644 index 68d67e3..0000000 --- a/wmbusmeters-Make-easier-to-packaging-wmbumeters-for-linux.patch +++ /dev/null @@ -1,203 +0,0 @@ -From 7d74511dcb26381f5cab0b6c5be15cd6d4126b63 Mon Sep 17 00:00:00 2001 -From: Damian Wrobel -Date: Sun, 1 Mar 2020 20:41:19 +0100 -Subject: [PATCH] Make easier to packaging wmbumeters for linux - -Makefile: - - Allow to disable stripping of executables as this prevents from - properly creating debug information sub packages, - - - Don't invoke any git commands when building from released - tarball. Moreover, when creating an rpm package with additional - patches then the created git repository is the one in which rpm - applies patches and not the original one. - - - Allow to pass CXXFLAGS and LDFLAGS as distributions requires all - packages to be compiled with the same set of flags. - - - Support to override DESTDIR when installing files. - - - Allow to pass additional arguments (EXTRA_INSTALL_OPTION) - for install.sh script from Makefile. - -Signed-off-by: Damian Wrobel ---- - Makefile | 27 ++++++++++++++++----------- - install.sh | 30 +++++++++++++++--------------- - uninstall.sh | 6 +++--- - 3 files changed, 34 insertions(+), 29 deletions(-) - -diff --git a/Makefile b/Makefile -index 290e753..5f5671f 100644 ---- a/Makefile -+++ b/Makefile -@@ -20,14 +20,16 @@ - # make DEBUG=true - # make DEBUG=true HOST=arm - -+DESTDIR?=/ -+ - ifeq "$(HOST)" "arm" - CXX=arm-linux-gnueabihf-g++ -- STRIP=arm-linux-gnueabihf-strip -+ STRIP?=arm-linux-gnueabihf-strip - BUILD=build_arm - DEBARCH=armhf - else - CXX=g++ -- STRIP=strip -+ STRIP?=strip - #--strip-unneeded --remove-section=.comment --remove-section=.note - BUILD=build - DEBARCH=amd64 -@@ -47,10 +49,10 @@ endif - - $(shell mkdir -p $(BUILD)) - --COMMIT_HASH:=$(shell git log --pretty=format:'%H' -n 1) --TAG:=$(shell git describe --tags) --CHANGES:=$(shell git status -s | grep -v '?? ') --TAG_COMMIT_HASH:=$(shell git show-ref --tags | grep $(TAG) | cut -f 1 -d ' ') -+COMMIT_HASH?=$(shell git log --pretty=format:'%H' -n 1) -+TAG?=$(shell git describe --tags) -+CHANGES?=$(shell git status -s | grep -v '?? ') -+TAG_COMMIT_HASH?=$(shell git show-ref --tags | grep $(TAG) | cut -f 1 -d ' ') - - ifeq ($(COMMIT),$(TAG_COMMIT)) - # Exactly on the tagged commit. The version is the tag! -@@ -81,7 +83,10 @@ endif - - $(info Building $(VERSION)) - --CXXFLAGS := $(DEBUG_FLAGS) -fPIC -fmessage-length=0 -std=c++11 -Wall -Wno-unused-function -I$(BUILD) -+CXXFLAGS ?= $(DEBUG_FLAGS) -fPIC -fmessage-length=0 -std=c++11 -Wall -Wno-unused-function -+CXXFLAGS += -I$(BUILD) -+ -+LDFLAGS ?= $(DEBUG_LDFLAGS) - - $(BUILD)/%.o: src/%.cc $(wildcard src/%.h) - $(CXX) $(CXXFLAGS) $< -c -E > $@.src -@@ -139,7 +144,7 @@ all: $(BUILD)/wmbusmeters $(BUILD)/testinternals - dist: wmbusmeters_$(DEBVERSION)_$(DEBARCH).deb - - install: $(BUILD)/wmbusmeters -- @./install.sh $(BUILD)/wmbusmeters / -+ @./install.sh $(BUILD)/wmbusmeters $(DESTDIR) $(EXTRA_INSTALL_OPTIONS) - - uninstall: - @./uninstall.sh / -@@ -162,7 +167,7 @@ wmbusmeters_$(DEBVERSION)_$(DEBARCH).deb: - $(BUILD)/main.o: $(BUILD)/short_manual.h - - $(BUILD)/wmbusmeters: $(METER_OBJS) $(BUILD)/main.o $(BUILD)/short_manual.h -- $(CXX) -o $(BUILD)/wmbusmeters $(METER_OBJS) $(BUILD)/main.o $(DEBUG_LDFLAGS) -lpthread -+ $(CXX) -o $(BUILD)/wmbusmeters $(METER_OBJS) $(BUILD)/main.o $(LDFLAGS) -lpthread - - $(BUILD)/short_manual.h: README.md - echo 'R"MANUAL(' > $(BUILD)/short_manual.h -@@ -172,10 +177,10 @@ $(BUILD)/short_manual.h: README.md - echo ')MANUAL";' >> $(BUILD)/short_manual.h - - $(BUILD)/testinternals: $(METER_OBJS) $(BUILD)/testinternals.o -- $(CXX) -o $(BUILD)/testinternals $(METER_OBJS) $(BUILD)/testinternals.o $(DEBUG_LDFLAGS) -lpthread -+ $(CXX) -o $(BUILD)/testinternals $(METER_OBJS) $(BUILD)/testinternals.o $(LDFLAGS) -lpthread - - $(BUILD)/fuzz: $(METER_OBJS) $(BUILD)/fuzz.o -- $(CXX) -o $(BUILD)/fuzz $(METER_OBJS) $(BUILD)/fuzz.o $(DEBUG_LDFLAGS) -lpthread -+ $(CXX) -o $(BUILD)/fuzz $(METER_OBJS) $(BUILD)/fuzz.o $(LDFLAGS) -lpthread - - clean: - rm -rf build/* build_arm/* build_debug/* build_arm_debug/* *~ -diff --git a/install.sh b/install.sh -index 2a1b12a..966f389 100755 ---- a/install.sh -+++ b/install.sh -@@ -205,34 +205,34 @@ fi - - #################################################################### - ## --## Create /etc/systemd/system/wmbusmeters.service -+## Create /lib/systemd/system/wmbusmeters.service - ## - - SYSTEMD_NEEDS_RELOAD=false - --if [ -f "$ROOT"/etc/systemd/system/wmbusmeters.service ] -+if [ -f "$ROOT"/lib/systemd/system/wmbusmeters.service ] - then -- echo systemd: removing "$ROOT"/etc/systemd/system/wmbusmeters.service -+ echo systemd: removing "$ROOT"/lib/systemd/system/wmbusmeters.service - echo systemd: backup stored here: ~/old.wmbusmeters.service.backup -- cp "$ROOT"/etc/systemd/system/wmbusmeters.service ~/old.wmbusmeters@.service.backup -- rm "$ROOT"/etc/systemd/system/wmbusmeters.service -+ cp "$ROOT"/lib/systemd/system/wmbusmeters.service ~/old.wmbusmeters@.service.backup -+ rm "$ROOT"/lib/systemd/system/wmbusmeters.service - SYSTEMD_NEEDS_RELOAD=true - fi - --if [ -f "$ROOT"/etc/systemd/system/wmbusmeters@.service ] -+if [ -f "$ROOT"/lib/systemd/system/wmbusmeters@.service ] - then -- echo systemd: removing "$ROOT"/etc/systemd/system/wmbusmeters@.service -+ echo systemd: removing "$ROOT"/lib/systemd/system/wmbusmeters@.service - echo systemd: backup stored here: ~/old.wmbusmeters@.service.backup -- cp "$ROOT"/etc/systemd/system/wmbusmeters@.service ~/old.wmbusmeters@.service.backup -- rm "$ROOT"/etc/systemd/system/wmbusmeters@.service -+ cp "$ROOT"/lib/systemd/system/wmbusmeters@.service ~/old.wmbusmeters@.service.backup -+ rm "$ROOT"/lib/systemd/system/wmbusmeters@.service - SYSTEMD_NEEDS_RELOAD=true - fi - --if [ ! -f "$ROOT"/etc/systemd/system/wmbusmeters@.service ] -+if [ ! -f "$ROOT"/lib/systemd/system/wmbusmeters@.service ] - then -- mkdir -p "$ROOT"/etc/systemd/system/ -+ mkdir -p "$ROOT"/lib/systemd/system/ - # Create service file -- cat < "$ROOT"/etc/systemd/system/wmbusmeters@.service -+ cat < "$ROOT"/lib/systemd/system/wmbusmeters@.service - [Unit] - Description="wmbusmeters service on %I" - After=network.target -@@ -265,9 +265,9 @@ PIDFile=/var/run/wmbusmeters/wmbusmeters-%i.pid - WantedBy=multi-user.target - EOF - -- echo systemd: installed "$ROOT"/etc/systemd/system/wmbusmeters@.service -+ echo systemd: installed "$ROOT"/lib/systemd/system/wmbusmeters@.service - else -- echo systemd: "$ROOT"/etc/systemd/system/wmbusmeters@.service unchanged -+ echo systemd: "$ROOT"/lib/systemd/system/wmbusmeters@.service unchanged - fi - - -@@ -308,7 +308,7 @@ fi - - if [ "$SYSTEMD_NEEDS_RELOAD" = "true" ] - then -- D=$(diff "$ROOT"/etc/systemd/system/wmbusmeters@.service ~/old.wmbusmeters@.service.backup) -+ D=$(diff "$ROOT"/lib/systemd/system/wmbusmeters@.service ~/old.wmbusmeters@.service.backup) - if [ "$D" != "" ] - then - echo -diff --git a/uninstall.sh b/uninstall.sh -index 5030027..4b62f93 100755 ---- a/uninstall.sh -+++ b/uninstall.sh -@@ -52,10 +52,10 @@ then - echo conf dir: removed "$ROOT"/etc/wmbusmeters.d - fi - --if [ -f "$ROOT"/etc/systemd/system/wmbusmeters.service ] -+if [ -f "$ROOT"/lib/systemd/system/wmbusmeters.service ] - then -- rm "$ROOT"/etc/systemd/system/wmbusmeters.service -- echo systemd: removed "$ROOT"/etc/systemd/system/wmbusmeters.service -+ rm "$ROOT"/lib/systemd/system/wmbusmeters.service -+ echo systemd: removed "$ROOT"/lib/systemd/system/wmbusmeters.service - fi - - if [ -f "$ROOT"/etc/udev/rules.d/99-wmbus-usb-serial.rules ] --- -2.24.1 - diff --git a/wmbusmeters-Make-wmbusmeters.d-directory-accessible-for-the-owne.patch b/wmbusmeters-Make-wmbusmeters.d-directory-accessible-for-the-owne.patch deleted file mode 100644 index 7dd069d..0000000 --- a/wmbusmeters-Make-wmbusmeters.d-directory-accessible-for-the-owne.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 21463d51e68c887ac5f78fa75229b1e72df8c8f6 Mon Sep 17 00:00:00 2001 -From: Damian Wrobel -Date: Tue, 3 Mar 2020 10:21:33 +0100 -Subject: [PATCH] Make wmbusmeters.d directory accessible for the owner - -Signed-off-by: Damian Wrobel ---- - install.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/install.sh b/install.sh -index 966f389..34929bb 100755 ---- a/install.sh -+++ b/install.sh -@@ -197,7 +197,7 @@ if [ ! -d "$ROOT"/etc/wmbusmeters.d ] - then - # Create the configuration directory - mkdir -p "$ROOT"/etc/wmbusmeters.d -- chmod -R 655 "$ROOT"/etc/wmbusmeters.d -+ chmod -R 755 "$ROOT"/etc/wmbusmeters.d - echo conf dir: created "$ROOT"/etc/wmbusmeters.d - else - echo conf dir: "$ROOT"/etc/wmbusmeters.d unchanged --- -2.24.1 - diff --git a/wmbusmeters.conf b/wmbusmeters.conf index 940fe25..5f940e1 100644 --- a/wmbusmeters.conf +++ b/wmbusmeters.conf @@ -1,4 +1,4 @@ loglevel=debug -device=auto +device=auto:c1,t1 logtelegrams=true format=json diff --git a/wmbusmeters@.service b/wmbusmeters.service similarity index 56% rename from wmbusmeters@.service rename to wmbusmeters.service index 946498d..f585d79 100644 --- a/wmbusmeters@.service +++ b/wmbusmeters.service @@ -1,5 +1,5 @@ [Unit] -Description="wmbusmeters service on %I" +Description="wmbusmeters service" Documentation=https://github.com/weetmuts/wmbusmeters Documentation=man:wmbusmeters(1) After=network.target @@ -7,8 +7,8 @@ After=network.target [Service] Type=forking ExecStartPre=/bin/mkdir -p /run/wmbusmeters -ExecStart=/usr/sbin/wmbusmetersd --device='%I' /run/wmbusmeters/wmbusmeters-%i.pid -PIDFile=/run/wmbusmeters/wmbusmeters-%i.pid +ExecStart=/usr/bin/wmbusmetersd /run/wmbusmeters/wmbusmeters.pid +PIDFile=/run/wmbusmeters/wmbusmeters.pid [Install] WantedBy=multi-user.target diff --git a/wmbusmeters.spec b/wmbusmeters.spec index ed18608..ed77fa1 100644 --- a/wmbusmeters.spec +++ b/wmbusmeters.spec @@ -1,40 +1,40 @@ +%global with_tag 1 + Name: wmbusmeters - %global forgeurl https://github.com/weetmuts/%{name} -%global tag 0.9.27 -%global the_binary rtl_wmbus +%if %{with_tag} +%global tag 3.0.0 Version: %{tag} +%else +%global date 20210813 +%global commit 8dd3e87c44ecb2e3fc46f7bc6df9ea6195c8b988 +Version: 1.4.0 +%endif %forgemeta -Release: 6%{?dist} +Release: 1%{?dist} Summary: Read the wireless mbus protocol to acquire utility meter readings -License: GPLv3+ +License: GPL-3.0-or-later Url: %{forgeurl} Source0: %{forgesource} # Default configuration file # Stores all logs in journald -Source1: %{name}.conf +Source1: file://%{name}.conf # Systemd service file -Source2: %{name}@.service -# Upstream reference: https://github.com/weetmuts/wmbusmeters/pull/87 -Patch0: %{name}-Make-easier-to-packaging-wmbumeters-for-linux.patch -# Fixes compilation error on gcc >= 10.x -# Upstream reference: https://github.com/weetmuts/wmbusmeters/pull/85 -Patch1: %{name}-Fix-compilation-error-on-gcc-10.x.patch -# Fixes crash -# Upstream reference: https://github.com/weetmuts/wmbusmeters/pull/86 -Patch2: %{name}-Fix-accessing-empty-string.patch -# Make wmbusmeters.d directory accessible for the owner -# Upstream reference: https://github.com/weetmuts/wmbusmeters/pull/88 -Patch3: %{name}-Make-wmbusmeters.d-directory-accessible-for-the-owne.patch +Source2: file://%{name}.service BuildRequires: /usr/bin/git +BuildRequires: /usr/bin/make BuildRequires: gcc-c++ BuildRequires: systemd-rpm-macros +BuildRequires: pkgconfig(ncurses) +BuildRequires: pkgconfig(librtlsdr) +BuildRequires: pkgconfig(libusb-1.0) +BuildRequires: pkgconfig(libxml-2.0) -Requires: /usr/bin/rtl_wmbus +Requires: rtl-wmbus >= 0-18 %description @@ -46,18 +46,24 @@ inserted into a database or stored in a log file. %prep %forgeautosetup -S git +# For https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin +# Unfortunately other distros does not have similar plan so we cannot +# upstream the change for now. +sed -i 's#/sbin#/bin#g' scripts/install_binaries.sh +%configure %build %set_build_flags %{make_build} STRIP=true COMMIT_HASH="" TAG=%{version} COMMIT=%{version} \ - TAG_COMMIT=%{version} CHANGES="" + TAG_COMMIT=%{version}%{distprefix} CHANGES="" %install +%set_build_flags %{make_install} STRIP=true COMMIT_HASH="" TAG=%{version} COMMIT=%{version} \ TAG_COMMIT=%{version} CHANGES="" \ - DESTDIR=%{buildroot} EXTRA_INSTALL_OPTIONS="--no-adduser --no-udev-rules" + DESTDIR=%{buildroot} EXTRA_INSTALL_OPTIONS="--no-adduser" # We are using journald rm -rf %{buildroot}%{_sysconfdir}/logrotate.d/ @@ -68,36 +74,199 @@ install -m 0755 -d %{buildroot}/%{_rundir}/%{name}/ # Fix systemd unit dir location mv %{buildroot}/lib %{buildroot}/%{_prefix} +# We are installing template version +rm -f %{buildroot}%{_unitdir}/%{name}.service + # Install default configuration file install -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}.conf # Install systemd service file -install -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}@.service +install -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service %files %license LICENSE -%doc README.md CHANGES HowToAddaNewMeter.txt +%doc README.md CHANGES %dir %{_sysconfdir}/%{name}.d/ %config(noreplace) %{_sysconfdir}/%{name}.conf -%{_sbindir}/wmbusmetersd +%{_bindir}/wmbusmetersd %{_bindir}/%{name} -%{_unitdir}/%{name}@.service +%{_unitdir}/%{name}.service %{_mandir}/man1/%{name}* %ghost %{_rundir}/%{name}/ %post -%systemd_post %{name}@\*.service +%systemd_post %{name}.service %preun -%systemd_preun %{name}@\*.service +%systemd_preun %{name}.service %postun -%systemd_postun_with_restart %{name}@\*.service +%systemd_postun_with_restart %{name}.service %changelog +* Thu Aug 06 2026 Damian Wrobel - 3.0.0-1 +- Update to 3.0.0 (rhbz#2490161) + +* Fri Jul 17 2026 Fedora Release Engineering - 2.0.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + +* Mon Mar 02 2026 Damian Wrobel - 2.0.0-1 +- Update to 2.0.0 (rhbz#2443681) + +* Tue Feb 03 2026 Damian Wrobel - 1.20.0-1 +- Update to 1.20.0 (rhbz#2433637) + +* Sat Jan 17 2026 Fedora Release Engineering - 1.19.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + +* Fri Jul 25 2025 Fedora Release Engineering - 1.19.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Wed May 21 2025 Damian Wrobel - 1.19.0-1 +- Update to 1.19.0 (rhbz#2354241) + +* Tue Jan 21 2025 Damian Wrobel - 1.18.0-3 +- Fix FTBFS on F42. + +* Sun Jan 19 2025 Fedora Release Engineering - 1.18.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Thu Dec 05 2024 Damian Wrobel - 1.18.0-1 +- Update to 1.18.0 (rhbz#2329228) + +* Mon Oct 07 2024 Damian Wrobel - 1.17.1-2 +- Rebuilt for updated license tag + +* Thu Sep 12 2024 Damian Wrobel - 1.17.1-1 +- Update to 1.17.1 (rhbz#2307772) + +* Sat Jul 20 2024 Fedora Release Engineering - 1.16.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Fri Apr 05 2024 Damian Wrobel - 1.16.1-2 +- Rebuild for rtl-sdr-2.0 (rhbz#2273601) + +* Fri Feb 23 2024 Damian Wrobel - 1.16.1-1 +- Update to 1.16.1 (rhbz#2264357) +- Switch to use pkgconfig for BuildRequires +- Specify Require for rtl-wmbus which supports needed -f option + +* Sat Jan 27 2024 Fedora Release Engineering - 1.14.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jul 07 2023 Damian Wrobel - 1.14.0-1 +- Update to 1.14.0 (rhbz#2219146) + +* Mon May 08 2023 Damian Wrobel - 1.13.0-1 +- Update to 1.13.0 (rhbz#2196040) + +* Mon Mar 13 2023 Damian Wrobel - 1.12.0-1 +- Update to 1.12.0 (rhbz#2177567) + +* Sat Jan 21 2023 Fedora Release Engineering - 1.11.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jan 13 2023 Damian Wrobel - 1.11.0-1 +- Update to 1.11.0 (rhbz#2156910) + +* Fri Dec 09 2022 Damian Wrobel - 1.10.1-1 +- Update to 1.10.1 (rhbz#2151407) + +* Wed Sep 14 2022 Damian Wrobel - 1.9.0-1 +- Update to 1.9.0 (rhbz#2124324) +- Drop patch merged upstream + +* Tue Jul 26 2022 Damian Wrobel - 1.8.0-4 +- Fix FTBFS on F37 + +* Sat Jul 23 2022 Fedora Release Engineering - 1.8.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 27 2022 Damian Wrobel - 1.8.0-2 +- Update to 1.8.0 (rhbz#2101195) +- Update change log + +* Mon Jun 27 2022 Damian Wrobel - 1.8.0-1 +- Update to 1.7.0 (rhbz#2101195) + +* Wed Apr 06 2022 Damian Wrobel - 1.7.0-1 +- Update to 1.7.0 (rhbz#2069461) + +* Sat Jan 22 2022 Fedora Release Engineering - 1.6.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Jan 04 2022 Damian Wrobel - 1.6.0-1 +- Update to 1.6.0 (rhbz#2020903) + +* Tue Nov 09 2021 Damian Wrobel - 1.5.0-1 +- Update to 1.5.0 (rhbz#2020903) + +* Tue Aug 31 2021 Damian Wrobel - 1.4.1-1 +- Update to 1.4.1 + +* Fri Aug 13 2021 Damian Wrobel - 1.4.0-2 +- Update to the latest snapshot (fixes compilation errors) + +* Thu Aug 12 2021 Damian Wrobel - 1.4.0-1 +- Update to 1.4.0 (#1991762) + +* Fri Jul 23 2021 Fedora Release Engineering - 1.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon May 31 2021 Damian Wrobel - 1.3.0-1 +- Update to 1.3.0 (#1936290) + +* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 1.1.0-6 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. + +* Mon Feb 22 2021 Damian Wrobel - 1.1.0-5 +- Update to 1.1.0 (#1922583), +- Remove duplicate BR for make. + +* Wed Jan 27 2021 Fedora Release Engineering - 1.0.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Dec 22 2020 Damian Wrobel - 1.0.4-2 +- Switch (as per upstream) to non template unit file + +* Mon Dec 07 2020 Damian Wrobel - 1.0.4-1 +- Update to the latest available version + +* Sat Oct 31 2020 Damian Wrobel - 0.9.36-2 +- Allows to build non-released versions + +* Tue Sep 08 2020 Damian Wrobel - 0.9.36-1 +- Update to the latest available version + +* Mon Aug 31 2020 Damian Wrobel - 0.9.35-1 +- Update to the latest available version + +* Wed Jul 29 2020 Fedora Release Engineering - 0.9.32-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 01 2020 Damian Wrobel - 0.9.32-1 +- Update to the latest available version + +* Mon May 25 2020 Damian Wrobel - 0.9.31-2 +- Add missing ncurses-devel BR + +* Mon May 25 2020 Damian Wrobel - 0.9.31-1 +- Update to the latest available version + +* Thu Apr 23 2020 Damian Wrobel - 0.9.30-1 +- Update to the latest available version + +* Fri Apr 03 2020 Damian Wrobel - 0.9.29-1 +- Update to the latest available version + +* Tue Mar 24 2020 Damian Wrobel - 0.9.28-1 +- Update to the latest available version +- Drop patches upstream merged + * Mon Mar 23 2020 Damian Wrobel - 0.9.27-6 - Remove -v from the forgemeta - Remove instead of exclude logrotate.d directory