From 042ef551bc7a03cb5b335a979fee7d43a8d7208a Mon Sep 17 00:00:00 2001 From: David Shea Date: Dec 10 2018 16:28:58 +0000 Subject: Uncrud the spec file. Trying to carry a single spec file across every version of EPEL is making the whole thing unreadable. Get rid of all the macros at the top and just always build the python3 version, as is expected for the latest version of Fedora. --- diff --git a/python-polib.spec b/python-polib.spec index e36877a..2b681ed 100644 --- a/python-polib.spec +++ b/python-polib.spec @@ -1,34 +1,9 @@ -%if 0%{?fedora} || 0%{?rhel} >= 7 -%bcond_without python3 -%else # 0#{?fedora} || 0#{?rhel} >= 7 -%bcond_with python3 -%endif # 0#{?fedora} || 0#{?rhel} >= 7 - -%if 0%{?fedora} || 0%{?rhel} >= 8 -%global py3ver 3 -%else # 0#{?fedora} || 0#{?rhel} >= 7 -%global py3ver 34 -%endif # 0#{?fedora} || 0#{?rhel} >= 7 - %global srcname polib -%global sum A library to parse and manage gettext catalogs - -%global desc \ -polib allows you to manipulate, create, modify gettext files (pot, po and \ -mo files). You can load existing files, iterate through it's entries, add, \ -modify entries, comments or metadata, etc... or create new po files from \ -scratch. \ - \ -polib provides a simple and pythonic API, exporting only three convenience \ -functions 'pofile', 'mofile' and 'detect_encoding', and the 4 core classes: \ -POFile, MOFile, POEntry and MOEntry for creating new files/entries. - - Name: python-%{srcname} Version: 1.0.7 Release: 12%{?dist} -Summary: %{sum} +Summary: A library to parse and manage gettext catalogs License: MIT URL: http://bitbucket.org/izi/polib/ @@ -37,71 +12,69 @@ Source0: http://bitbucket.org/izi/polib/get/%{version}.tar.gz BuildArch: noarch %description -%{desc} +polib allows you to manipulate, create, modify gettext files (pot, po and +mo files). You can load existing files, iterate through it's entries, add, +modify entries, comments or metadata, etc... or create new po files from +scratch. +polib provides a simple and pythonic API, exporting only three convenience +functions 'pofile', 'mofile' and 'detect_encoding', and the 4 core classes: +POFile, MOFile, POEntry and MOEntry for creating new files/entries. %package -n python2-%{srcname} -Summary: %{sum} +Summary: A library to parse and manage gettext catalogs BuildRequires: python2-devel %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} -%{desc} +polib allows you to manipulate, create, modify gettext files (pot, po and +mo files). You can load existing files, iterate through it's entries, add, +modify entries, comments or metadata, etc... or create new po files from +scratch. +polib provides a simple and pythonic API, exporting only three convenience +functions 'pofile', 'mofile' and 'detect_encoding', and the 4 core classes: +POFile, MOFile, POEntry and MOEntry for creating new files/entries. -%if %{with python3} -%package -n python%{py3ver}-%{srcname} -Summary: %{sum} -BuildRequires: python%{py3ver}-devel -%if 0%{?fedora} || 0%{?rhel} >= 8 -%{?python_provide:%python_provide python%{py3ver}-%{srcname}} -%endif # 0#{?fedora} || 0#{?rhel} >= 8 +%package -n python3-%{srcname} +Summary: A library to parse and manage gettext catalogs +BuildRequires: python3-devel +%{?python_provide:%python_provide python3-%{srcname}} -%description -n python%{py3ver}-%{srcname} -%{desc} -%endif # with python3 +%description -n python3-%{srcname} +polib allows you to manipulate, create, modify gettext files (pot, po and +mo files). You can load existing files, iterate through it's entries, add, +modify entries, comments or metadata, etc... or create new po files from +scratch. +polib provides a simple and pythonic API, exporting only three convenience +functions 'pofile', 'mofile' and 'detect_encoding', and the 4 core classes: +POFile, MOFile, POEntry and MOEntry for creating new files/entries. %prep %autosetup -n izi-polib-d75ce6dbbc2a -p 1 - %build %py2_build -%if %{with python3} %py3_build -%endif # with python3 - %install %py2_install -%if %{with python3} %py3_install -%endif # with python3 - -%if 0%{?fedora} || 0%{?rhel} >= 8 %check %{__python2} tests/tests.py -%if %{with python3} %{__python3} tests/tests.py -%endif # with python3 -%endif # 0#{?fedora} || 0#{?rhel} >= 8 - %files -n python2-%{srcname} %doc README.rst %license LICENSE %{python2_sitelib}/* - -%if %{with python3} -%files -n python%{py3ver}-%{srcname} +%files -n python3-%{srcname} %doc README.rst %license LICENSE %{python3_sitelib}/* -%endif # with python3 - %changelog * Sat Jul 14 2018 Fedora Release Engineering - 1.0.7-12