Blame linux-thermaltake-rgb.spec

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
fb6e5ca
Release: %autorelease
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
fb6e5ca
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
fb6e5ca
%autosetup -n %{sys_name}-%{version} -p1
b9a07f6
sed -i 's/PROJECTVERSION/%{version}/g' setup.py
65ae70c
# Fixed missing 1 positional argument in daemon/config.py
65ae70c
#
65ae70c
# For newer versions of python yaml, Simply loading the config with
65ae70c
# yaml.load(cfg) does not work due to it being deprecated, It has been fixed
65ae70c
# here.
65ae70c
# https://github.com/chestm007/linux_thermaltake_riing/pull/53
23db24f
sed -i 's/yaml.load(cfg)/yaml.load(cfg, Loader=yaml.FullLoader)/' \
65ae70c
    %{pypi_name}/daemon/config.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
6f7b8f2
%autochangelog