# # spec file for package rust-packaging # # Copyright (c) 2020 SUSE LLC # Copyright (c) 2017 Red Hat, Inc., Raleigh, North Carolina, United States of America. # Copyright (c) 2017, 2019 Igor Gnatenko . # Copyright (c) 2020 Neal Gompa . # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %bcond_without check Name: rust-packaging Version: 15 Release: 2.8 Summary: RPM macros for building Rust packages on various architectures License: MIT Group: Development/Languages/Rust URL: https://pagure.io/fedora-rust/rust2rpm Source0: https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz BuildArch: noarch ExclusiveArch: %{rust_arches} noarch # gawk is needed for stripping dev-deps in macro, 4.1.0 is needed for inplace feature Requires: cargo >= 1.41 Requires: gawk >= 4.1.0 Requires: python3-rust2rpm = %{version}-%{release} Requires: rust Requires: rust-srpm-macros = %{version} %description The package provides macros for building projects in Rust on various architectures. %package -n python3-rust2rpm Summary: Convert Rust packages to RPM Group: Development/Languages/Rust BuildRequires: python3-devel BuildRequires: python3-setuptools %if %{with check} BuildRequires: cargo BuildRequires: python3-pytest %endif Requires: cargo Requires: python3-Jinja2 Requires: python3-requests Requires: python3-setuptools Requires: python3-tqdm Provides: rust2rpm = %{version}-%{release} %{?python_provide:%python_provide python3-rust2rpm} %description -n python3-rust2rpm This tool creates RPM spec files for Rust packages. The packages can be downloaded from crates.io and this tool creates packages that comply with the Fedora Packaging Guidelines, Mageia packaging policy, and the openSUSE Packaging Guidelines. %prep %autosetup -n rust2rpm-%{version} -p1 sed -r -i -e "s|(%\{_bindir\}/cargo-inspector)|env LANG=C.UTF-8 \1|" data/cargo.attr data/macros.cargo sed -i -e '/# Generated by/s/$/-%{version}-%{release}/' rust2rpm/templates/main.spec %build %py3_build %install %py3_install install -D -p -m 0644 -t %{buildroot}%{_rpmconfigdir}/macros.d data/macros.rust data/macros.cargo install -D -p -m 0644 -t %{buildroot}%{_rpmconfigdir}/fileattrs data/cargo.attr %if %{with check} %check py.test-%{python3_version} -vv test.py %endif %files %license LICENSE %{_rpmconfigdir}/macros.d/macros.rust %{_rpmconfigdir}/macros.d/macros.cargo %{_rpmconfigdir}/fileattrs/cargo.attr %files -n python3-rust2rpm %license LICENSE %{_bindir}/rust2rpm %{_bindir}/cargo-inspector %{python3_sitelib}/rust2rpm-*.egg-info/ %{python3_sitelib}/rust2rpm/ %changelog * Fri May 22 2020 Neal Gompa - Update to 15 + metadata: Fix setting up tilde version in RPM + templates: Generate files entry with no-tilde + inspector: Add support for multiple features + metadata: Support "renamed" dependencies + Use `cargo install --no-track` with cargo 1.41 + metadata: support versions like X.*.* + Fix up Cargo.toml.orig error message that started to appear with Rust 1.43.0 - Remove downstream patch + cargo-install.patch * Tue Mar 31 2020 Andreas Schwab - cargo-install.patch: Use `cargo install --no-track` with cargo 1.41 - Require cargo >= 1.41 * Wed Dec 4 2019 Igor Gnatenko - Remove downstream patches + 0001-Ignore-Cargo.lock.patch + 0001-macros-Remove-Cargo.toml.orig.patch + 0001-metadata-normalize-version-via-CargoSemVer.patch + 0001-metadata-replace-semantic-version-with-a-custom-pars.patch - Update to 11 + When dynamic BuildRequires are turned on, propagate arguments to %%cargo_* + Few improvements in algorithm of description splitting into a summary + Ignore Cargo.lock for installation (publish lockfile feature in Cargo 1.37+) + Replace semantic_version dependency by custom parser + Add MPL-2.0-or-later and 0BSD into a Fedora SPDX mapping + Pass --cap-lints=warn into the RUSTFLAGS to prevent FTBFS after dependency and/or compiler updates + Enable dynamic BuildRequires by default for Fedora target * Wed Oct 30 2019 Neal Gompa - Fix version normalization via CargoSemVer + 0001-metadata-normalize-version-via-CargoSemVer.patch * Mon Oct 28 2019 Neal Gompa - Replace semantic_version dependency with custom CargoVersion parser + Add 0001-metadata-replace-semantic-version-with-a-custom-pars.patch * Tue Oct 22 2019 Thomas Bechtold - Add 0001-Ignore-Cargo.lock.patch This fixes build problems when the .crate file contains a Cargo.lock file * Thu Aug 29 2019 Thomas Bechtold - update to version 10 * Translate '-or-later' and '+' license suffixes properly * Check /usr/lib/os-release in addition to /etc/os-release * Prettify summary and description automatically * Use %%{expand:…} for %%description to avoid escaping of newlines * Add '--suffix' option for "compat" packages * Implement option to skip building of crates (aka fast/bootstrap build) * Mon May 6 2019 Neal Gompa - Update to version 9 + Remove temporary Cargo.toml.deps + Fix packager identity detection to use fallbacks properly + Always put upstream license data comment in generated specs - Drop unneeded epoch handling in spec, as Epochs are nearly never used in openSUSE - Ensure the version-release of rust2rpm used is mentioned in generated specs - Ensure license file is installed in rust-packaging * Tue Apr 23 2019 Igor Gnatenko - Add 0001-macros-Remove-Cargo.toml.orig.patch so crates pass rpmlint * Tue Apr 23 2019 Igor Gnatenko - Update to version 8 - Changes since version 6 * Generate %%doc statements for readme from Cargo.toml * Split features into subpackages (`rust-$crate+$feature-devel`) * Add support for dependencies with same name * Add support for user configuration (`.rust2rpm.conf`, `_rust2rpm.conf`) * Option to not generate default changelog entry (`--no-auto-changelog-entry`) * Set `CARGO_HOME` to the local `.cargo` (required by new Rust) * Improvements for crates with pre-release versions * Do not put unneeded optional dependencies in BuildRequires (`-Z avoid-dev-deps`) * Option to use all crate features when generating spec file * Use new-style changelog format (with TZ info) on Fedora * Option to use dynamic BuildRequires (requires RPM 4.15+) * Environment variables to control packager identity - Drop patches part of this release * 0001-name-spec-patch_file-by-real-crate-name.patch * 0002-generate-doc-statements.patch * 0003-do-better-for-renamed-crates.patch * 0004-remove-pre-3.6-leftovers.patch * 0005-Remove-half-downloaded-crate-on-C.patch * 0006-Throw-an-error-if-s-is-used-without-a-crate.patch * 0007-split-features-into-subpackages.patch * 0008-add-support-for-dependencies-with-same-name.patch * 0009-add-support-for-feeding-user-configuration.patch * 0010-trivial-use-f-strings-everywhere.patch * 0011-Add-option-to-not-generate-a-default-changelog-entry.patch * 0012-Set-CARGO_HOME-to-the-local-.config.patch * 0013-Set-the-install-root-in-.cargo-config.patch * 0014-Add-support-for-prerelease-versions.patch * Tue Mar 5 2019 Igor Gnatenko - Backport more upstream patches + Added patches - 0012-Set-CARGO_HOME-to-the-local-.config.patch - 0013-Set-the-install-root-in-.cargo-config.patch - 0014-Add-support-for-prerelease-versions.patch - Replaced patch with upstream version + Removed patches - 0101-Add-option-to-not-generate-a-default-changelog-entry.patch + Added patches - 0011-Add-option-to-not-generate-a-default-changelog-entry.patch * Sun Nov 11 2018 Neal Gompa - Update to 6 + Allow generating spec file from rust project checkout + add option to copy crate to current working directory + Filter dependencies using the cfg language - Backport patches for updated packaging generation + Added patches - 0001-name-spec-patch_file-by-real-crate-name.patch - 0002-generate-doc-statements.patch - 0003-do-better-for-renamed-crates.patch - 0004-remove-pre-3.6-leftovers.patch - 0005-Remove-half-downloaded-crate-on-C.patch - 0006-Throw-an-error-if-s-is-used-without-a-crate.patch - 0007-split-features-into-subpackages.patch - 0008-add-support-for-dependencies-with-same-name.patch - 0009-add-support-for-feeding-user-configuration.patch - 0010-trivial-use-f-strings-everywhere.patch - Remove merged patches + 0001-macros-remove-Cargo.lock.patch + 0002-macros-remove-spurious-whitespace.patch - Add proposed patch to add option to not generate default changelog entry + 0101-Add-option-to-not-generate-a-default-changelog-entry.patch * Tue Nov 6 2018 Neal Gompa - Add missing runtime requirement for python3-setuptools * Sun Jan 21 2018 Neal Gompa - Flesh out the descriptions of the produced binary packages * Sat Jan 13 2018 Neal Gompa - Initial packaging for (open)SUSE * Tue Jan 9 2018 Igor Gnatenko - Remove Cargo.lock * Mon Jan 8 2018 Igor Gnatenko - Update to 5 * Sat Nov 4 2017 Igor Gnatenko - Use cp instead of install * Sat Oct 21 2017 Igor Gnatenko - Generate runtime dependency on cargo for devel subpackages * Sat Jul 8 2017 Igor Gnatenko - Update to 4 * Fri Jun 23 2017 Igor Gnatenko - Explicitly set rustdoc path * Wed Jun 21 2017 Igor Gnatenko - Switch cargo_registry to /usr/share/cargo/registry * Wed Jun 14 2017 Igor Gnatenko - Set C.UTF-8 for cargo inspector where python doesn't do locale coercing * Tue Jun 13 2017 Igor Gnatenko - Initial package