diff --git a/0001-macros-remove-Cargo.lock.patch b/0001-macros-remove-Cargo.lock.patch index 435710c..eac95b4 100644 --- a/0001-macros-remove-Cargo.lock.patch +++ b/0001-macros-remove-Cargo.lock.patch @@ -1,7 +1,7 @@ From 5313b352712486b4001827b04d906bdb91be2314 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 8 Jan 2018 23:57:03 +0100 -Subject: [PATCH 1/2] macros: remove Cargo.lock +Subject: [PATCH 1/3] macros: remove Cargo.lock cargo-package automatically strips it out, but we package also some things directly from git. @@ -27,5 +27,5 @@ index ebf3edb..288554c 100644 # https://github.com/rust-lang/cargo/issues/3732 \ %{__awk} -i inplace -v INPLACE_SUFFIX=.orig '/^\\\[dev-dependencies/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ -- -2.15.1 +2.16.2 diff --git a/0002-macros-remove-spurious-whitespace.patch b/0002-macros-remove-spurious-whitespace.patch index 522e2b0..2033124 100644 --- a/0002-macros-remove-spurious-whitespace.patch +++ b/0002-macros-remove-spurious-whitespace.patch @@ -1,7 +1,7 @@ From cd6329635329fc7742a18f7ed0933298a0c56cf7 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 9 Jan 2018 06:52:36 +0100 -Subject: [PATCH 2/2] macros: remove spurious whitespace +Subject: [PATCH 2/3] macros: remove spurious whitespace Fixes: https://pagure.io/fedora-rust/rust2rpm/issue/48 Reported-by: Josh Stone @@ -24,5 +24,5 @@ index 288554c..67b1950 100644 %if ! %{with check} \ # https://github.com/rust-lang/cargo/issues/3732 \ -- -2.15.1 +2.16.2 diff --git a/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch b/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch new file mode 100644 index 0000000..f719a78 --- /dev/null +++ b/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch @@ -0,0 +1,50 @@ +From c5bab762f56bf07cd0f4a2e2d58b7c295cddedd8 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Tue, 20 Feb 2018 22:04:35 +0100 +Subject: [PATCH 3/3] macros: pass %__cargo_common_opts to %cargo_install + +Reason this has not been done before is that cargo-install doesn't +understand --release. Let's just add it to other commands and be done +with it. + +Reported-by: Josh Stone +Signed-off-by: Igor Gnatenko +--- + data/macros.cargo | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/data/macros.cargo b/data/macros.cargo +index 67b1950..22721e9 100644 +--- a/data/macros.cargo ++++ b/data/macros.cargo +@@ -1,5 +1,5 @@ + %__cargo %{_bindir}/cargo +-%__cargo_common_opts --release %{?_smp_mflags} ++%__cargo_common_opts %{?_smp_mflags} + %__cargo_inspector %{_bindir}/cargo-inspector + + %cargo_registry %{_datadir}/cargo/registry +@@ -35,9 +35,9 @@ EOF\ + %endif \ + ) + +-%cargo_build %__cargo build %{__cargo_common_opts} ++%cargo_build %__cargo build --release %{__cargo_common_opts} + +-%cargo_test %__cargo test %{__cargo_common_opts} --no-fail-fast ++%cargo_test %__cargo test --release %{__cargo_common_opts} --no-fail-fast + + %cargo_install (\ + set -eu \ +@@ -53,7 +53,7 @@ if %__cargo_is_lib; then \ + echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ + fi \ + if %__cargo_is_bin; then \ +- %__cargo install %{?_smp_mflags} --path . --root %{buildroot}%{_prefix} \ ++ %__cargo install %{__cargo_common_opts} --path . --root %{buildroot}%{_prefix} \ + %{__rm} %{buildroot}%{_prefix}/.crates.toml \ + fi \ + ) +-- +2.16.2 + diff --git a/rust-packaging.spec b/rust-packaging.spec index 1d5bfbc..f6ce2e1 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -2,7 +2,7 @@ Name: rust-packaging Version: 5 -Release: 5%{?dist} +Release: 6%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -10,6 +10,7 @@ URL: https://pagure.io/fedora-rust/rust2rpm Source0: https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz Patch0001: 0001-macros-remove-Cargo.lock.patch Patch0002: 0002-macros-remove-spurious-whitespace.patch +Patch0003: 0003-macros-pass-__cargo_common_opts-to-cargo_install.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch @@ -41,9 +42,6 @@ Requires: python3-semantic_version Requires: python3-jinja2 Requires: python3-requests Requires: python3-tqdm -%if 0%{?mageia} -Requires: locales-en -%endif Obsoletes: rust2rpm < 1-8 Provides: rust2rpm = %{version}-%{release} %{?python_provide:%python_provide python3-rust2rpm} @@ -53,15 +51,6 @@ Provides: rust2rpm = %{version}-%{release} %prep %autosetup -n rust2rpm-%{version} -p1 -lang= -%if 0%{?rhel} && 0%{?rhel} <= 7 -lang=C.UTF-8 -%else -%if 0%{?mageia} -lang=en_US.UTF-8 -%endif -%endif -[ -z "$lang" ] || sed -r -i -e "s|(%\{_bindir\}/cargo-inspector)|env LANG=$lang \1|" data/cargo.attr data/macros.cargo %build %py3_build @@ -89,6 +78,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Wed Feb 21 2018 Igor Gnatenko - 5-6 +- Pass %%__cargo_common_opts to %%cargo_install + * Tue Feb 20 2018 Igor Gnatenko - 5-5 - Explicitly require rust/cargo