## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

# Generated by rust2rpm 23
# * test suite segfaults on s390x
%ifnarch s390x
%bcond_without check
%else
%bcond_with check
%endif
%global debug_package %{nil}

%global crate cpython

Name:           rust-cpython
Version:        0.7.1
Release:        %autorelease
Summary:        Bindings to Python

License:        MIT
URL:            https://crates.io/crates/cpython
Source:         %{crates_source}
# Manually created patch for downstream crate metadata changes
# * disable python 2.7 support
Patch:          cpython-fix-metadata.diff

BuildRequires:  rust-packaging >= 21

%global _description %{expand:
Bindings to Python.}

%description %{_description}

%package        devel
Summary:        %{summary}
BuildArch:      noarch

%description    devel %{_description}

This package contains library source intended for building other packages which
use the "%{crate}" crate.

%files          devel
%license %{crate_instdir}/LICENSE
%doc %{crate_instdir}/CHANGELOG.md
%doc %{crate_instdir}/README.md
%{crate_instdir}/

%package     -n %{name}+default-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+default-devel %{_description}

This package contains library source intended for building other packages which
use the "default" feature of the "%{crate}" crate.

%files       -n %{name}+default-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+extension-module-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+extension-module-devel %{_description}

This package contains library source intended for building other packages which
use the "extension-module" feature of the "%{crate}" crate.

%files       -n %{name}+extension-module-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+nightly-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+nightly-devel %{_description}

This package contains library source intended for building other packages which
use the "nightly" feature of the "%{crate}" crate.

%files       -n %{name}+nightly-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+no-auto-initialize-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+no-auto-initialize-devel %{_description}

This package contains library source intended for building other packages which
use the "no-auto-initialize" feature of the "%{crate}" crate.

%files       -n %{name}+no-auto-initialize-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+nonnull-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+nonnull-devel %{_description}

This package contains library source intended for building other packages which
use the "nonnull" feature of the "%{crate}" crate.

%files       -n %{name}+nonnull-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+py-link-mode-default-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+py-link-mode-default-devel %{_description}

This package contains library source intended for building other packages which
use the "py-link-mode-default" feature of the "%{crate}" crate.

%files       -n %{name}+py-link-mode-default-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+py-link-mode-unresolved-static-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+py-link-mode-unresolved-static-devel %{_description}

This package contains library source intended for building other packages which
use the "py-link-mode-unresolved-static" feature of the "%{crate}" crate.

%files       -n %{name}+py-link-mode-unresolved-static-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+python-3-10-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+python-3-10-devel %{_description}

This package contains library source intended for building other packages which
use the "python-3-10" feature of the "%{crate}" crate.

%files       -n %{name}+python-3-10-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+python-3-11-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+python-3-11-devel %{_description}

This package contains library source intended for building other packages which
use the "python-3-11" feature of the "%{crate}" crate.

%files       -n %{name}+python-3-11-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+python-3-4-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+python-3-4-devel %{_description}

This package contains library source intended for building other packages which
use the "python-3-4" feature of the "%{crate}" crate.

%files       -n %{name}+python-3-4-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+python-3-5-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+python-3-5-devel %{_description}

This package contains library source intended for building other packages which
use the "python-3-5" feature of the "%{crate}" crate.

%files       -n %{name}+python-3-5-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+python-3-6-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+python-3-6-devel %{_description}

This package contains library source intended for building other packages which
use the "python-3-6" feature of the "%{crate}" crate.

%files       -n %{name}+python-3-6-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+python-3-7-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+python-3-7-devel %{_description}

This package contains library source intended for building other packages which
use the "python-3-7" feature of the "%{crate}" crate.

%files       -n %{name}+python-3-7-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+python-3-8-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+python-3-8-devel %{_description}

This package contains library source intended for building other packages which
use the "python-3-8" feature of the "%{crate}" crate.

%files       -n %{name}+python-3-8-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+python-3-9-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+python-3-9-devel %{_description}

This package contains library source intended for building other packages which
use the "python-3-9" feature of the "%{crate}" crate.

%files       -n %{name}+python-3-9-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+python3-sys-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+python3-sys-devel %{_description}

This package contains library source intended for building other packages which
use the "python3-sys" feature of the "%{crate}" crate.

%files       -n %{name}+python3-sys-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+serde-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+serde-devel %{_description}

This package contains library source intended for building other packages which
use the "serde" feature of the "%{crate}" crate.

%files       -n %{name}+serde-devel
%ghost %{crate_instdir}/Cargo.toml

%package     -n %{name}+serde-convert-devel
Summary:        %{summary}
BuildArch:      noarch

%description -n %{name}+serde-convert-devel %{_description}

This package contains library source intended for building other packages which
use the "serde-convert" feature of the "%{crate}" crate.

%files       -n %{name}+serde-convert-devel
%ghost %{crate_instdir}/Cargo.toml

%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
rm tests/check_symbols.py
%cargo_prep
# remove executable bit from all files
find -type f -executable -exec chmod -x {} +

%generate_buildrequires
%cargo_generate_buildrequires

%build
%cargo_build

%install
%cargo_install

%if %{with check}
%check
%cargo_test
%endif

%changelog
* Wed Dec 14 2022 Fabio Valentini <decathorpe@gmail.com> 0.7.1-1
- Update to version 0.7.1; Fixes RHBZ#2137690

* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> 0.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Wed Apr 06 2022 Fabio Valentini <decathorpe@gmail.com> 0.7.0-1
- Update to version 0.7.0; Fixes RHBZ#2012486

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> 0.6.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Sat Jul 31 2021 Fabio Valentini <decathorpe@gmail.com> 0.6.0-2
- Temporarily ignore test suite on s390x due to various problems

* Sat Jul 31 2021 Fabio Valentini <decathorpe@gmail.com> 0.6.0-1
- Update to version 0.6.0; Fixes RHBZ#1950088

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Thu Jan 07 2021 Fabio Valentini <decathorpe@gmail.com> - 0.5.2-1
- Initial package