%global githubuser lucasdemarchi %{!?__python2: %global __python2 %{__python}} %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python2_sitelib: %global python2_sitelib %{python_sitelib}} # conditional use of python3 where available %if 0%{?fedora} > 12 || 0%{?rhel} > 7 %global pyver python3 %global pybin %{__python3} %global pysitelib %{python3_sitelib} %else %global pyver python2 %global pybin %{__python} %global pysitelib %{python2_sitelib} %endif Name: codespell Version: 1.10.0 Release: 0%{dist}.3sunshine Summary: Fix common misspellings in text files. Source0: https://github.com/%{githubuser}/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz URL: https://github.com/%{githubuser}/%{name} Group: Development/Languages BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildArch: noarch BuildRequires: %{pyver}-devel Requires: %{pyver} BuildRequires: help2man License: GPLv2 %description Fix common misspellings in text files. It's designed primarily for checking misspelled words in source code, but it can be used with other files as well. %prep %setup -q # fix use of python vs. python3 for file in setup.py codespell_lib/_codespell.py bin/codespell; do sed -r -i -e "s,/env[ ]+python(2|3)?$,/env %{pyver}," "$file" done %build make prefix=%{_prefix} sort-dictionary make %{?_smp_mflags} prefix=%{_prefix} %install rm -rf %{buildroot} %{pybin} setup.py install --root=%{buildroot} %clean rm -rf %{buildroot} %files %defattr(-,root,root,0755) %doc README.rst NEWS TODO %license COPYING %{_bindir}/%{name}* %{pysitelib}/* %changelog * Mon Jul 24 2017 Moritz Barsnick 1.10.0-0.3sunshine - allow use of python2 for older distributions * Mon Jul 24 2017 Moritz Barsnick 1.10.0-0.2sunshine - add BR python3-devel (though it might be default install on distribution versions which support it) - use %%{__python3} macro in favor of %%{__python}, which can apparently expand to a non-existant binary - add a workaround for missing %%{__python3} macro * Mon Jul 24 2017 Moritz Barsnick 1.10.0-0.1sunshine - update to 1.10.0 - update Source0 URL - drop patches - drop symbolic link creation (it's upstream) * Fri Jan 20 2017 Moritz Barsnick 1.9.2-0.1sunshine - update to 1.9.2 - add a patch from an upstream commit fixing the Makefile - add a patch to further fix it - force re-sorting of dictionary - use setup.py to install - fix and expand %%doc list - BR help2man * Thu Jul 9 2015 Moritz Barsnick 1.8-0.2sunshine - bump release for copr * Thu Jul 9 2015 Moritz Barsnick 1.8-0.1sunshine - initial RPM