b9a07f6
# Many modules not packaged. Some of them deprecated.
b9a07f6
%bcond_with tests
b9a07f6
b9a07f6
%global pypi_name linux_thermaltake_rgb
b9a07f6
%global sys_name linux_thermaltake_riing
b9a07f6
b9a07f6
Name: linux-thermaltake-rgb
b9a07f6
Version: 0.2.0
b9a07f6
Release: 1%{?dist}
b9a07f6
Summary: Python driver and daemon to control thermaltake Riing fans and pumps
b9a07f6
BuildArch: noarch
b9a07f6
b9a07f6
License: GPLv2
b9a07f6
URL: https://github.com/chestm007/linux_thermaltake_riing
b9a07f6
b9a07f6
# GitHub source because pypi version outdated
b9a07f6
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
b9a07f6
b9a07f6
BuildRequires: python3-devel
b9a07f6
BuildRequires: systemd-rpm-macros
b9a07f6
BuildRequires: python3dist(setuptools)
b9a07f6
b9a07f6
%if %{with tests}
b9a07f6
# BuildRequires: python3dist(base_test_object)
b9a07f6
# BuildRequires: python3dist(pep8)
b9a07f6
# BuildRequires: python3dist(usb)
b9a07f6
BuildRequires: python3dist(pytest)
b9a07f6
%endif
b9a07f6
b9a07f6
%description
b9a07f6
Linux driver and daemon for Thermaltake Riing
b9a07f6
b9a07f6
Currently supported devices are (as they show up in thermaltakes TTRGBPLUS
b9a07f6
software:
b9a07f6
b9a07f6
- Flow Riing RGB
b9a07f6
- Lumi Plus LED Strip
b9a07f6
- Pacific PR22-D5 Plus
b9a07f6
- Pacific Rad Plus LED Panel
b9a07f6
- Pacific V-GTX 1080Ti Plus GPU Waterblock
b9a07f6
- Pacific W4 Plus CPU Waterblock
b9a07f6
- Riing Plus
b9a07f6
b9a07f6
b9a07f6
%prep
b9a07f6
%autosetup -n %{sys_name}-%{version} -p1
b9a07f6
sed -i 's/PROJECTVERSION/%{version}/g' setup.py
b9a07f6
b9a07f6
# fix wrong package requirement for GObject
b9a07f6
# https://github.com/chestm007/linux_thermaltake_riing/pull/37
b9a07f6
sed -i 's/GObject/PyGObject/g' setup.py
b9a07f6
b9a07f6
# Remove bundled egg-info
b9a07f6
rm -rf %{name}.egg-info
b9a07f6
b9a07f6
b9a07f6
%build
b9a07f6
%py3_build
b9a07f6
b9a07f6
b9a07f6
%install
b9a07f6
%py3_install
b9a07f6
b9a07f6
mkdir -p %{buildroot}%{_unitdir}
b9a07f6
mv %{buildroot}%{_datadir}/%{pypi_name}/%{name}.service \
b9a07f6
    %{buildroot}%{_unitdir}
b9a07f6
b9a07f6
mkdir -p %{buildroot}%{_sysconfdir}/%{pypi_name}
b9a07f6
mv %{buildroot}%{_datadir}/%{pypi_name}/config.yml \
b9a07f6
    %{buildroot}%{_sysconfdir}/%{pypi_name}
b9a07f6
b9a07f6
b9a07f6
%if %{with tests}
b9a07f6
%check
b9a07f6
%{python3} -m pytest -v
b9a07f6
%endif
b9a07f6
b9a07f6
b9a07f6
%post
b9a07f6
%systemd_post %{name}.service
b9a07f6
b9a07f6
%preun
b9a07f6
%systemd_preun %{name}.service
b9a07f6
b9a07f6
%postun
b9a07f6
%systemd_postun_with_restart %{name}.service
b9a07f6
b9a07f6
b9a07f6
%files
b9a07f6
%license LICENSE.txt
b9a07f6
%doc README.md roadmap.txt protocol.txt
b9a07f6
%config(noreplace) %{_sysconfdir}/%{pypi_name}/config.yml
b9a07f6
%dir %{_sysconfdir}/%{pypi_name}
b9a07f6
%{_bindir}/%{name}
b9a07f6
%{_unitdir}/*.service
b9a07f6
%{python3_sitelib}/%{pypi_name}-%{version}-py*.egg-info/
b9a07f6
%{python3_sitelib}/%{pypi_name}/
b9a07f6
b9a07f6
b9a07f6
%changelog
b9a07f6
* Sun Jan 31 2021 Artem Polishchuk <ego.cordatus@gmail.com> - 0.2.0-1
b9a07f6
- Initial package