|
|
|
%bcond_without check
|
|
|
|
# https://pagure.io/koji/issue/659
|
|
|
|
%global debug_package %{nil}
|
|
|
|
|
|
|
|
Name: rust-packaging
|
|
|
|
Version: 19
|
|
|
|
Release: %autorelease
|
|
|
|
Summary: RPM macros for building Rust packages on various architectures
|
|
|
|
|
|
|
|
License: MIT
|
|
|
|
URL: https://pagure.io/fedora-rust/rust2rpm
|
|
|
|
Source: https://pagure.io/fedora-rust/rust2rpm/archive/v%{version}/rust2rpm-v%{version}.tar.gz
|
|
|
|
# https://pagure.io/fedora-rust/rust2rpm/issue/70
|
|
|
|
Patch0001: 0001-Always-require-upper-bound-dependency-with-sign.patch
|
|
|
|
|
|
|
|
ExclusiveArch: %{rust_arches}
|
|
|
|
|
|
|
|
# gawk is needed for stripping dev-deps in macro
|
|
|
|
Requires: gawk
|
|
|
|
Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release}
|
|
|
|
Requires: rust-srpm-macros = %{version}
|
|
|
|
Requires: rust
|
|
|
|
Requires: cargo >= 1.41
|
|
|
|
|
|
|
|
%description
|
|
|
|
The package provides macros for building projects in Rust
|
|
|
|
on various architectures.
|
|
|
|
|
|
|
|
%package -n python3-rust2rpm
|
|
|
|
Summary: Convert Rust packages to RPM
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
%if %{with check}
|
|
|
|
BuildRequires: python3-pytest
|
|
|
|
BuildRequires: cargo
|
|
|
|
%endif
|
|
|
|
Requires: cargo
|
|
|
|
Provides: rust2rpm = %{version}-%{release}
|
|
|
|
%{?python_provide:%python_provide python3-rust2rpm}
|
|
|
|
|
|
|
|
%description -n python3-rust2rpm
|
|
|
|
%{summary}.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -n rust2rpm-v%{version} -p1
|
|
|
|
|
|
|
|
%build
|
|
|
|
%py3_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%py3_install
|
|
|
|
install -D -p -m 0644 -t %{buildroot}%{_rpmmacrodir} data/macros.rust data/macros.cargo
|
|
|
|
install -D -p -m 0644 -t %{buildroot}%{_fileattrsdir} data/cargo.attr
|
|
|
|
|
|
|
|
%if %{with check}
|
|
|
|
%check
|
|
|
|
py.test-%{python3_version} -vv test.py
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSE
|
|
|
|
%{_rpmmacrodir}/macros.rust
|
|
|
|
%{_rpmmacrodir}/macros.cargo
|
|
|
|
%{_fileattrsdir}/cargo.attr
|
|
|
|
|
|
|
|
%files -n python3-rust2rpm
|
|
|
|
%license LICENSE
|
|
|
|
%doc NEWS
|
|
|
|
%{_bindir}/rust2rpm
|
|
|
|
%{_bindir}/cargo-inspector
|
|
|
|
%{python3_sitelib}/rust2rpm-*.egg-info/
|
|
|
|
%{python3_sitelib}/rust2rpm/
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
%autochangelog
|