|
| 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.1.1 |
| 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: python-rpm-macros |
| 31 | +BuildRequires: python3-Cython3 |
| 32 | +BuildRequires: python3-devel |
| 33 | +BuildRequires: python3-pycparser |
| 34 | +BuildRequires: python3-setuptools >= 42.0.0 |
| 35 | +BuildRequires: python3-setuptools-rust >= 0.11.4 |
| 36 | +BuildRequires: rust >= 1.64.0 |
| 37 | + |
| 38 | +%description |
| 39 | +Good password hashing for your software and your servers. |
| 40 | + |
| 41 | +%prep |
| 42 | +%autosetup -T -c -n %{name}_%{version}-%{release} |
| 43 | +tar -zx -f %{S:0} --strip-components=1 -C . |
| 44 | + |
| 45 | +%build |
| 46 | +%py3_build |
| 47 | + |
| 48 | +%install |
| 49 | +%py3_install |
| 50 | +find %{buildroot}%{python3_sitearch} -type f -name '*.pyc' -exec rm -rf {} \; |
| 51 | +fdupes -qnrps %{buildroot}%{python3_sitearch} |
| 52 | + |
| 53 | +%check |
| 54 | + |
| 55 | +%if 0%{?suse_version} > 1500 |
| 56 | +%package -n python%{python3_version_nodots}-bcrypt |
| 57 | +Summary: Modern(-ish) password hashing for your software and your servers |
| 58 | +Requires: python3 |
| 59 | +Provides: python3-bcrypt = %{epoch}:%{version}-%{release} |
| 60 | +Provides: python3dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 61 | +Provides: python%{python3_version}-bcrypt = %{epoch}:%{version}-%{release} |
| 62 | +Provides: python%{python3_version}dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 63 | +Provides: python%{python3_version_nodots}-bcrypt = %{epoch}:%{version}-%{release} |
| 64 | +Provides: python%{python3_version_nodots}dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 65 | + |
| 66 | +%description -n python%{python3_version_nodots}-bcrypt |
| 67 | +Good password hashing for your software and your servers. |
| 68 | + |
| 69 | +%files -n python%{python3_version_nodots}-bcrypt |
| 70 | +%license LICENSE |
| 71 | +%{python3_sitearch}/* |
| 72 | +%endif |
| 73 | + |
| 74 | +%if !(0%{?suse_version} > 1500) |
| 75 | +%package -n python3-bcrypt |
| 76 | +Summary: Modern(-ish) password hashing for your software and your servers |
| 77 | +Requires: python3 |
| 78 | +Provides: python3-bcrypt = %{epoch}:%{version}-%{release} |
| 79 | +Provides: python3dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 80 | +Provides: python%{python3_version}-bcrypt = %{epoch}:%{version}-%{release} |
| 81 | +Provides: python%{python3_version}dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 82 | +Provides: python%{python3_version_nodots}-bcrypt = %{epoch}:%{version}-%{release} |
| 83 | +Provides: python%{python3_version_nodots}dist(bcrypt) = %{epoch}:%{version}-%{release} |
| 84 | + |
| 85 | +%description -n python3-bcrypt |
| 86 | +Good password hashing for your software and your servers. |
| 87 | + |
| 88 | +%files -n python3-bcrypt |
| 89 | +%license LICENSE |
| 90 | +%{python3_sitearch}/* |
| 91 | +%endif |
| 92 | + |
| 93 | +%changelog |
0 commit comments