Blob Blame History Raw
%bcond_without check
%global debug_package %{nil}

Name:           rust-packaging
Version:        20
Release:        %autorelease
Summary:        RPM macros for building Rust packages on various architectures

License:        MIT

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

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
Requires:       cargo
Provides:       rust2rpm = %{version}-%{release}
%{?python_provide:%python_provide python3-rust2rpm}

%description -n python3-rust2rpm

%autosetup -n rust2rpm-v%{version} -p1


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}
py.test-%{python3_version} -vv

%license LICENSE

%files -n python3-rust2rpm
%license LICENSE
%doc NEWS