Igor Gnatenko 4e5904b
%bcond_without check
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
Name:           rust-packaging
f0f5561
Version:        5
f45176f
Release:        3%{?dist}
Igor Gnatenko 4e5904b
Summary:        RPM macros for building Rust packages on various architectures
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
License:        MIT
Igor Gnatenko 4e5904b
URL:            https://pagure.io/fedora-rust/rust2rpm
Igor Gnatenko 4e5904b
Source0:        https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
b22849e
Patch0001:      0001-macros-remove-Cargo.lock.patch
f45176f
Patch0002:      0002-macros-remove-spurious-whitespace.patch
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
BuildArch:      noarch
Igor Gnatenko 4e5904b
ExclusiveArch:  %{rust_arches} noarch
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
# gawk is needed for stripping dev-deps in macro, 4.1.0 is needed for inplace feature
Igor Gnatenko 4e5904b
Requires:       gawk >= 4.1.0
Igor Gnatenko 4e5904b
Requires:       python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release}
Igor Gnatenko 4e5904b
Requires:       rust-srpm-macros = %{version}
1b0abb6
# Remove in F29
1b0abb6
Obsoletes:      rust-rpm-macros < 2-2
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%description
Igor Gnatenko 4e5904b
The package provides macros for building projects in Rust
Igor Gnatenko 4e5904b
on various architectures.
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%package     -n python3-rust2rpm
Igor Gnatenko 4e5904b
Summary:        Convert Rust packages to RPM
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
BuildRequires:  python3-semantic_version
Igor Gnatenko 4e5904b
%endif
Igor Gnatenko 4e5904b
Requires:       cargo
Igor Gnatenko 4e5904b
Requires:       python3-semantic_version
Igor Gnatenko 4e5904b
Requires:       python3-jinja2
Igor Gnatenko 4e5904b
Requires:       python3-requests
Igor Gnatenko 4e5904b
Requires:       python3-tqdm
Igor Gnatenko 4e5904b
%if 0%{?mageia}
Igor Gnatenko 4e5904b
Requires:       locales-en
Igor Gnatenko 4e5904b
%endif
Igor Gnatenko 4e5904b
Obsoletes:      rust2rpm < 1-8
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
Igor Gnatenko 4e5904b
%autosetup -n rust2rpm-%{version} -p1
Igor Gnatenko 4e5904b
lang=
Igor Gnatenko 4e5904b
%if (0%{?fedora} && 0%{?fedora} <= 25) || (0%{?rhel} && 0%{?rhel} <= 7)
Igor Gnatenko 4e5904b
lang=C.UTF-8
Igor Gnatenko 4e5904b
%else
Igor Gnatenko 4e5904b
%if 0%{?mageia}
Igor Gnatenko 4e5904b
lang=en_US.UTF-8
Igor Gnatenko 4e5904b
%endif
Igor Gnatenko 4e5904b
%endif
46f7056
[ -z "$lang" ] || sed -r -i -e "s|(%\{_bindir\}/cargo-inspector)|env LANG=$lang \1|" data/cargo.attr data/macros.cargo
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%build
Igor Gnatenko 4e5904b
%py3_build
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%install
Igor Gnatenko 4e5904b
%py3_install
Igor Gnatenko 4e5904b
install -D -p -m 0644 -t %{buildroot}%{_rpmconfigdir}/macros.d data/macros.rust data/macros.cargo
Igor Gnatenko 4e5904b
install -D -p -m 0644 -t %{buildroot}%{_rpmconfigdir}/fileattrs data/cargo.attr
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%if %{with check}
Igor Gnatenko 4e5904b
%check
Igor Gnatenko 4e5904b
py.test-%{python3_version} -v test.py
Igor Gnatenko 4e5904b
%endif
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%files
Igor Gnatenko 4e5904b
%{_rpmconfigdir}/macros.d/macros.rust
Igor Gnatenko 4e5904b
%{_rpmconfigdir}/macros.d/macros.cargo
Igor Gnatenko 4e5904b
%{_rpmconfigdir}/fileattrs/cargo.attr
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
%files -n python3-rust2rpm
Igor Gnatenko 4e5904b
%license LICENSE
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
f45176f
* Tue Jan 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 5-3
f45176f
- Fix syntax error
f45176f
b22849e
* Tue Jan 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 5-2
b22849e
- Remove Cargo.lock
b22849e
f0f5561
* Mon Jan 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 5-1
f0f5561
- Update to 5
f0f5561
1b0abb6
* Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4-7
1b0abb6
- Add Obsoletes for rust-rpm-macros
1b0abb6
d98b1ac
* Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4-6
d98b1ac
- Use cp instead of install
d98b1ac
6b81b17
* Sat Oct 21 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4-5
6b81b17
- Generate runtime dependencyon cargo for devel subpackages
6b81b17
85772b9
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4-3
85772b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
85772b9
Igor Gnatenko 4e5904b
* Sat Jul 08 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4-2
Igor Gnatenko 4e5904b
- Include license
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
* Sat Jul 08 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4-1
Igor Gnatenko 4e5904b
- Update to 4
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
* Fri Jun 23 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3-5
Igor Gnatenko 4e5904b
- Explicitly set rustdoc path
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
* Wed Jun 21 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3-4
Igor Gnatenko 4e5904b
- Mageia doesn't have C.UTF-8 lang
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
* Wed Jun 21 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3-3
Igor Gnatenko 4e5904b
- Switch cargo_registry to /usr/share/cargo/registry
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
* Wed Jun 14 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3-2
Igor Gnatenko 4e5904b
- Set C.UTF-8 for cargo inspector where python doesn't do locale coercing
Igor Gnatenko 4e5904b
Igor Gnatenko 4e5904b
* Tue Jun 13 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3-1
Igor Gnatenko 4e5904b
- Initial package