%global pypi_name modbus-proxy %global pypi_version 0.6.8 Name: %{pypi_name} Version: %{pypi_version} Release: 3%{?dist} Summary: ModBus TCP proxy License: GPLv3+ URL: https://github.com/tiagocoutinho/modbus-proxy Source0: %{pypi_source} # Sample configuration file Source1: %{name}-0.6.8-modbus-proxy.yaml # Systemd service file Source2: %{name}-0.6.8-systemd-service # Reported as https://github.com/tiagocoutinho/modbus-proxy/pull/20 Patch0: %{name}-0.6.8-Fix-error-tox-config-file-not-found.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: systemd-rpm-macros Requires: python3dist(pyyaml) Requires: python3dist(toml) %description Many modbus devices support only one or very few clients. This proxy acts as a bridge between the client and the modbus device. It can be seen as a layer 7 reverse proxy. This allows multiple clients to communicate with the same modbus device. %prep %autosetup -n %{pypi_name}-%{pypi_version} %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %install %pyproject_install %pyproject_save_files modbus_proxy # Install sample configuration file install -p -m 0644 -D %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}.yaml # Install systemd service file install -p -m 0644 -D %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service %check %tox %files -f %{pyproject_files} %doc README.md %{_bindir}/modbus-proxy %config(noreplace) %{_sysconfdir}/%{name}.yaml %{_unitdir}/%{name}.service %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %changelog * Wed Nov 23 2022 Damian Wrobel - 0.6.8-3 - Add missing runtime dependencies. * Wed Nov 23 2022 Damian Wrobel - 0.6.8-2 - Add systemd service and sample configuration files. * Mon Nov 21 2022 Damian Wrobel - 0.6.8-1 - Initial package.