04e7ad2
%bcond_without check
16b2880
# https://pagure.io/koji/issue/659
16b2880
%global debug_package %{nil}
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
Name:           rust-packaging
86a1e00
Version:        21
98eade4
Release:        %autorelease
86a1e00
Summary:        RPM macros for building Rust packages
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
License:        MIT
Igor Gnatenko 4e5904b
URL:            https://pagure.io/fedora-rust/rust2rpm
d936b97
Source:         https://pagure.io/fedora-rust/rust2rpm/archive/v%{version}/rust2rpm-v%{version}.tar.gz
b042dac
74f2cd9
Patch:          0001-Add-comment-about-unused-macro.patch
74f2cd9
Patch:          0002-Allow-easy-overriding-of-the-opt-level-debuginfo-cod.patch
8a2ef2e
Patch:        	0003-Fix-autodetection-of-rpmautospec.patch
8a2ef2e
Patch:        	0004-Print-information-about-written-files.patch
74f2cd9
16b2880
ExclusiveArch:  %{rust_arches}
Igor Gnatenko 4e5904b
700f417
# gawk is needed for stripping dev-deps in macro
700f417
Requires:       gawk
Igor Gnatenko 4e5904b
Requires:       python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release}
Igor Gnatenko 4e5904b
Requires:       rust-srpm-macros = %{version}
210d2aa
Requires:       rust
ea408f2
Requires:       cargo >= 1.41
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%description
86a1e00
The package provides RPM macros for building Rust projects.
86a1e00
86a1e00
Note that rust-srpm-macros is a seperate arch-independent package that
86a1e00
is also required to build Rust packages.
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%package     -n python3-rust2rpm
86a1e00
Summary:        Generate RPM spec files for Rust packages
Igor Gnatenko 4e5904b
BuildRequires:  python3-devel
Igor Gnatenko 4e5904b
BuildRequires:  python3-setuptools
Igor Gnatenko 4e5904b
%if %{with check}
Igor Gnatenko 4e5904b
BuildRequires:  python3-pytest
Igor Gnatenko 4e5904b
BuildRequires:  cargo
Igor Gnatenko 4e5904b
%endif
Igor Gnatenko 4e5904b
Requires:       cargo
Igor Gnatenko 4e5904b
Provides:       rust2rpm = %{version}-%{release}
Igor Gnatenko 4e5904b
%{?python_provide:%python_provide python3-rust2rpm}
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%description -n python3-rust2rpm
Igor Gnatenko 4e5904b
%{summary}.
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%prep
3f2f8da
%autosetup -n rust2rpm-v%{version} -p1
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%build
Igor Gnatenko 4e5904b
%py3_build
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%install
Igor Gnatenko 4e5904b
%py3_install
1f1f778
install -D -p -m 0644 -t %{buildroot}%{_rpmmacrodir} data/macros.rust data/macros.cargo
1f1f778
install -D -p -m 0644 -t %{buildroot}%{_fileattrsdir} data/cargo.attr
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%if %{with check}
Igor Gnatenko 4e5904b
%check
0e91fb3
py.test-%{python3_version} -vv test.py
Igor Gnatenko 4e5904b
%endif
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%files
86b1326
%license LICENSE
1f1f778
%{_rpmmacrodir}/macros.rust
1f1f778
%{_rpmmacrodir}/macros.cargo
1f1f778
%{_fileattrsdir}/cargo.attr
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%files -n python3-rust2rpm
Igor Gnatenko 4e5904b
%license LICENSE
4c2e295
%doc NEWS
Igor Gnatenko 4e5904b
%{_bindir}/rust2rpm
Igor Gnatenko 4e5904b
%{_bindir}/cargo-inspector
Igor Gnatenko 4e5904b
%{python3_sitelib}/rust2rpm-*.egg-info/
Igor Gnatenko 4e5904b
%{python3_sitelib}/rust2rpm/
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%changelog
98eade4
%autochangelog