|
| 1 | +# Copyright 2024 Wong Hoi Sing Edison <[email protected]> |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +%global debug_package %{nil} |
| 16 | + |
| 17 | +%global source_date_epoch_from_changelog 0 |
| 18 | + |
| 19 | +Name: python-bcrypt |
| 20 | +Epoch: 100 |
| 21 | +Version: 4.2.0 |
| 22 | +Release: 1%{?dist} |
| 23 | +Summary: Modern(-ish) password hashing for your software and your servers |
| 24 | +License: Apache-2.0 |
| 25 | +URL: https://github.com/pyca/bcrypt/tags |
| 26 | +Source0: %{name}_%{version}.orig.tar.gz |
| 27 | +BuildRequires: cargo |
| 28 | +BuildRequires: fdupes |
| 29 | +BuildRequires: gcc |
| 30 | +BuildRequires: python3-Cython3 |
| 31 | +BuildRequires: python3-devel |
| 32 | +BuildRequires: python3-pip |
| 33 | +BuildRequires: python3-pycparser |
| 34 | +BuildRequires: python3-setuptools >= 42.0.0 |
| 35 | +BuildRequires: python3-setuptools-rust >= 1.7.0 |
| 36 | +BuildRequires: python-rpm-macros |
| 37 | +BuildRequires: rust >= 1.64.0 |
| 38 | + |
| 39 | +%description |
| 40 | +Good password hashing for your software and your servers. |
| 41 | + |
| 42 | +%prep |
| 43 | +%autosetup -T -c -n %{name}_%{version}-%{release} |
| 44 | +tar -zx -f %{S:0} --strip-components=1 -C . |
| 45 | + |
| 46 | +%build |
| 47 | +pip wheel \ |
| 48 | + --no-deps \ |
| 49 | + --no-build-isolation \ |
| 50 | + --wheel-dir=dist \ |
| 51 | + . |
| 52 | + |
| 53 | +%install |
| 54 | +pip install \ |
| 55 | + --no-deps \ |
| 56 | + --ignore-installed \ |
| 57 | + --root=%{buildroot} \ |
| 58 | + --prefix=%{_prefix} \ |
| 59 | + dist/*.whl |
| 60 | +find %{buildroot}%{python3_sitearch} -type f -name '*.pyc' -exec rm -rf {} \; |
| 61 | +fdupes -qnrps %{buildroot}%{python3_sitearch} |
| 62 | + |
| 63 | +%check |
| 64 | + |
| 65 | +%if 0%{?suse_version} > 1500 |
| 66 | +%package -n python%{python3_version_nodots}-bcrypt |
| 67 | +Summary: Modern(-ish) password hashing for your software and your servers |
| 68 | +Requires: python3 |
| 69 | +Provides: python3-bcrypt = %{epoch}:%{version}-%{release} |
| 70 | +Provides: python3dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 71 | +Provides: python%{python3_version}-bcrypt = %{epoch}:%{version}-%{release} |
| 72 | +Provides: python%{python3_version}dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 73 | +Provides: python%{python3_version_nodots}-bcrypt = %{epoch}:%{version}-%{release} |
| 74 | +Provides: python%{python3_version_nodots}dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 75 | + |
| 76 | +%description -n python%{python3_version_nodots}-bcrypt |
| 77 | +Good password hashing for your software and your servers. |
| 78 | + |
| 79 | +%files -n python%{python3_version_nodots}-bcrypt |
| 80 | +%license LICENSE |
| 81 | +%{python3_sitearch}/* |
| 82 | +%endif |
| 83 | + |
| 84 | +%if !(0%{?suse_version} > 1500) |
| 85 | +%package -n python3-bcrypt |
| 86 | +Summary: Modern(-ish) password hashing for your software and your servers |
| 87 | +Requires: python3 |
| 88 | +Provides: python3-bcrypt = %{epoch}:%{version}-%{release} |
| 89 | +Provides: python3dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 90 | +Provides: python%{python3_version}-bcrypt = %{epoch}:%{version}-%{release} |
| 91 | +Provides: python%{python3_version}dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 92 | +Provides: python%{python3_version_nodots}-bcrypt = %{epoch}:%{version}-%{release} |
| 93 | +Provides: python%{python3_version_nodots}dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 94 | + |
| 95 | +%description -n python3-bcrypt |
| 96 | +Good password hashing for your software and your servers. |
| 97 | + |
| 98 | +%files -n python3-bcrypt |
| 99 | +%license LICENSE |
| 100 | +%{python3_sitearch}/* |
| 101 | +%endif |
| 102 | + |
| 103 | +%changelog |
0 commit comments