]>
Commit | Line | Data |
---|---|---|
8668c912 MK |
1 | # |
2 | # Conditional build: | |
6690e1f2 | 3 | %bcond_without tests # unit tests |
8668c912 MK |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
aa948903 | 7 | %define module bcrypt |
8668c912 | 8 | Summary: Library for password hashing for your software and your servers |
6690e1f2 | 9 | Summary(pl.UTF-8): Biblioteka do tworzenia skrótów haseł dla programów i serwerów |
8668c912 | 10 | Name: python-%{module} |
6690e1f2 | 11 | Version: 3.1.7 |
6064e45a | 12 | Release: 5 |
8668c912 MK |
13 | License: Apache v2.0 |
14 | Group: Libraries/Python | |
6690e1f2 JB |
15 | #Source0Download: https://pypi.org/simple/bcrypt/ |
16 | Source0: https://files.pythonhosted.org/packages/source/b/bcrypt/%{module}-%{version}.tar.gz | |
17 | # Source0-md5: 5d6f93b575ce52470af37a8e7dce76fe | |
8668c912 | 18 | URL: https://github.com/dstufft/bcrypt/ |
8668c912 | 19 | %if %{with python2} |
6690e1f2 JB |
20 | BuildRequires: python-cffi >= 1.1 |
21 | BuildRequires: python-devel >= 1:2.7 | |
22 | BuildRequires: python-setuptools | |
23 | %if %{with tests} | |
24 | BuildRequires: python-pytest >= 3.2.1 | |
25 | BuildRequires: python-six >= 1.4.1 | |
26 | %endif | |
8668c912 MK |
27 | %endif |
28 | %if %{with python3} | |
6690e1f2 JB |
29 | BuildRequires: python3-cffi >= 1.1 |
30 | BuildRequires: python3-devel >= 1:3.4 | |
31 | BuildRequires: python3-setuptools | |
32 | %if %{with tests} | |
33 | BuildRequires: python3-pytest >= 3.2.1 | |
34 | BuildRequires: python3-six >= 1.4.1 | |
8668c912 | 35 | %endif |
6690e1f2 JB |
36 | %endif |
37 | BuildRequires: rpm-pythonprov | |
38 | BuildRequires: rpmbuild(macros) >= 1.714 | |
39 | Requires: python-modules >= 1:2.7 | |
8668c912 MK |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
41 | ||
42 | %description | |
6690e1f2 | 43 | This library should be compatible with py-bcrypt. |
8668c912 MK |
44 | |
45 | %description -l pl.UTF-8 | |
6690e1f2 | 46 | Biblioteka powinna być zgodna z biblioteką py-bcrypt. |
8668c912 MK |
47 | |
48 | %package -n python3-%{module} | |
49 | Summary: Library for password hashing for your software and your servers | |
6690e1f2 | 50 | Summary(pl.UTF-8): Biblioteka do tworzenia skrótów haseł dla programów i serwerów |
8668c912 | 51 | Group: Libraries/Python |
6690e1f2 | 52 | Requires: python3-modules >= 1:3.4 |
8668c912 MK |
53 | |
54 | %description -n python3-%{module} | |
6690e1f2 | 55 | This library should be compatible with py-bcrypt. |
8668c912 MK |
56 | |
57 | %description -n python3-%{module} -l pl.UTF-8 | |
6690e1f2 | 58 | Biblioteka powinna być zgodna z biblioteką py-bcrypt. |
8668c912 MK |
59 | |
60 | %prep | |
61 | %setup -q -n %{module}-%{version} | |
62 | ||
63 | %build | |
64 | %if %{with python2} | |
4ba1cbb2 | 65 | %py_build %{?with_tests:test} |
8668c912 MK |
66 | %endif |
67 | ||
68 | %if %{with python3} | |
4ba1cbb2 | 69 | %py3_build %{?with_tests:test} |
8668c912 MK |
70 | %endif |
71 | ||
8668c912 MK |
72 | %install |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %if %{with python2} | |
4ba1cbb2 | 76 | %py_install |
b4d459de | 77 | |
8668c912 | 78 | %py_postclean |
8668c912 MK |
79 | %endif |
80 | ||
81 | %if %{with python3} | |
4ba1cbb2 | 82 | %py3_install |
8668c912 MK |
83 | %endif |
84 | ||
85 | %clean | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %if %{with python2} | |
89 | %files | |
90 | %defattr(644,root,root,755) | |
91 | %doc README.rst | |
6690e1f2 | 92 | %dir %{py_sitedir}/bcrypt |
f663ae85 | 93 | %attr(755,root,root) %{py_sitedir}/bcrypt/*.so |
6690e1f2 JB |
94 | %{py_sitedir}/bcrypt/*.py[co] |
95 | %{py_sitedir}/bcrypt-%{version}-py*.egg-info | |
8668c912 MK |
96 | %endif |
97 | ||
98 | %if %{with python3} | |
99 | %files -n python3-%{module} | |
100 | %defattr(644,root,root,755) | |
101 | %doc README.rst | |
6690e1f2 | 102 | %dir %{py3_sitedir}/bcrypt |
f663ae85 | 103 | %attr(755,root,root) %{py3_sitedir}/bcrypt/*.so |
6690e1f2 JB |
104 | %{py3_sitedir}/bcrypt/*.py |
105 | %{py3_sitedir}/bcrypt/__pycache__ | |
106 | %{py3_sitedir}/bcrypt-%{version}-py*.egg-info | |
8668c912 | 107 | %endif |