]> git.pld-linux.org Git - packages/python-PyPDF2.git/blame - python-PyPDF2.spec
rebuild with python 3.10
[packages/python-PyPDF2.git] / python-PyPDF2.spec
CommitLineData
1bac47b5 1#
3690c9ea 2# Conditional build:
9c9005f2
MK
3%bcond_with doc # don't build doc
4%bcond_with tests # do not perform "make test"
3690c9ea
MK
5%bcond_without python2 # CPython 2.x module
6%bcond_without python3 # CPython 3.x module
7
9c9005f2
MK
8%define module PyPDF2
9Summary: A Pure-Python library built as a PDF toolkit
10Summary(pl.UTF-8): Czysto Pythonowa biblioteka narzędzi dla PDF
3690c9ea 11Name: python-%{module}
9c9005f2 12Version: 1.26.0
61ca632b 13Release: 6
9c9005f2 14License: BSD
3690c9ea 15Group: Libraries/Python
1bac47b5 16Source0: https://pypi.python.org/packages/b4/01/68fcc0d43daf4c6bdbc6b33cc3f77bda531c86b174cac56ef0ffdb96faab/%{module}-%{version}.tar.gz
9c9005f2
MK
17# Source0-md5: 2301acc0ecbab0633d4c9b883d50ee5e
18URL: http://mstamy2.github.com/PyPDF2
3690c9ea
MK
19BuildRequires: rpm-pythonprov
20# for the py_build, py_install macros
21BuildRequires: rpmbuild(macros) >= 1.714
22%if %{with python2}
23BuildRequires: python-modules
3690c9ea
MK
24%endif
25%if %{with python3}
26BuildRequires: python3-modules
3690c9ea 27%endif
3690c9ea
MK
28Requires: python-modules
29BuildArch: noarch
30BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32%description
9c9005f2
MK
33A Pure-Python library built as a PDF toolkit. It is capable of:
34extracting document information (title, author, etc) splitting
35documents page by page merging documents page by page cropping pages
36merging multiple pages into a single page encrypting and decrypting
37PDF files and more!
3690c9ea
MK
38
39%description -l pl.UTF-8
9c9005f2
MK
40Czysto Pythonowa bibliotek narzędziowa pozwalająca na: uzyskiwanie
41informacji o dokumentach (tytuł, autor itp) dzielenie dokumentów na
42strony sklejanie dokumentów z pojedynczych stron elimancje marginesów
43sklejanie stron w jedną stronę szyfrowanie i odszyfrowywanie plików
44PDF.
3690c9ea
MK
45
46%package -n python3-%{module}
1bac47b5
ER
47Summary: A Pure-Python library built as a PDF toolkit
48Summary(pl.UTF-8): Czysto Pythonowa biblioteka narzędzi dla PDF
3690c9ea
MK
49Group: Libraries/Python
50Requires: python3-modules
51
52%description -n python3-%{module}
9c9005f2
MK
53A Pure-Python library built as a PDF toolkit. It is capable of:
54extracting document information (title, author, etc) splitting
55documents page by page merging documents page by page cropping pages
56merging multiple pages into a single page encrypting and decrypting
57PDF files and more!
3690c9ea
MK
58
59%description -n python3-%{module} -l pl.UTF-8
9c9005f2
MK
60Czysto Pythonowa bibliotek narzędziowa pozwalająca na: uzyskiwanie
61informacji o dokumentach (tytuł, autor itp) dzielenie dokumentów na
62strony sklejanie dokumentów z pojedynczych stron elimancje marginesów
63sklejanie stron w jedną stronę szyfrowanie i odszyfrowywanie plików
64PDF.
3690c9ea
MK
65
66%package apidocs
67Summary: %{module} API documentation
68Summary(pl.UTF-8): Dokumentacja API %{module}
69Group: Documentation
70
71%description apidocs
72API documentation for %{module}.
73
74%description apidocs -l pl.UTF-8
75Dokumentacja API %{module}.
76
77%prep
78%setup -q -n %{module}-%{version}
79
3690c9ea
MK
80%build
81%if %{with python2}
82%py_build %{?with_tests:test}
83%endif
84
85%if %{with python3}
86%py3_build %{?with_tests:test}
87%endif
88
89%if %{with doc}
90cd docs
91%{__make} -j1 html
92rm -rf _build/html/_sources
93%endif
94
95%install
96rm -rf $RPM_BUILD_ROOT
3690c9ea
MK
97%if %{with python2}
98%py_install
3690c9ea 99%py_postclean
3690c9ea 100
1bac47b5
ER
101install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
102cp -a Sample_Code/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version}
103find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \
104 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
3690c9ea 105%endif
eb4f9807 106
3690c9ea 107%if %{with python3}
eb4f9807
ER
108%py3_install
109
3690c9ea 110install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
9c9005f2 111cp -a Sample_Code/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
3690c9ea 112find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
1bac47b5 113 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
3690c9ea
MK
114%endif
115
116%clean
117rm -rf $RPM_BUILD_ROOT
118
119%if %{with python2}
120%files
121%defattr(644,root,root,755)
9c9005f2 122%doc CHANGELOG README.md
3690c9ea 123%{py_sitescriptdir}/%{module}
3690c9ea 124%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
3690c9ea
MK
125%{_examplesdir}/%{name}-%{version}
126%endif
127
128%if %{with python3}
129%files -n python3-%{module}
130%defattr(644,root,root,755)
9c9005f2 131%doc CHANGELOG README.md
3690c9ea
MK
132%{py3_sitescriptdir}/%{module}
133%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
134%{_examplesdir}/python3-%{module}-%{version}
135%endif
136
137%if %{with doc}
138%files apidocs
139%defattr(644,root,root,755)
140%doc docs/_build/html/*
141%endif
This page took 0.12951 seconds and 4 git commands to generate.