diff --git a/python-polib.spec b/python-polib.spec index 6630c7e..9191b32 100644 --- a/python-polib.spec +++ b/python-polib.spec @@ -3,7 +3,7 @@ Name: python-%{srcname} Version: 1.0.7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: %{sum} License: MIT @@ -11,59 +11,94 @@ URL: http://bitbucket.org/izi/polib/ Source0: http://bitbucket.org/izi/polib/get/%{version}.tar.gz BuildArch: noarch -BuildRequires: python2-devel python3-devel +%if 0%{?el6}%{?el7} +BuildRequires: python-devel +%else +BuildRequires: python2-devel python-devel +%endif %description -An python module which provides a convenient example. +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 0%{?el6}%{?el7} +%else %package -n python2-%{srcname} Summary: %{sum} +BuildRequires: python2-devel %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} -An python module which provides a convenient example. +Python 2 binding for python-polib %package -n python3-%{srcname} Summary: %{sum} +BuildRequires: python3-devel %{?python_provide:%python_provide python3-%{srcname}} %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. +Python 3 binding for python-polib +%endif %prep +%if 0%{?el6} +%setup -q -n izi-polib-d75ce6dbbc2a +%else %autosetup -n izi-polib-d75ce6dbbc2a +%endif %build +%if 0%{?el6}%{?el7} +%{__python} setup.py build +%else %py2_build %py3_build +%endif %install +%if 0%{?el6}%{?el7} +%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%else %py2_install %py3_install +%endif +%if ! 0%{?el6}%{?el7} %check +%{__python} setup.py test %{__python2} setup.py test %{__python3} setup.py test +%endif +%if 0%{?el6}%{?el7} +%files +%defattr(-,root,root,-) +%doc README.rst LICENSE +%{python_sitelib}/* +%else %files -n python2-%{srcname} %doc README.rst %license LICENSE -%{python_sitelib}/* +%{python2_sitelib}/* %files -n python3-%{srcname} %doc README.rst %license LICENSE %{python3_sitelib}/* +%endif %changelog +* Thu Jan 21 2016 Ding-Yi Chen - 1.0.7-2 +- Add EPEL 6 and 7 support +- Revise Description + * Fri Jan 08 2016 Parag Nemade - 1.0.7-1 - Update to 1.0.7 upstream version - Remove all the optional things like %%clean, %%defattr,