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