]>
Commit | Line | Data |
---|---|---|
b4fd8b9a JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # unit tests (data missing in release tarball?) | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: PDF file reader/writer library | |
8 | Summary(pl.UTF-8): Biblioteka do odczytu/zapisu plików PDF | |
9 | Name: python-pdfrw | |
10 | Version: 0.4 | |
2e6aa834 | 11 | Release: 6 |
b4fd8b9a JB |
12 | License: MIT |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/pdfrw/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/p/pdfrw/pdfrw-%{version}.tar.gz | |
16 | # Source0-md5: eaf97243d3634cac954527904dcdecae | |
17 | URL: https://pypi.org/project/pdfrw/ | |
18 | %if %{with python2} | |
19 | BuildRequires: python-modules >= 1:2.6 | |
20 | BuildRequires: python-setuptools | |
21 | %endif | |
22 | %if %{with python3} | |
23 | BuildRequires: python3-modules >= 1:3.3 | |
24 | BuildRequires: python3-setuptools | |
25 | %endif | |
26 | BuildRequires: rpm-pythonprov | |
27 | BuildRequires: rpmbuild(macros) >= 1.714 | |
28 | Requires: python-modules >= 1:2.6 | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | pdfrw is a Python library and utility that reads and writes PDF files: | |
34 | - Operations include subsetting, merging, rotating, modifying metadata | |
35 | - The fastest pure Python PDF parser available | |
36 | - Has been used for years by a printer in pre-press production | |
37 | - Can be used with rst2pdf to faithfully reproduce vector images | |
38 | - Can be used either standalone, or in conjunction with reportlab | |
39 | to reuse existing PDFs in new ones | |
40 | - Permissively licensed | |
41 | ||
42 | %description -l pl.UTF-8 | |
43 | pdfrw to biblioteka i narzędzia Pythona do odczytu i zapisu plików | |
44 | PDF: | |
45 | - operacje obejmują wyciąganie fragmentów, łączenie, obracanie, | |
46 | modyfikowanie metadanych | |
47 | - najszybszy dostępny czysto pythonowy parser formatu PDF | |
48 | - używane latami w procesie przygotowywania do druku | |
49 | - mogą być używane z rst2pdf do wiernej reprodukcji obrazów | |
50 | wektorowych | |
51 | - mogą być używane samodzielnie lub w połączeniu z reportlabem do | |
52 | wykorzystywania istniejących plików PDF do tworzenia nowych | |
53 | - wydane na nierestrykcyjnej licencji | |
54 | ||
55 | %package -n python3-pdfrw | |
56 | Summary: PDF file reader/writer library | |
57 | Summary(pl.UTF-8): Biblioteka do odczytu/zapisu plików PDF | |
58 | Group: Libraries/Python | |
59 | Requires: python3-modules >= 1:3.3 | |
60 | ||
61 | %description -n python3-pdfrw | |
62 | pdfrw is a Python library and utility that reads and writes PDF files: | |
63 | - Operations include subsetting, merging, rotating, modifying metadata | |
64 | - The fastest pure Python PDF parser available | |
65 | - Has been used for years by a printer in pre-press production | |
66 | - Can be used with rst2pdf to faithfully reproduce vector images | |
67 | - Can be used either standalone, or in conjunction with reportlab | |
68 | to reuse existing PDFs in new ones | |
69 | - Permissively licensed | |
70 | ||
71 | %description -n python3-pdfrw -l pl.UTF-8 | |
72 | pdfrw to biblioteka i narzędzia Pythona do odczytu i zapisu plików | |
73 | PDF: | |
74 | - operacje obejmują wyciąganie fragmentów, łączenie, obracanie, | |
75 | modyfikowanie metadanych | |
76 | - najszybszy dostępny czysto pythonowy parser formatu PDF | |
77 | - używane latami w procesie przygotowywania do druku | |
78 | - mogą być używane z rst2pdf do wiernej reprodukcji obrazów | |
79 | wektorowych | |
80 | - mogą być używane samodzielnie lub w połączeniu z reportlabem do | |
81 | wykorzystywania istniejących plików PDF do tworzenia nowych | |
82 | - wydane na nierestrykcyjnej licencji | |
83 | ||
84 | %prep | |
85 | %setup -q -n pdfrw-%{version} | |
86 | ||
87 | %build | |
88 | %if %{with python2} | |
89 | %py_build | |
90 | ||
91 | %if %{with tests} | |
92 | %{__python} -m unittest discover -s tests | |
93 | %endif | |
94 | %endif | |
95 | ||
96 | %if %{with python3} | |
97 | %py3_build | |
98 | ||
99 | %if %{with tests} | |
100 | %{__python3} -m unittest discover -s tests | |
101 | %endif | |
102 | %endif | |
103 | ||
104 | %install | |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
107 | %if %{with python2} | |
108 | %py_install | |
109 | ||
110 | %py_postclean | |
111 | ||
112 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
113 | cp -pr examples $RPM_BUILD_ROOT%{_examplesdir}/python-pdfrw-%{version} | |
114 | %{__sed} -i -e '1s,/usr/bin/env python$,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/python-pdfrw-%{version}{,/rl[12]}/*.py | |
115 | %endif | |
116 | ||
117 | %if %{with python3} | |
118 | %py3_install | |
119 | ||
120 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
121 | cp -pr examples $RPM_BUILD_ROOT%{_examplesdir}/python3-pdfrw-%{version} | |
122 | %{__sed} -i -e '1s,/usr/bin/env python$,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-pdfrw-%{version}{,/rl[12]}/*.py | |
123 | %endif | |
124 | ||
125 | %clean | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
128 | %if %{with python2} | |
129 | %files | |
130 | %defattr(644,root,root,755) | |
131 | %doc LICENSE.txt README.rst | |
132 | %{py_sitescriptdir}/pdfrw | |
133 | %{py_sitescriptdir}/pdfrw-%{version}-py*.egg-info | |
134 | %{_examplesdir}/python-pdfrw-%{version} | |
135 | %endif | |
136 | ||
137 | %if %{with python3} | |
138 | %files -n python3-pdfrw | |
139 | %defattr(644,root,root,755) | |
140 | %doc LICENSE.txt README.rst | |
141 | %{py3_sitescriptdir}/pdfrw | |
142 | %{py3_sitescriptdir}/pdfrw-%{version}-py*.egg-info | |
143 | %{_examplesdir}/python3-pdfrw-%{version} | |
144 | %endif |