%global python3_pkgversion 3.11 %global modname bcrypt %global sum Modern password hashing for your software and your servers Name: python-bcrypt Version: 4.1.2 Release: 2.ac14.py3.11%{?dist} Summary: %{sum} #crypt_blowfish code is in Public domain and all other code in ASL 2.0 License: Apache-2.0 AND LicenseRef-Fedora-Public-Domain URL: http://pypi.python.org/pypi/bcrypt Source0: %pypi_source bcrypt %description %{sum}. %package -n python%{python3_pkgversion}-%{modname} Summary: %{sum} # LICENSE.dependencies contains a full license breakdown License: Apache-2.0 AND LicenseRef-Fedora-Public-Domain AND BSD-3-Clause AND MIT AND (Apache-2.0 OR MIT) AND (Unlicense OR MIT) BuildRequires: python%{python3_pkgversion}-devel BuildRequires: rust-packaging %description -n python%{python3_pkgversion}-%{modname} %{sum}. %prep %autosetup -n %{modname}-%{version} -p1 %cargo_prep rm src/_bcrypt/Cargo.lock %generate_buildrequires %pyproject_buildrequires -t (cd src/_bcrypt %cargo_generate_buildrequires ) %build export RUSTFLAGS="%build_rustflags" %pyproject_wheel (cd src/_bcrypt %{shrink: %{__cargo} tree --workspace --offline --edges no-build,no-dev,no-proc-macro --no-dedupe --target all %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} --prefix none --format "# {l}" | sed -e "s: / :/:g" -e "s:/: OR :g" | sort -u} %{shrink: %{__cargo} tree --workspace --offline --edges no-build,no-dev,no-proc-macro --no-dedupe --target all %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} --prefix none --format "{l}: {p}" | sed -e "s: ($(pwd)[^)]*)::g" -e "s: / :/:g" -e "s:/: OR :g" | sort -u} > ../../LICENSE.dependencies ) %install %pyproject_install %pyproject_save_files bcrypt %check for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files} %doc README.rst %license LICENSE LICENSE.dependencies %changelog * Mon Apr 29 2024 Ding-Yi Chen - 4.1.2-2.ac14.py3.11 - Cut corner packaging