]> git.pld-linux.org Git - packages/python-bcrypt.git/blame - python-bcrypt.spec
update BR, cleanups
[packages/python-bcrypt.git] / python-bcrypt.spec
CommitLineData
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
9Summary: Library for password hashing for your software and your servers
10Summary(pl.UTF-8): Biblioteka do tworzenia skrótów haseł dla twojego oprogramowania i serwerów
11Name: python-%{module}
12Version: 1.1.1
d5a5d495 13Release: 2
8668c912
MK
14License: Apache v2.0
15Group: Libraries/Python
16Source0: https://pypi.python.org/packages/source/b/bcrypt/%{module}-%{version}.tar.gz
17# Source0-md5: 43c5871c6bc7da1efe6a8bae25f90ad8
18URL: https://github.com/dstufft/bcrypt/
19BuildRequires: rpm-pythonprov
20# if py_postclean is used
21BuildRequires: rpmbuild(macros) >= 1.219
22%if %{with python2}
b4d459de
ER
23BuildRequires: python-cffi
24BuildRequires: python-d2to1
8668c912
MK
25BuildRequires: python-devel
26BuildRequires: python-distribute
d5a5d495
MK
27BuildRequires: python-py
28BuildRequires: python-pytest
b4d459de 29BuildRequires: python-six
8668c912
MK
30%endif
31%if %{with python3}
b4d459de 32BuildRequires: python3-cffi
8668c912
MK
33BuildRequires: python3-devel
34BuildRequires: python3-distribute
35BuildRequires: python3-modules
d5a5d495
MK
36BuildRequires: python3-py
37BuildRequires: python3-pytest
b4d459de 38BuildRequires: python3-six
8668c912 39%endif
d5a5d495 40Requires: python-cffi > 8.0
8668c912 41Requires: python-modules
8668c912
MK
42BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44%description
45This library should be compatible with py-bcrypt and it will run on
46Python 2.6, 2.7, 3.2, 3.3 and PyPy 2.0
47
48%description -l pl.UTF-8
49Biblioteka powinna byc kompatybilna z biblioteką py-bcrypt, działa dla
50Python 2.6, 2.7, 3.2, 3.3 and PyPy 2.0
51
52%package -n python3-%{module}
53Summary: Library for password hashing for your software and your servers
54Summary(pl.UTF-8): Biblioteka do tworzenia skrótów haseł dla twojego oprogramowania i serwerów
55Group: Libraries/Python
8668c912 56Requires: python3-cffi > 0.8
d5a5d495 57Requires: python3-modules
8668c912
MK
58
59%description -n python3-%{module}
60This library should be compatible with py-bcrypt and it will run on
61Python 2.6-3.4 and PyPy 2.0
62
63%description -n python3-%{module} -l pl.UTF-8
64Biblioteka powinna byc kompatybilna z biblioteką py-bcrypt, działa dla
65Python 2.6-3.4 and PyPy 2.0
66
67%package apidocs
68Summary: %{module} API documentation
69Summary(pl.UTF-8): Dokumentacja API %{module}
70Group: Documentation
71
72%description apidocs
73API documentation for %{module}.
74
75%description apidocs -l pl.UTF-8
76Dokumentacja API %{module}.
77
78%prep
79%setup -q -n %{module}-%{version}
80
81%build
82%if %{with python2}
83CC="%{__cc}" \
84CFLAGS="%{rpmcppflags} %{rpmcflags}" \
85%{__python} setup.py build --build-base build-2 %{?with_tests:test}
86%endif
87
88%if %{with python3}
89CC="%{__cc}" \
90CFLAGS="%{rpmcppflags} %{rpmcflags}" \
91%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
92%endif
93
94%if %{with doc}
95cd docs
96%{__make} -j1 html
97rm -rf _build/html/_sources
98%endif
99
100%install
101rm -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
128rm -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
This page took 0.117152 seconds and 4 git commands to generate.