]>
Commit | Line | Data |
---|---|---|
160d84ec MK |
1 | # |
2 | # This is template for pure python modules (noarch) | |
3 | # use template-specs/python-ext.spec for binary python packages | |
4 | # | |
5 | # | |
6 | # Conditional build: | |
7 | %bcond_with doc # don't build doc | |
8 | # Fails on aetypes | |
9 | %bcond_with tests # do not perform "make test" | |
10 | %bcond_without python2 # CPython 2.x module | |
11 | %bcond_without python3 # CPython 3.x module | |
12 | ||
13 | # NOTES: | |
14 | # - 'module' should match the Python import path (first component?) | |
15 | # - 'egg_name' should equal to Python egg name | |
16 | # - 'pypi_name' must match the Python Package Index name | |
17 | %define module pbkdf2 | |
18 | %define egg_name pbkdf2 | |
19 | %define pypi_name pbkdf2 | |
20 | Summary: Python implementation of password-based key derivation function, PBKDF2 | |
21 | # Summary(pl.UTF-8): - | |
22 | Name: python-%{pypi_name} | |
23 | Version: 1.3 | |
e2a9605b | 24 | Release: 6 |
160d84ec MK |
25 | License: MIT |
26 | Group: Libraries/Python | |
27 | Source0: https://pypi.python.org/packages/02/c0/6a2376ae81beb82eda645a091684c0b0becb86b972def7849ea9066e3d5e/pbkdf2-%{version}.tar.gz | |
28 | # Source0-md5: 40cda566f61420490206597243dd869f | |
29 | URL: http://www.dlitz.net/software/python-pbkdf2/ | |
30 | #URL: https://pypi.python.org/pypi/MODULE | |
31 | BuildRequires: rpm-pythonprov | |
32 | BuildRequires: rpmbuild(macros) >= 1.714 | |
33 | %if %{with python2} | |
34 | BuildRequires: python-modules | |
35 | BuildRequires: python-setuptools | |
36 | %endif | |
37 | %if %{with python3} | |
38 | BuildRequires: python3-modules | |
39 | BuildRequires: python3-setuptools | |
40 | %endif | |
41 | # when using /usr/bin/env or other in-place substitutions | |
42 | #BuildRequires: sed >= 4.0 | |
43 | # replace with other requires if defined in setup.py | |
44 | Requires: python-modules | |
45 | BuildArch: noarch | |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
47 | ||
48 | %description | |
49 | Module which implements the password-based key derivation function, | |
50 | PBKDF2, specified in RSA PKCS#5 v2.0. | |
51 | ||
52 | # %description -l pl.UTF-8 | |
53 | ||
54 | %package -n python3-%{pypi_name} | |
55 | Summary: - | |
56 | Summary(pl.UTF-8): - | |
57 | Group: Libraries/Python | |
58 | Requires: python3-modules | |
59 | ||
60 | %description -n python3-%{pypi_name} | |
61 | ||
62 | %description -n python3-%{pypi_name} -l pl.UTF-8 | |
63 | ||
64 | %package apidocs | |
65 | Summary: API documentation for Python %{module} module | |
66 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module} | |
67 | Group: Documentation | |
68 | ||
69 | %description apidocs | |
70 | API documentation for Pythona %{module} module. | |
71 | ||
72 | %description apidocs -l pl.UTF-8 | |
73 | Dokumentacja API modułu Pythona %{module}. | |
74 | ||
75 | %prep | |
76 | %setup -q -n %{pypi_name}-%{version} | |
77 | ||
78 | %build | |
79 | %if %{with python2} | |
80 | %py_build %{?with_tests:test} | |
81 | %endif | |
82 | ||
83 | %if %{with python3} | |
84 | %py3_build %{?with_tests:test} | |
85 | %endif | |
86 | ||
87 | %if %{with doc} | |
88 | cd docs | |
89 | %{__make} -j1 html | |
90 | rm -rf _build/html/_sources | |
91 | %endif | |
92 | ||
93 | %install | |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
96 | %if %{with python2} | |
97 | %py_install | |
98 | ||
99 | # when files are installed in other way that standard 'setup.py | |
100 | # they need to be (re-)compiled | |
101 | # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages! | |
102 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
103 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
104 | ||
105 | %py_postclean | |
106 | %endif | |
107 | ||
108 | %if %{with python3} | |
109 | %py3_install | |
110 | %endif | |
111 | ||
112 | %clean | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %if %{with python2} | |
116 | %files | |
117 | %defattr(644,root,root,755) | |
118 | %doc README.txt | |
119 | %{py_sitescriptdir}/%{module}.pyo | |
120 | %{py_sitescriptdir}/%{module}.pyc | |
121 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
122 | %endif | |
123 | ||
124 | %if %{with python3} | |
125 | %files -n python3-%{pypi_name} | |
126 | %defattr(644,root,root,755) | |
127 | %doc README.txt | |
128 | %{py3_sitescriptdir}/%{module}.py | |
129 | %{py3_sitescriptdir}/__pycache__/%{module}.*.pyc | |
130 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
131 | %endif | |
132 | ||
133 | %if %{with doc} | |
134 | %files apidocs | |
135 | %defattr(644,root,root,755) | |
136 | %doc docs/_build/html/* | |
137 | %endif |