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
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}
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
23 BuildRequires: python-devel
24 BuildRequires: python-distribute
25 BuildRequires: python-py
26 BuildRequires: python-pytest
29 BuildRequires: python3-devel
30 BuildRequires: python3-distribute
31 BuildRequires: python3-modules
32 BuildRequires: python3-py
33 BuildRequires: python3-pytest
35 # Below Rs only work for main package (python2)
36 Requires: python-cffi > 8.0
37 #Requires: python-libs
38 Requires: python-modules
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 This library should be compatible with py-bcrypt and it will run on
44 Python 2.6, 2.7, 3.2, 3.3 and PyPy 2.0
46 %description -l pl.UTF-8
47 Biblioteka powinna byc kompatybilna z biblioteką py-bcrypt, działa dla
48 Python 2.6, 2.7, 3.2, 3.3 and PyPy 2.0
50 %package -n python3-%{module}
51 Summary: Library for password hashing for your software and your servers
52 Summary(pl.UTF-8): Biblioteka do tworzenia skrótów haseł dla twojego oprogramowania i serwerów
53 Group: Libraries/Python
54 Requires: python3-cffi > 0.8
55 Requires: python3-modules
57 %description -n python3-%{module}
58 This library should be compatible with py-bcrypt and it will run on
59 Python 2.6-3.4 and PyPy 2.0
61 %description -n python3-%{module} -l pl.UTF-8
62 Biblioteka powinna byc kompatybilna z biblioteką py-bcrypt, działa dla
63 Python 2.6-3.4 and PyPy 2.0
66 Summary: %{module} API documentation
67 Summary(pl.UTF-8): Dokumentacja API %{module}
71 API documentation for %{module}.
73 %description apidocs -l pl.UTF-8
74 Dokumentacja API %{module}.
77 %setup -q -n %{module}-%{version}
82 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
83 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
88 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
89 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
95 rm -rf _build/html/_sources
99 rm -rf $RPM_BUILD_ROOT
102 %{__python} setup.py \
103 build --build-base build-2 \
104 install --skip-build \
106 --root=$RPM_BUILD_ROOT
107 # Deleting crypt_blowfish-1.3 source files installed
108 %{__rm} $RPM_BUILD_ROOT/%{py_sitedir}/%{module}/crypt_blowfish-1.3/*
109 %{__rmdir} $RPM_BUILD_ROOT/%{py_sitedir}/%{module}/crypt_blowfish-1.3/
115 %{__python3} setup.py \
116 build --build-base build-3 \
117 install --skip-build \
119 --root=$RPM_BUILD_ROOT
120 # Deleting crypt_blowfish-1.3 source files installed
121 %{__rm} $RPM_BUILD_ROOT/%{py3_sitedir}/%{module}/crypt_blowfish-1.3/*
122 %{__rmdir} $RPM_BUILD_ROOT/%{py3_sitedir}/%{module}/crypt_blowfish-1.3/
125 # in case there are examples provided
127 # install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
128 # cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
131 # install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
132 # cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
133 # find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
134 # | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
138 rm -rf $RPM_BUILD_ROOT
142 %defattr(644,root,root,755)
144 %dir %{py_sitedir}/%{module}
145 %{py_sitedir}/%{module}/*.py[co]
146 %attr(755,root,root) %{py_sitedir}/*.so
147 %if "%{py_ver}" > "2.4"
148 %{py_sitedir}/%{module}-%{version}-py*.egg-info
153 %files -n python3-%{module}
154 %defattr(644,root,root,755)
156 %attr(755,root,root) %{py3_sitedir}/*.so
157 %{py3_sitedir}/%{module}
158 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
163 %defattr(644,root,root,755)
164 %doc docs/_build/html/*