Blob Blame History Raw
%global with_python3 1
%global sum Python PDF toolkit and library

Name:           python-PyPDF2
Version:        1.25.1
Release:        9%{?dist}
License:        BSD
Summary:        %{sum}
Group:          Development/Libraries
Source:         https://pypi.python.org/packages/source/P/PyPDF2/PyPDF2-%{version}.tar.gz
URL:            https://github.com/mstamy2/PyPDF2

BuildArch:      noarch


%description
A pure Python library built as a PDF toolkit.  It is capable of:

- extracting document information (title, author, ...),
- splitting documents page by page,
- merging documents page by page,
- cropping pages,
- merging multiple pages into a single page,
- encryption and decryption of PDF files.

By being pure Python, it should run on any Python platform without any
dependencies on external libraries.  It can also work entirely on StringIO
objects rather than file streams, allowing for PDF manipulation in memory.
It is therefore a useful tool for websites that manage or manipulate PDFs.

%package -n python2-PyPDF2
Summary:        %{sum}
BuildRequires:  python2-devel
BuildRequires:  python-libs
Obsoletes:      python-PyPDF2 <= 1.25.1-6
%{?python_provide:%python_provide python2-PyPDF}


%description -n python2-PyPDF2
A pure Python library built as a PDF toolkit.  It is capable of:

- extracting document information (title, author, ...),
- splitting documents page by page,
- merging documents page by page,
- cropping pages,
- merging multiple pages into a single page,
- encryption and decryption of PDF files.

By being pure Python, it should run on any Python platform without any
dependencies on external libraries.  It can also work entirely on StringIO
objects rather than file streams, allowing for PDF manipulation in memory.
It is therefore a useful tool for websites that manage or manipulate PDFs.

%package -n python3-PyPDF2
Summary:        %{sum}
BuildRequires:  python3-devel
BuildRequires:  python-libs
%{?python_provide:%python_provide python3-PyPDF2}


%description -n python3-PyPDF2
A pure Python library built as a PDF toolkit.  It is capable of:

- extracting document information (title, author, ...),
- splitting documents page by page,
- merging documents page by page,
- cropping pages,
- merging multiple pages into a single page,
- encryption and decryption of PDF files.

By being pure Python, it should run on any Python platform without any
dependencies on external libraries.  It can also work entirely on StringIO
objects rather than file streams, allowing for PDF manipulation in memory.
It is therefore a useful tool for websites that manage or manipulate PDFs.

%package -n python-PyPDF2-doc
Summary:    Documentation for python-PyPDF2

%description -n python-PyPDF2-doc
python-PyPDF2 contains documentation and examples for the python-PyPDF package

%prep
%autosetup -n PyPDF2-%{version}

# non-executable script
sed -i -e '/^#!\//, 1d' PyPDF2/pagerange.py

# Lots of things in the repo shouldn't be executable
chmod a-x Scripts/* Sample_Code/* LICENSE README.md CHANGELOG


%build
%py2_build
%py3_build


%install
%py3_install
%py2_install


%check
# NOTE: Upstream has some testing bugs
#python -m unittest Tests.tests


%files -n python2-PyPDF2
%defattr(-,root,root,-)
%{python2_sitelib}/*
%license LICENSE

%files -n python3-PyPDF2
%defattr(-,root,root,-)
%{python3_sitelib}/*
%license LICENSE

%files -n python-PyPDF2-doc
%doc README.md CHANGELOG Scripts/ Sample_Code/
%license LICENSE

%changelog
* Thu May 19 2016 Major Hayden <major@mhtx.net> - 1.25.1-9
- Removing srcname variable in Provides

* Mon May 16 2016 Major Hayden <major@mhtx.net> - 1.25.1-8
- Correcting typo

* Mon May 16 2016 Major Hayden <major@mhtx.net> - 1.25.1-7
- Adding version number to obsoletes tag

* Thu May 5 2016 Major Hayden <major@mhtx.net> - 1.25.1-6
- Adding obsoletes tag

* Thu May 5 2016 Major Hayden <major@mhtx.net> - 1.25.1-5
- Fixed Python 3 packaging

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.25.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.1-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Wed Sep 23 2015 Major Hayden <major@mhtx.net> - 1.25.1-2
- Additional package review fixes

* Fri Sep 11 2015 Major Hayden <major@mhtx.net> - 1.25.1-1
- Initial package