diff --git a/python-Pygments.changes b/python-Pygments.changes index 923e09f..8aec393 100644 --- a/python-Pygments.changes +++ b/python-Pygments.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Aug 15 12:52:00 UTC 2017 - dmueller@suse.com + +- fix build in a python2.x only env + ------------------------------------------------------------------- Fri Apr 7 21:13:53 UTC 2017 - toddrme2178@gmail.com diff --git a/python-Pygments.spec b/python-Pygments.spec index d30943f..34f6aab 100644 --- a/python-Pygments.spec +++ b/python-Pygments.spec @@ -31,6 +31,8 @@ BuildRequires: %{python_module nose} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun): update-alternatives Requires: python-setuptools Provides: python-pygments = %{version} Obsoletes: python-pygments < %{version} @@ -63,8 +65,21 @@ rm tests/examplefiles/{Sorting,test}.mod %install %python_install +%{python_expand %$python_install +mv %{buildroot}%{_bindir}/pygmentize %{buildroot}%{_bindir}/pygmentize-%{$python_bin_suffix} +%fdupes -s %{buildroot}%{$python_sitelib} +%if "%python3_bin_suffix" != "" install -Dm0644 doc/pygmentize.1 %{buildroot}%{_mandir}/man1/pygmentize.1 -%{python_expand %fdupes %{buildroot}%{$python_sitelib}} +%endif +} + +%prepare_alternative pygmentize + +%post +%python_install_alternative pygmentize + +%postun +%python_install_alternative pygmentize %check export PYTHONDEBUG=1 @@ -73,10 +88,8 @@ export PYTHONDEBUG=1 %files %{python_files} %defattr(-,root,root,-) %doc LICENSE AUTHORS CHANGES TODO -%ifpython3 -%{_bindir}/pygmentize -%{_mandir}/man1/pygmentize.1* -%endif +%python_alternative %{_bindir}/pygmentize +%python3_only %{_mandir}/man1/pygmentize.1* %{python_sitelib}/pygments/ %{python_sitelib}/Pygments-%{version}-py%{python_version}.egg-info/