%define pkg_name artisan %define pkg_summary Visual scope for coffee roasters %define debug_package %{nil} Name: python-%{pkg_name} Version: 2.6.0 Release: 1%{?dist} Summary: %{pkg_summary} License: GPLv3 URL: https://github.com/artisan-roaster-scope/artisan # to dowload tarbal, check the latest version: https://github.com/artisan-roaster-scope/artisan/releases # then: wget --content-disposition "https://github.com/artisan-roaster-scope/artisan/archive/$version.tar.gz" Source0: %{pkg_name}-%{version}.tar.gz Patch0: 0001-Add-setup.py-for-Fedora-COPR-build.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(setuptools) %description %{pkg_summary} %package -n %{pkg_name} Summary: %{pkg_summary} Requires: python3-%{pkg_name} = %{version}-%{release} %description -n %{pkg_name} %{pkg_summary} %package -n python3-%{pkg_name} Summary: %{pkg_summary} %{?python_provide:%python_provide python3-%{pkg_name}} Requires: python3-colorspacious Requires: python3-matplotlib-qt5 Requires: python3-matplotlib Requires: python3-Phidget Requires: python3-yoctopuce Requires: python3-pyserial %description -n python3-%{pkg_name} %{pkg_summary} %prep %autosetup -n %{pkg_name}-%{version} -p1 %build # remove all unneeded files, some of them confuse rpmbuild find src/ -maxdepth 1 -type f -a ! -name 'setup.py' -a ! -name 'artisan.py' -a ! -name 'LICENSE.txt' -a ! -name 'README.txt' -delete rm -rf src/Wheels rm -rf src/debian rm -rf src/icons rm -rf src/includes rm -rf src/raspbian # move additional modules under artisanlib as they don't make sense at site-packages level mv src/help src/artisanlib/ cd src %py3_build %install rm -rf $RPM_BUILD_ROOT cd src %py3_install # rename the binary %{__mv} $RPM_BUILD_ROOT/%{_bindir}/artisan.py $RPM_BUILD_ROOT/%{_bindir}/artisan %clean rm -rf $RPM_BUILD_ROOT %files -n %{pkg_name} %{_bindir}/* %doc src/README.txt %license LICENSE %files -n python3-%{pkg_name} %{python3_sitelib}/* %changelog