From c61517892074119523e4a4faab0f805f6b2fe265 Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Jan 08 2016 15:52:29 +0000 Subject: Update to 1.0.7 upstream version - Remove all the optional things like %clean, %defattr, buildroot and group tags - use %license tag - updated to use current python packaging guidelines --- diff --git a/.gitignore b/.gitignore index aedc3d3..c05687d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ polib-0.5.1.tar.gz /polib-1.0.0.tar.gz /polib-1.0.3.tar.gz +/1.0.7.tar.gz diff --git a/python-polib.spec b/python-polib.spec index a8b2c54..75903d3 100644 --- a/python-polib.spec +++ b/python-polib.spec @@ -1,51 +1,34 @@ -%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} - -%if 0%{?rhel} -%if 0%{?rhel} <= 5 - %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} -%endif -%else %if 0%{?fedora} -%if 0%{?fedora} >12 -%global with_python3 1 -%else -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} -%endif -%endif - -Name: python-polib -Version: 1.0.3 -Release: 7%{?dist} -Summary: A library to parse and manage gettext catalogs - -Group: Development/Languages +%global srcname polib +%global sum A library to parse and manage gettext catalogs + +Name: python-%{srcname} +Version: 1.0.7 +Release: 1%{?dist} +Summary: %{sum} + License: MIT URL: http://bitbucket.org/izi/polib/ -Source0: http://bitbucket.org/izi/polib/downloads/polib-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -#Patch0: polib-%{version}_dbafdc621bf4.patch +Source0: http://bitbucket.org/izi/polib/get/%{version}.tar.gz BuildArch: noarch -BuildRequires: python-devel +BuildRequires: python2-devel python3-devel %description -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. +An python module which provides a convenient example. -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} +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-%{srcname} +An python module which provides a convenient example. -%if 0%{?with_python3} -%package -n python3-polib -Summary: A library to parse and manage gettext catalogs in python 3 -Group: Development/Languages -BuildRequires: python3-devel -Requires: %{name} = %{version}-%{release} -%description -n python3-polib +%package -n python3-%{srcname} +Summary: %{sum} +%{?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 @@ -54,65 +37,40 @@ 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. -%endif %prep -%setup -q -n polib-%{version} -#%patch0 -p1 -b .%{version}_dbafdc621bf4 - -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' -%endif +%autosetup -n izi-polib-d75ce6dbbc2a %build -%{__python} setup.py build - -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build -popd -%endif - -%check -%if 0%{?fedora} -%{__python} setup.py check - -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py check -popd -%endif -%endif +%py2_build +%py3_build %install -rm -rf $RPM_BUILD_ROOT -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT - - -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT -popd -%endif +%py2_install +%py3_install -%clean -rm -rf $RPM_BUILD_ROOT +%check +%{__python2} setup.py test +%{__python3} setup.py test -%files -%defattr(-,root,root,-) -%doc LICENSE README.rst +%files -n python2-%{srcname} +%doc README.rst +%license LICENSE %{python_sitelib}/* -%if 0%{?with_python3} -%files -n python3-polib -%defattr(-,root,root,-) -%doc LICENSE README.rst +%files -n python2-%{srcname} +%doc README.rst +%license LICENSE %{python3_sitelib}/* -%endif %changelog +* Fri Jan 08 2015 Robert Kuska - 1.0.7-1 +- Update to 1.0.7 upstream version +- Remove all the optional things like %%clean, %%defattr, + buildroot and group tags +- use %%license tag +- updated to use current python packaging guidelines + * Wed Oct 14 2015 Robert Kuska - 1.0.3-7 - Rebuilt for Python3.5 rebuild diff --git a/sources b/sources index ce1b95b..635d885 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dc9dc39d4053cfe030155891f3043cb1 polib-1.0.3.tar.gz +270110a7010425738e9a08832c5cba4f 1.0.7.tar.gz