]>
Commit | Line | Data |
---|---|---|
8668c912 MK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with doc # don't build doc | |
4 | %bcond_without 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 bcrypt | |
9 | Summary: Library for password hashing for your software and your servers | |
10 | Summary(pl.UTF-8): Biblioteka do tworzenia skrótów haseł dla twojego oprogramowania i serwerów | |
11 | Name: python-%{module} | |
12 | Version: 1.1.1 | |
d5a5d495 | 13 | Release: 2 |
8668c912 MK |
14 | License: Apache v2.0 |
15 | Group: Libraries/Python | |
16 | Source0: https://pypi.python.org/packages/source/b/bcrypt/%{module}-%{version}.tar.gz | |
17 | # Source0-md5: 43c5871c6bc7da1efe6a8bae25f90ad8 | |
18 | URL: https://github.com/dstufft/bcrypt/ | |
19 | BuildRequires: rpm-pythonprov | |
20 | # if py_postclean is used | |
21 | BuildRequires: rpmbuild(macros) >= 1.219 | |
22 | %if %{with python2} | |
b4d459de ER |
23 | BuildRequires: python-cffi |
24 | BuildRequires: python-d2to1 | |
8668c912 MK |
25 | BuildRequires: python-devel |
26 | BuildRequires: python-distribute | |
d5a5d495 MK |
27 | BuildRequires: python-py |
28 | BuildRequires: python-pytest | |
b4d459de | 29 | BuildRequires: python-six |
8668c912 MK |
30 | %endif |
31 | %if %{with python3} | |
b4d459de | 32 | BuildRequires: python3-cffi |
8668c912 MK |
33 | BuildRequires: python3-devel |
34 | BuildRequires: python3-distribute | |
35 | BuildRequires: python3-modules | |
d5a5d495 MK |
36 | BuildRequires: python3-py |
37 | BuildRequires: python3-pytest | |
b4d459de | 38 | BuildRequires: python3-six |
8668c912 | 39 | %endif |
d5a5d495 | 40 | Requires: python-cffi > 8.0 |
8668c912 | 41 | Requires: python-modules |
8668c912 MK |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
43 | ||
44 | %description | |
45 | This library should be compatible with py-bcrypt and it will run on | |
46 | Python 2.6, 2.7, 3.2, 3.3 and PyPy 2.0 | |
47 | ||
48 | %description -l pl.UTF-8 | |
49 | Biblioteka powinna byc kompatybilna z biblioteką py-bcrypt, działa dla | |
50 | Python 2.6, 2.7, 3.2, 3.3 and PyPy 2.0 | |
51 | ||
52 | %package -n python3-%{module} | |
53 | Summary: Library for password hashing for your software and your servers | |
54 | Summary(pl.UTF-8): Biblioteka do tworzenia skrótów haseł dla twojego oprogramowania i serwerów | |
55 | Group: Libraries/Python | |
8668c912 | 56 | Requires: python3-cffi > 0.8 |
d5a5d495 | 57 | Requires: python3-modules |
8668c912 MK |
58 | |
59 | %description -n python3-%{module} | |
60 | This library should be compatible with py-bcrypt and it will run on | |
61 | Python 2.6-3.4 and PyPy 2.0 | |
62 | ||
63 | %description -n python3-%{module} -l pl.UTF-8 | |
64 | Biblioteka powinna byc kompatybilna z biblioteką py-bcrypt, działa dla | |
65 | Python 2.6-3.4 and PyPy 2.0 | |
66 | ||
67 | %package apidocs | |
68 | Summary: %{module} API documentation | |
69 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
70 | Group: Documentation | |
71 | ||
72 | %description apidocs | |
73 | API documentation for %{module}. | |
74 | ||
75 | %description apidocs -l pl.UTF-8 | |
76 | Dokumentacja API %{module}. | |
77 | ||
78 | %prep | |
79 | %setup -q -n %{module}-%{version} | |
80 | ||
81 | %build | |
82 | %if %{with python2} | |
83 | CC="%{__cc}" \ | |
84 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ | |
85 | %{__python} setup.py build --build-base build-2 %{?with_tests:test} | |
86 | %endif | |
87 | ||
88 | %if %{with python3} | |
89 | CC="%{__cc}" \ | |
90 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ | |
91 | %{__python3} setup.py build --build-base build-3 %{?with_tests:test} | |
92 | %endif | |
93 | ||
94 | %if %{with doc} | |
95 | cd docs | |
96 | %{__make} -j1 html | |
97 | rm -rf _build/html/_sources | |
98 | %endif | |
99 | ||
100 | %install | |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
103 | %if %{with python2} | |
104 | %{__python} setup.py \ | |
105 | build --build-base build-2 \ | |
106 | install --skip-build \ | |
107 | --optimize=2 \ | |
108 | --root=$RPM_BUILD_ROOT | |
b4d459de | 109 | |
8668c912 | 110 | # Deleting crypt_blowfish-1.3 source files installed |
b4d459de | 111 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/crypt_blowfish-1.3 |
8668c912 MK |
112 | %py_postclean |
113 | ||
114 | %endif | |
115 | ||
116 | %if %{with python3} | |
117 | %{__python3} setup.py \ | |
118 | build --build-base build-3 \ | |
119 | install --skip-build \ | |
120 | --optimize=2 \ | |
121 | --root=$RPM_BUILD_ROOT | |
8668c912 | 122 | |
b4d459de ER |
123 | # Deleting crypt_blowfish-1.3 source files installed |
124 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/crypt_blowfish-1.3 | |
8668c912 MK |
125 | %endif |
126 | ||
127 | %clean | |
128 | rm -rf $RPM_BUILD_ROOT | |
129 | ||
130 | %if %{with python2} | |
131 | %files | |
132 | %defattr(644,root,root,755) | |
133 | %doc README.rst | |
134 | %dir %{py_sitedir}/%{module} | |
135 | %{py_sitedir}/%{module}/*.py[co] | |
136 | %attr(755,root,root) %{py_sitedir}/*.so | |
137 | %if "%{py_ver}" > "2.4" | |
138 | %{py_sitedir}/%{module}-%{version}-py*.egg-info | |
139 | %endif | |
140 | %endif | |
141 | ||
142 | %if %{with python3} | |
143 | %files -n python3-%{module} | |
144 | %defattr(644,root,root,755) | |
145 | %doc README.rst | |
146 | %attr(755,root,root) %{py3_sitedir}/*.so | |
147 | %{py3_sitedir}/%{module} | |
148 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
149 | %endif | |
150 | ||
151 | %if %{with doc} | |
152 | %files apidocs | |
153 | %defattr(644,root,root,755) | |
154 | %doc docs/_build/html/* | |
155 | %endif |