]> git.pld-linux.org Git - packages/python-bcrypt.git/blob - python-bcrypt.spec
6db629c074775064398c6847d53d8d1f9a405444
[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:        2
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}
23 BuildRequires:  python-devel
24 BuildRequires:  python-distribute
25 BuildRequires:  python-py
26 BuildRequires:  python-pytest
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-devel
30 BuildRequires:  python3-distribute
31 BuildRequires:  python3-modules
32 BuildRequires:  python3-py
33 BuildRequires:  python3-pytest
34 %endif
35 # Below Rs only work for main package (python2)
36 Requires:       python-cffi > 8.0
37 #Requires:              python-libs
38 Requires:       python-modules
39
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
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
45
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
49
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
56
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
60
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
64
65 %package apidocs
66 Summary:        %{module} API documentation
67 Summary(pl.UTF-8):      Dokumentacja API %{module}
68 Group:          Documentation
69
70 %description apidocs
71 API documentation for %{module}.
72
73 %description apidocs -l pl.UTF-8
74 Dokumentacja API %{module}.
75
76 %prep
77 %setup -q -n %{module}-%{version}
78
79 %build
80 %if %{with python2}
81 CC="%{__cc}" \
82 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
83 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
84 %endif
85
86 %if %{with python3}
87 CC="%{__cc}" \
88 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
89 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
90 %endif
91
92 %if %{with doc}
93 cd docs
94 %{__make} -j1 html
95 rm -rf _build/html/_sources
96 %endif
97
98 %install
99 rm -rf $RPM_BUILD_ROOT
100
101 %if %{with python2}
102 %{__python} setup.py \
103         build --build-base build-2 \
104         install --skip-build \
105         --optimize=2 \
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/
110 %py_postclean
111
112 %endif
113
114 %if %{with python3}
115 %{__python3} setup.py \
116         build --build-base build-3 \
117         install --skip-build \
118         --optimize=2 \
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/
123 %endif
124
125 # in case there are examples provided
126 %if %{with python2}
127 # install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
128 # cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
129 %endif
130 %if %{with python3}
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}|'
135 %endif
136
137 %clean
138 rm -rf $RPM_BUILD_ROOT
139
140 %if %{with python2}
141 %files
142 %defattr(644,root,root,755)
143 %doc README.rst
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
149 %endif
150 %endif
151
152 %if %{with python3}
153 %files -n python3-%{module}
154 %defattr(644,root,root,755)
155 %doc README.rst
156 %attr(755,root,root) %{py3_sitedir}/*.so
157 %{py3_sitedir}/%{module}
158 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
159 %endif
160
161 %if %{with doc}
162 %files apidocs
163 %defattr(644,root,root,755)
164 %doc docs/_build/html/*
165 %endif
This page took 0.073319 seconds and 2 git commands to generate.