3 %bcond_with doc # don't build doc
4 %bcond_with tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
9 Summary: A Pure-Python library built as a PDF toolkit
10 Summary(pl.UTF-8): Czysto Pythonowa biblioteka narzędzi dla PDF
11 Name: python-%{module}
15 Group: Libraries/Python
16 Source0: https://pypi.python.org/packages/b4/01/68fcc0d43daf4c6bdbc6b33cc3f77bda531c86b174cac56ef0ffdb96faab/%{module}-%{version}.tar.gz
17 # Source0-md5: 2301acc0ecbab0633d4c9b883d50ee5e
18 URL: http://mstamy2.github.com/PyPDF2
19 BuildRequires: rpm-pythonprov
20 # for the py_build, py_install macros
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-modules
26 BuildRequires: python3-modules
28 Requires: python-modules
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 A Pure-Python library built as a PDF toolkit. It is capable of:
34 extracting document information (title, author, etc) splitting
35 documents page by page merging documents page by page cropping pages
36 merging multiple pages into a single page encrypting and decrypting
39 %description -l pl.UTF-8
40 Czysto Pythonowa bibliotek narzędziowa pozwalająca na: uzyskiwanie
41 informacji o dokumentach (tytuł, autor itp) dzielenie dokumentów na
42 strony sklejanie dokumentów z pojedynczych stron elimancje marginesów
43 sklejanie stron w jedną stronę szyfrowanie i odszyfrowywanie plików
46 %package -n python3-%{module}
47 Summary: A Pure-Python library built as a PDF toolkit
48 Summary(pl.UTF-8): Czysto Pythonowa biblioteka narzędzi dla PDF
49 Group: Libraries/Python
50 Requires: python3-modules
52 %description -n python3-%{module}
53 A Pure-Python library built as a PDF toolkit. It is capable of:
54 extracting document information (title, author, etc) splitting
55 documents page by page merging documents page by page cropping pages
56 merging multiple pages into a single page encrypting and decrypting
59 %description -n python3-%{module} -l pl.UTF-8
60 Czysto Pythonowa bibliotek narzędziowa pozwalająca na: uzyskiwanie
61 informacji o dokumentach (tytuł, autor itp) dzielenie dokumentów na
62 strony sklejanie dokumentów z pojedynczych stron elimancje marginesów
63 sklejanie stron w jedną stronę szyfrowanie i odszyfrowywanie plików
67 Summary: %{module} API documentation
68 Summary(pl.UTF-8): Dokumentacja API %{module}
72 API documentation for %{module}.
74 %description apidocs -l pl.UTF-8
75 Dokumentacja API %{module}.
78 %setup -q -n %{module}-%{version}
82 %py_build %{?with_tests:test}
86 %py3_build %{?with_tests:test}
92 rm -rf _build/html/_sources
96 rm -rf $RPM_BUILD_ROOT
101 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
102 cp -a Sample_Code/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
103 find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \
104 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
110 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
111 cp -a Sample_Code/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
112 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
113 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
117 rm -rf $RPM_BUILD_ROOT
121 %defattr(644,root,root,755)
122 %doc CHANGELOG README.md
123 %{py_sitescriptdir}/%{module}
124 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
125 %{_examplesdir}/%{name}-%{version}
129 %files -n python3-%{module}
130 %defattr(644,root,root,755)
131 %doc CHANGELOG README.md
132 %{py3_sitescriptdir}/%{module}
133 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
134 %{_examplesdir}/python3-%{module}-%{version}
139 %defattr(644,root,root,755)
140 %doc docs/_build/html/*