File sc-contoller.spec of Package sc-controller
%{!?__python2: %global __python2 /usr/bin/python2}
Summary: User-mode driver and GTK3 based GUI for Steam Controller
Name: sc-controller
Version: 0.4.8
Release: 10.8
License: GPL-2.0-only
Source1: sc-controller-%{version}.tar.gz
Group: Amusements/Games/Other
URL: https://github.com/kozec/sc-controller
Vendor: Kozec <kozec at kozec dot com>
Packager: Kozec <kozec at kozec dot com>
### Requires: python >= 2.7
Requires: zlib, python38-setuptools, python38-gobject2, libgtk-3-0, typelib-1_0-Gtk-3_0, typelib-1_0-Rsvg-2_0, python38-evdev, python38-pylibacl, linux-glibc-devel, python38-gobject-devel
BuildRequires: python-devel, desktop-file-utils, zlib-devel
%description
Application allowing to setup, configure and use Steam Controller
without using Steam client.
%prep
cd ~/rpmbuild/BUILD
rm -rf sc-controller-%{version}
tar xvfz /home/abuild/rpmbuild/SOURCES/sc-controller-%{version}.tar.gz
ln -s sc-controller-%{version} sc-controller-%{version}
%build
cd ~/rpmbuild/BUILD
cd sc-controller-%{version}
%if %{defined fedora}
python2 -B setup.py build
%else
python -B setup.py build
%endif
%install
cd ~/rpmbuild/BUILD
cd sc-controller-%{version}
%if %{defined fedora}
python2 setup.py install --root=%{buildroot} -O1
%else
python setup.py install --root=%{buildroot} -O1
%endif
[ -e %{buildroot}/usr/share/applications/sc-controller.desktop.orig ] && rm %{buildroot}/usr/share/applications/sc-controller.desktop.orig
# mkdir -p %{buildroot}%{_udevrulesdir}
# install -m644 /home/abuild/rpmbuild/SOURCES/99-sc-controller.rules %{buildroot}%{_udevrulesdir}
%post
%desktop_database_post
%postun
%desktop_database_postun
%files
/usr/bin/*
%ifarch x86_64
/usr/lib64/python2.7/site-packages/scc
/usr/lib64/python2.7/site-packages/*.so
/usr/lib64/python2.7/site-packages/*.egg-info
%else # ifarch x86_64
/usr/lib/python2.7/site-packages/scc
/usr/lib/python2.7/site-packages/*.so
/usr/lib/python2.7/site-packages/*.egg-info
%endif # ifarch x86_64
/usr/lib/udev/rules.d/*
/usr/share/icons/*
/usr/share/applications/*
/usr/share/pixmaps/*
/usr/share/mime/packages/*
/usr/share/scc