Cleanup spec file conditionals

This commit is contained in:
Troy Dawson 2017-09-29 09:52:28 -07:00
parent 4f0bbce777
commit 88274670e9

View File

@ -1,11 +1,14 @@
%global upstream_name Pygments
%global srcname pygments
%global sum Syntax highlighting engine written in Python
%if 0%{?fedora} || 0%{?rhel} > 7
%global with_python3 1
%endif
Name: python-pygments
Version: 2.2.0
Release: 8%{?dist}
Release: 9%{?dist}
Summary: %{sum}
License: BSD
@ -51,8 +54,7 @@ need to prettify source code. Highlights are:
* it is usable as a command-line tool and as a library
* ... and it highlights even Brainf*ck!
# python3 packages are only built on Fedora
%if 0%{?fedora}
%if 0%{?with_python3}
%package -n python3-%{srcname}
BuildRequires: python3-devel, python3-setuptools, python3-nose
Summary: %{sum}
@ -81,8 +83,7 @@ need to prettify source code. Highlights are:
%{__sed} -i 's/\r//' LICENSE
%py2_build
# python3 packages are only built on Fedora
%if 0%{?fedora}
%if 0%{?with_python3}
%py3_build
%endif
@ -97,8 +98,7 @@ mv pygmentize.1 $RPM_BUILD_ROOT%{_mandir}/man1/pygmentize.1
popd
cp -r doc/docs doc/reST
# python3 packages are only built on Fedora
%if 0%{?fedora}
%if 0%{?with_python3}
# Python 3 install
%py3_install
%endif
@ -113,13 +113,12 @@ make test || :
# For noarch packages: sitelib
%{python2_sitelib}/*
# Fix build on EL7
%if !0%{?fedora}
%if !0%{?fedora} && 0%{?rhel} <= 7
%{_bindir}/pygmentize
%lang(en) %{_mandir}/man1/pygmentize.1*
%endif
# python3 packages are only built on Fedora
%if 0%{?fedora}
%if 0%{?with_python3}
%files -n python3-pygments
%doc AUTHORS CHANGES build/sphinx/html doc/reST TODO
%license LICENSE
@ -129,6 +128,9 @@ make test || :
%endif
%changelog
* Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 2.2.0-9
- Cleanup spec file conditionals
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild