%global with_tag 0 Name: mbusd %global forgeurl https://github.com/3cky/%{name} %if %{with_tag} %global tag 0.5.0 Version: %{tag} %else %global date 20220217 %global commit 7c268600b6c141b369a6a36ec9b43a834395210e Version: 0.5.1 %endif %forgemeta Release: 1%{?dist} Summary: Read the wireless mbus protocol to acquire utility meter readings License: BSD Url: %{forgeurl} Source0: %{forgesource} BuildRequires: /usr/bin/git BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: systemd BuildRequires: systemd-rpm-macros %description The program receives and decodes C1,T1 or S1 telegrams (using the wireless mbus protocol) to acquire utility meter readings. The readings can then be published using MQTT, curled to a REST api, inserted into a database or stored in a log file. %prep %forgeautosetup -S git %build %cmake %cmake_build %install %cmake_install # Prepare usable configuration files sed 's/ttyS0/ttyUSB0/g' %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf.example \ >%{buildroot}%{_sysconfdir}/%{name}/%{name}-ttyUSB0.conf mv %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf.example \ %{buildroot}/%{_sysconfdir}/%{name}/%{name}-ttyS0.conf %files %license LICENSE %doc README.md %dir %{_sysconfdir}/%{name}/ %config(noreplace) %{_sysconfdir}/%{name}/%{name}-ttyS0.conf %config(noreplace) %{_sysconfdir}/%{name}/%{name}-ttyUSB0.conf %{_bindir}/%{name} %{_unitdir}/%{name}@.service %{_mandir}/man8/%{name}* %ghost %{_rundir}/%{name}/ %post %systemd_post %{name}@\*.service %preun %systemd_preun %{name}@\*.service %postun %systemd_postun_with_restart %{name}@\*.service %changelog * Mon Feb 28 2022 Damian Wrobel - 0.5.1-1 - Initial RPM release.