]> git.pld-linux.org Git - packages/python-PyPDF2.git/blob - python-PyPDF2.spec
rebuild with tests and docs
[packages/python-PyPDF2.git] / python-PyPDF2.spec
1 #
2 # Conditional build:
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
7
8 %define         module  PyPDF2
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}
12 Version:        1.26.0
13 Release:        8
14 License:        BSD
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
22 %if %{with python2}
23 BuildRequires:  python-modules
24 %endif
25 %if %{with python3}
26 BuildRequires:  python3-modules
27 %endif
28 Requires:       python-modules
29 BuildArch:      noarch
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
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
37 PDF files and more!
38
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
44 PDF.
45
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
51
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
57 PDF files and more!
58
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
64 PDF.
65
66 %package apidocs
67 Summary:        %{module} API documentation
68 Summary(pl.UTF-8):      Dokumentacja API %{module}
69 Group:          Documentation
70
71 %description apidocs
72 API documentation for %{module}.
73
74 %description apidocs -l pl.UTF-8
75 Dokumentacja API %{module}.
76
77 %prep
78 %setup -q -n %{module}-%{version}
79
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}
90 cd docs
91 %{__make} -j1 html
92 rm -rf _build/html/_sources
93 %endif
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97 %if %{with python2}
98 %py_install
99 %py_postclean
100
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}|'
105 %endif
106
107 %if %{with python3}
108 %py3_install
109
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}|'
114 %endif
115
116 %clean
117 rm -rf $RPM_BUILD_ROOT
118
119 %if %{with python2}
120 %files
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}
126 %endif
127
128 %if %{with python3}
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}
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.106806 seconds and 3 git commands to generate.