2ff095
%global srcname PyPDF2
df16d7
%global with_python3 1
65bf3e
%global sum Python PDF toolkit and library
df16d7
2ff095
Name:           python-%{srcname}
da4016
Version:        1.26.0
d1f6c2
Release:        10%{?dist}
df16d7
License:        BSD
65bf3e
Summary:        %{sum}
2ff095
Source:         https://pypi.python.org/packages/source/P/%{srcname}/%{srcname}-%{version}.tar.gz
df16d7
URL:            https://github.com/mstamy2/PyPDF2
df16d7
df16d7
BuildArch:      noarch
df16d7
df16d7
df16d7
%description
df16d7
A pure Python library built as a PDF toolkit.  It is capable of:
65bf3e
65bf3e
- extracting document information (title, author, ...),
65bf3e
- splitting documents page by page,
65bf3e
- merging documents page by page,
65bf3e
- cropping pages,
65bf3e
- merging multiple pages into a single page,
65bf3e
- encryption and decryption of PDF files.
65bf3e
65bf3e
By being pure Python, it should run on any Python platform without any
65bf3e
dependencies on external libraries.  It can also work entirely on StringIO
65bf3e
objects rather than file streams, allowing for PDF manipulation in memory.
65bf3e
It is therefore a useful tool for websites that manage or manipulate PDFs.
65bf3e
2ff095
%package -n python2-%{srcname}
65bf3e
Summary:        %{sum}
65bf3e
BuildRequires:  python2-devel
84cbfc
BuildRequires:  python2-libs
2ff095
Obsoletes:      python-%{srcname} <= 1.25.1-6
2ff095
%{?python_provide:%python_provide python2-%{srcname}}
65bf3e
65bf3e
2ff095
%description -n python2-%{srcname}
65bf3e
A pure Python library built as a PDF toolkit.  It is capable of:
65bf3e
df16d7
- extracting document information (title, author, ...),
df16d7
- splitting documents page by page,
df16d7
- merging documents page by page,
df16d7
- cropping pages,
df16d7
- merging multiple pages into a single page,
df16d7
- encryption and decryption of PDF files.
df16d7
df16d7
By being pure Python, it should run on any Python platform without any
df16d7
dependencies on external libraries.  It can also work entirely on StringIO
df16d7
objects rather than file streams, allowing for PDF manipulation in memory.
df16d7
It is therefore a useful tool for websites that manage or manipulate PDFs.
df16d7
2ff095
%package -n python3-%{srcname}
65bf3e
Summary:        %{sum}
65bf3e
BuildRequires:  python3-devel
84cbfc
BuildRequires:  python2-libs
2ff095
%{?python_provide:%python_provide python3-%{srcname}}
df16d7
65bf3e
2ff095
%description -n python3-%{srcname}
df16d7
A pure Python library built as a PDF toolkit.  It is capable of:
65bf3e
df16d7
- extracting document information (title, author, ...),
df16d7
- splitting documents page by page,
df16d7
- merging documents page by page,
df16d7
- cropping pages,
df16d7
- merging multiple pages into a single page,
df16d7
- encryption and decryption of PDF files.
df16d7
df16d7
By being pure Python, it should run on any Python platform without any
df16d7
dependencies on external libraries.  It can also work entirely on StringIO
df16d7
objects rather than file streams, allowing for PDF manipulation in memory.
df16d7
It is therefore a useful tool for websites that manage or manipulate PDFs.
df16d7
2ff095
%package -n python-%{srcname}-doc
2ff095
Summary:    Documentation for python-%{srcname}
df16d7
2ff095
%description -n python-%{srcname}-doc
df16d7
python-PyPDF2 contains documentation and examples for the python-PyPDF package
df16d7
df16d7
%prep
2ff095
%autosetup -n %{srcname}-%{version}
df16d7
df16d7
# non-executable script
65bf3e
sed -i -e '/^#!\//, 1d' PyPDF2/pagerange.py
df16d7
df16d7
# Lots of things in the repo shouldn't be executable
df16d7
chmod a-x Scripts/* Sample_Code/* LICENSE README.md CHANGELOG
df16d7
df16d7
65bf3e
%build
65bf3e
%py2_build
65bf3e
%py3_build
df16d7
df16d7
65bf3e
%install
65bf3e
%py3_install
65bf3e
%py2_install
df16d7
df16d7
df16d7
%check
df16d7
# NOTE: Upstream has some testing bugs
df16d7
#python -m unittest Tests.tests
df16d7
df16d7
2ff095
%files -n python2-%{srcname}
df16d7
%{python2_sitelib}/*
df16d7
%license LICENSE
df16d7
2ff095
%files -n python3-%{srcname}
df16d7
%{python3_sitelib}/*
df16d7
%license LICENSE
df16d7
2ff095
%files -n python-%{srcname}-doc
df16d7
%doc README.md CHANGELOG Scripts/ Sample_Code/
df16d7
%license LICENSE
df16d7
df16d7
%changelog
d1f6c2
* Sun Aug 18 2019 Miro Hron훾ok <mhroncok@redhat.com> - 1.26.0-10
d1f6c2
- Rebuilt for Python 3.8
d1f6c2
5b2508
* Sun Aug 18 2019 Miro Hron훾ok <mhroncok@redhat.com> - 1.26.0-9
5b2508
- Rebuilt for Python 3.8
5b2508
b38707
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.26.0-8
b38707
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
b38707
9dd4b0
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.26.0-7
9dd4b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
9dd4b0
b811be
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.26.0-6
b811be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
b811be
7c922f
* Tue Jun 19 2018 Miro Hron훾ok <mhroncok@redhat.com> - 1.26.0-5
7c922f
- Rebuilt for Python 3.7
7c922f
b20b1f
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.26.0-4
b20b1f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b20b1f
84cbfc
* Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.26.0-3
84cbfc
- Update Python 2 dependency declarations to new packaging standards
84cbfc
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
84cbfc
003422
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.26.0-2
003422
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
003422
da4016
* Wed Mar 22 2017 major <major@mhtx.net> - 1.26.0-1
da4016
- Upstream version 1.26.0
da4016
86c162
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.25.1-15
86c162
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
86c162
aacb49
* Mon Dec 19 2016 Miro Hron훾ok <mhroncok@redhat.com> - 1.25.1-14
aacb49
- Rebuild for Python 3.6
aacb49
ec61f9
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.1-13
ec61f9
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
ec61f9
2ff095
* Fri May 20 2016 Major Hayden <major@mhtx.net> - 1.25.1-12
2ff095
- Setting srcname variable so python_provide works properly
2ff095
- Removing Provides tag
2ff095
cf434a
* Fri May 20 2016 Major Hayden <major@mhtx.net> - 1.25.1-11
cf434a
- Adding Provides tag to fix dependency problems
cf434a
9fc8d0
* Thu May 19 2016 Major Hayden <major@mhtx.net> - 1.25.1-10
9fc8d0
- Correcting python_provides line for python2
9fc8d0
28a8a0
* Thu May 19 2016 Major Hayden <major@mhtx.net> - 1.25.1-9
28a8a0
- Removing srcname variable in Provides
28a8a0
53f73d
* Mon May 16 2016 Major Hayden <major@mhtx.net> - 1.25.1-8
53f73d
- Correcting typo
53f73d
c7f3c9
* Mon May 16 2016 Major Hayden <major@mhtx.net> - 1.25.1-7
c7f3c9
- Adding version number to obsoletes tag
c7f3c9
301e5b
* Thu May 5 2016 Major Hayden <major@mhtx.net> - 1.25.1-6
301e5b
- Adding obsoletes tag
301e5b
65bf3e
* Thu May 5 2016 Major Hayden <major@mhtx.net> - 1.25.1-5
65bf3e
- Fixed Python 3 packaging
65bf3e
e611d9
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.25.1-4
e611d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e611d9
399d68
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.1-3
399d68
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
399d68
df16d7
* Wed Sep 23 2015 Major Hayden <major@mhtx.net> - 1.25.1-2
df16d7
- Additional package review fixes
df16d7
df16d7
* Fri Sep 11 2015 Major Hayden <major@mhtx.net> - 1.25.1-1
df16d7
- Initial package