c615178
%global srcname polib
c615178
%global sum A library to parse and manage gettext catalogs
c615178
c615178
Name:           python-%{srcname}
c615178
Version:        1.0.7
93867e3
Release:        4%{?dist}
c615178
Summary:        %{sum}
c615178
279453f
License:        MIT
561737c
URL:            http://bitbucket.org/izi/polib/
c615178
Source0:        http://bitbucket.org/izi/polib/get/%{version}.tar.gz
279453f
279453f
BuildArch:      noarch
df75984
%if 0%{?el6}%{?el7}
df75984
BuildRequires:  python-devel
df75984
%else
df75984
BuildRequires:  python2-devel python-devel
df75984
%endif
279453f
279453f
%description
df75984
polib allows you to manipulate, create, modify gettext files (pot, po and
df75984
mo files). You can load existing files, iterate through it's entries, add,
df75984
modify entries, comments or metadata, etc... or create new po files from
df75984
scratch.
df75984
df75984
polib provides a simple and pythonic API, exporting only three convenience
df75984
functions 'pofile', 'mofile' and 'detect_encoding', and the 4 core classes:
df75984
POFile, MOFile, POEntry and MOEntry for creating new files/entries.
279453f
df75984
%if 0%{?el6}%{?el7}
df75984
%else
c615178
%package -n python2-%{srcname}
c615178
Summary:        %{sum}
df75984
BuildRequires:  python2-devel
c615178
%{?python_provide:%python_provide python2-%{srcname}}
c615178
c615178
%description -n python2-%{srcname}
df75984
Python 2 binding for python-polib
279453f
38e2496
c615178
%package -n python3-%{srcname}
c615178
Summary:        %{sum}
df75984
BuildRequires:  python3-devel
c615178
%{?python_provide:%python_provide python3-%{srcname}}
c615178
c615178
%description -n python3-%{srcname}
df75984
Python 3 binding for python-polib
df75984
%endif
38e2496
279453f
%prep
df75984
%if 0%{?el6}
df75984
%setup -q -n izi-polib-d75ce6dbbc2a
df75984
%else
c615178
%autosetup -n izi-polib-d75ce6dbbc2a
df75984
%endif
38e2496
279453f
%build
df75984
%if 0%{?el6}%{?el7}
df75984
%{__python} setup.py build
df75984
%else
c615178
%py2_build
c615178
%py3_build
df75984
%endif
38e2496
279453f
%install
df75984
%if 0%{?el6}%{?el7}
df75984
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
df75984
%else
c615178
%py2_install
c615178
%py3_install
df75984
%endif
38e2496
df75984
%if ! 0%{?el6}%{?el7}
c615178
%check
df75984
%{__python} setup.py test
c615178
%{__python2} setup.py test
c615178
%{__python3} setup.py test
df75984
%endif
279453f
df75984
%if 0%{?el6}%{?el7}
df75984
%files
df75984
%defattr(-,root,root,-)
df75984
%doc README.rst LICENSE
df75984
%{python_sitelib}/*
df75984
%else
c615178
%files -n python2-%{srcname}
c615178
%doc README.rst
c615178
%license LICENSE
df75984
%{python2_sitelib}/*
279453f
df6d0a9
%files -n python3-%{srcname}
c615178
%doc README.rst
c615178
%license LICENSE
38e2496
%{python3_sitelib}/*
df75984
%endif
38e2496
279453f
%changelog
93867e3
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.7-4
93867e3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
93867e3
743db83
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.7-3
743db83
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
743db83
df75984
* Thu Jan 21 2016 Ding-Yi Chen <dchen@redhat.com> - 1.0.7-2
df75984
- Add EPEL 6 and 7 support
df75984
- Revise Description
df75984
8d22776
* Fri Jan 08 2016 Parag Nemade <pnemade AT redhat DOT com> - 1.0.7-1
c615178
- Update to 1.0.7 upstream version
c615178
- Remove all the optional things like %%clean, %%defattr,
c615178
  buildroot and group tags
c615178
- use %%license tag 
c615178
- updated to use current python packaging guidelines
c615178
Robert Kuska 1541ab0
* Wed Oct 14 2015 Robert Kuska <rkuska@redhat.com> - 1.0.3-7
Robert Kuska 1541ab0
- Rebuilt for Python3.5 rebuild
Robert Kuska 1541ab0
2545d26
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.3-6
2545d26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2545d26
7c4a2ab
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.3-5
7c4a2ab
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
7c4a2ab
f74f6f5
* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.0.3-4
f74f6f5
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
f74f6f5
5bb4b58
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.3-3
5bb4b58
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
5bb4b58
16d1f70
* Tue Jul 16 2013 Ding-Yi Chen <dchen@redhat.com> - 1.0.3-2
16d1f70
- Fix the build for EL6 and EL5 (without python3-polib)
16d1f70
12556cd
* Tue Jul 16 2013 Ding-Yi Chen <dchen@redhat.com> - 1.0.3-1
38e2496
- python3 binding is available (python3-polib)
c183f68
- Fixed Bug 978672 - This package should be updated.
12556cd
- Upstream update to 1.0.3
12556cd
- Version 1.0.3 (2013/02/09)
12556cd
  Fixed issue #38: POFile.append() raised a duplicate exception when you tried to add a new entry with the same msgid and a different msgctxt (only when check_for_duplicates option is set to True)
12556cd
  Fixed issue #39: Added __init__.py file for convenience
12556cd
  Fixed issue #41: UnicodeDecodeError when running setup.py build on python3 with C locale
12556cd
  polib is now fully PEP8 compliant
12556cd
  Small improvements: remove unused "typ" var (thanks Rodrigo Silva), mproved Makefile, Make sure _BaseFile.__contains__ returns a boolean value
12556cd
12556cd
- Version 1.0.2 (2012/10/23)
12556cd
  allow empty comments, flags or occurences lines
12556cd
12556cd
- Version 1.0.1 (2012/09/11)
12556cd
  speed up POFile.merge method (thanks @encukou)
12556cd
  allow comments starting with two '#' characters (thanks @goibhniu)
12556cd
7f2d874
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-2
7f2d874
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
7f2d874
784039b
* Mon Jul 30 2012 Ding-Yi Chen <dchen@redhat.com> - 1.0.0-1
784039b
- Upstream update to 1.0.0
784039b
9b8e723
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-4
9b8e723
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
9b8e723
d34a590
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-3
d34a590
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
d34a590
2af1362
* Tue Nov 01 2011 Ding-Yi Chen <dchen@redhat.com> - 0.7.0-2
2af1362
- Update to upstream commit dbafdc621bf4, which include following:
2af1362
  * Add check for unescaped quotes at the beginning of the string + unit tests
2af1362
  * Fixed issue #27 (polib didn't check unescaped double quote) + better error handling
2af1362
  * Fixed typos in previous commit
2af1362
  * Fixed issue #26 IOError when parsing empty comments (thanks Türker Sezer)
2af1362
  * Do not hardcode polib version in doc conf
2af1362
561737c
* Fri Oct 28 2011 Ding-Yi Chen <dchen@redhat.com> - 0.7.0-1
561737c
- Correct URLs
561737c
- Replace README with README.rst
561737c
- Update to 0.7.0:
561737c
  From Version 0.7.0 (2011/07/14)
561737c
      This version adds support for python 3 (thanks to Vinay Sajip).
561737c
      polib now supports out-of-the-box any version of python ranging 
561737c
      from 2.4 to latest 3.X version.
561737c
  From Version 0.6.4 (2011/07/13)
561737c
      * Better api, autodetected_encoding is no longer required to 
561737c
        explicitely set the encoding (fixes issue #23),
561737c
      * Fixed issue #24 Support indented PO files (thanks to 
561737c
        François Poirotte).
561737c
  From Version 0.6.3 (2011/02/19)
561737c
      * Fixed issue #19 (Disappearing newline characters due to 
561737c
        textwrap module),
561737c
      * ensure wrapping works as expected.
561737c
  From Version 0.6.2 (2011/02/09)
561737c
      * Backported textwrap.TextWrapper._wrap_chunks that has support
561737c
        for the drop_whitespace parameter added in Python 2.6 (Fixes 
561737c
        #18: broken compatibility with python 2.5, thanks @jezdez).
561737c
  From Version 0.6.1 (2011/02/09)
561737c
      * fixed regression that prevented POFile initialization from 
561737c
        data to work (issue #17).
561737c
  From Version 0.6.0 (2011/02/07)
561737c
      * polib is now fully documented,
561737c
      * switched from doctests to unit tests to keep the polib.py 
561737c
        file clean,
561737c
      * fixed issue #7 (wrapping issues, thanks @jezdez),
561737c
      * added a __eq__ method to _BaseFile (thanks @kost BebiX),
561737c
      * handle msgctxt correctly when compiling mo files,
561737c
      * compiled mo files are now exactly the same as those compiled
561737c
        by msgfmt without using hash tables.
561737c
  From Version 0.5.5 (2010/10/30)
561737c
      * Removed multiline handling code, it was a mess and was the
561737c
        source of potential bugs like issue #11,
561737c
      * Fixed typo in README and CHANGELOG, fixes issue #13.
561737c
  From Version 0.5.4 (2010/10/02)
561737c
     * fixed an issue with detect_encoding(), in some cases it could
561737c
       return an invalid charset.
561737c
  From Version 0.5.3 (2010/08/29)
561737c
     * correctly unescape lines containing both \\n and \n 
561737c
      (thanks to Martin Geisler),
561737c
     * fixed issue #6: __str__() methods are returning unicode instead
561737c
       of str,
561737c
     * fixed issue #8: POFile.merge error when an entry is obsolete in
561737c
       a .po, that this entry reappears in the .pot and that we merge 
561737c
       the two,
561737c
     * added support to instanciate POFile objects using data instead 
561737c
       of file path (thanks to Diego Búrigo Zacarão),
561737c
     * fixed issue #9: POFile.merge drop fuzzy attributes from 
561737c
       translations (thanks to Tim Gerundt),
561737c
     * fixed issue #10: Finding entries with the same msgid and 
561737c
       different context (msgctxt).
561737c
  From Version 0.5.2 (2010/06/09)
561737c
     * fixed issue #1: untranslated_entries() also show fuzzy message,
561737c
     * write back the fuzzy header if present in the pofile,
561737c
     * added support for previous msgctxt, previous msgid and previous
561737c
       msgid_plural comments (fixes issue #5),
561737c
     * better handling of lines wrapping.
561737c
11a6350
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-3
11a6350
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
11a6350
cebb55c
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.5.1-2
cebb55c
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
cebb55c
143f524
* Mon Dec 14 2009 Diego Búrigo Zacarão <diegobz@gmail.com> - 0.5.1-1
143f524
- Updated to 0.5.1 release
143f524
86090d0
* Wed Aug 19 2009 Diego Búrigo Zacarão <diegobz@gmail.com> - 0.4.2-1
86090d0
- Updated to 0.4.2 release
86090d0
496560e
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-2.20080217svnr60
496560e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
496560e
279453f
* Wed Feb 18 2009 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> 0.4.0-1.20080217svnr60
279453f
- Initial RPM release
279453f