Update to 6

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
epel9
Igor Gnatenko 7 years ago
parent 84bf5595e3
commit a85e0d862f
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C

1
.gitignore vendored

@ -1,2 +1,3 @@
/rust2rpm-4.tar.xz /rust2rpm-4.tar.xz
/rust2rpm-5.tar.xz /rust2rpm-5.tar.xz
/rust2rpm-6.tar.xz

@ -1,31 +0,0 @@
From 5313b352712486b4001827b04d906bdb91be2314 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Mon, 8 Jan 2018 23:57:03 +0100
Subject: [PATCH 1/5] macros: remove Cargo.lock
cargo-package automatically strips it out, but we package also some
things directly from git.
Acked-by: Josh Stone <jistone@redhat.com>
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
---
data/macros.cargo | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/data/macros.cargo b/data/macros.cargo
index ebf3edb..288554c 100644
--- a/data/macros.cargo
+++ b/data/macros.cargo
@@ -27,7 +27,8 @@ directory = "%{cargo_registry}"\
[source.crates-io]\
registry = "https://crates.io"\
replace-with = "local-registry"\
-EOF\
+EOF \
+%{__rm} -f Cargo.lock \
%if ! %{with check} \
# 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.18.0.rc2

@ -1,28 +0,0 @@
From cd6329635329fc7742a18f7ed0933298a0c56cf7 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Tue, 9 Jan 2018 06:52:36 +0100
Subject: [PATCH 2/5] macros: remove spurious whitespace
Fixes: https://pagure.io/fedora-rust/rust2rpm/issue/48
Reported-by: Josh Stone <jistone@redhat.com>
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
---
data/macros.cargo | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/macros.cargo b/data/macros.cargo
index 288554c..67b1950 100644
--- a/data/macros.cargo
+++ b/data/macros.cargo
@@ -27,7 +27,7 @@ directory = "%{cargo_registry}"\
[source.crates-io]\
registry = "https://crates.io"\
replace-with = "local-registry"\
-EOF \
+EOF\
%{__rm} -f Cargo.lock \
%if ! %{with check} \
# https://github.com/rust-lang/cargo/issues/3732 \
--
2.18.0.rc2

@ -1,50 +0,0 @@
From c5bab762f56bf07cd0f4a2e2d58b7c295cddedd8 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Tue, 20 Feb 2018 22:04:35 +0100
Subject: [PATCH 3/5] 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 <jistone@redhat.com>
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
---
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.18.0.rc2

@ -1,96 +0,0 @@
From c9ce952e260ec0adb166bd6e1de652a0277d2437 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Fri, 22 Jun 2018 21:04:59 +0200
Subject: [PATCH 4/5] macros: make %cargo_* macros parametric
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Unfortunately cargo-install doesn't accept --target-dir, so have to pass
setting through envvar.
Also %{shrink:…} them so it looks nicer in build log.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
---
data/macros.cargo | 62 ++++++++++++++++++++++++++++++++++-------------
1 file changed, 45 insertions(+), 17 deletions(-)
diff --git a/data/macros.cargo b/data/macros.cargo
index 22721e9..96a2931 100644
--- a/data/macros.cargo
+++ b/data/macros.cargo
@@ -35,25 +35,53 @@ EOF\
%endif \
)
-%cargo_build %__cargo build --release %{__cargo_common_opts}
+%__cargo_parse_opts(t:naf:) %{shrink:\
+%{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \
+ %{-t:--target-dir %{-t*}} \
+ %{-n:--no-default-features} \
+ %{-a:--all-features} \
+ %{-f:--features %{-f*}} \
+ %{nil}
+}
-%cargo_test %__cargo test --release %{__cargo_common_opts} --no-fail-fast
+%cargo_build(t:naf:) %{shrink:\
+%{__cargo} build \
+ %{__cargo_common_opts} \
+ --release \
+ %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \
+ %* \
+}
-%cargo_install (\
-set -eu \
-if %__cargo_is_lib; then \
- CRATE_NAME=$(%__cargo_inspector --name Cargo.toml) \
- CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \
- REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \
- %{__mkdir} -p $REG_DIR \
- %__cargo package -l | xargs %{__cp} --parents -a -t $REG_DIR \
-%if ! %{with check} \
- %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
-%endif \
- echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \
+%cargo_test(t:naf:) %{shrink:\
+%{__cargo} test \
+ %{__cargo_common_opts} \
+ --release \
+ --no-fail-fast \
+ %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \
+ %* \
+}
+
+%cargo_install(t:naf:) (\
+set -eu \
+if %__cargo_is_lib; then \
+ CRATE_NAME=$(%__cargo_inspector --name Cargo.toml) \
+ CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \
+ REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \
+ %{__mkdir} -p $REG_DIR \
+ %{__cargo} package -l | xargs %{__cp} --parents -a -t $REG_DIR \
+%if ! %{with check} \
+ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
+%endif \
+ echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \
fi \
-if %__cargo_is_bin; then \
- %__cargo install %{__cargo_common_opts} --path . --root %{buildroot}%{_prefix} \
- %{__rm} %{buildroot}%{_prefix}/.crates.toml \
+if %__cargo_is_bin; then \
+ %{shrink:%{-t:CARGO_TARGET_DIR=%{-t*}} %{__cargo} install \
+ %{__cargo_common_opts} \
+ --path . \
+ --root %{buildroot}%{_prefix} \
+ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
+ %* \
+ }\
+ %{__rm} %{buildroot}%{_prefix}/.crates.toml \
fi \
)
--
2.18.0.rc2

@ -1,71 +0,0 @@
From 80237720ae3397fc66d8f06e13f868c4bd2723c1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Date: Fri, 22 Jun 2018 21:53:09 +0200
Subject: [PATCH 5/5] macros: remove support for target-dir
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
---
data/macros.cargo | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/data/macros.cargo b/data/macros.cargo
index 96a2931..a0c456a 100644
--- a/data/macros.cargo
+++ b/data/macros.cargo
@@ -35,30 +35,29 @@ EOF\
%endif \
)
-%__cargo_parse_opts(t:naf:) %{shrink:\
+%__cargo_parse_opts(naf:) %{shrink:\
%{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \
- %{-t:--target-dir %{-t*}} \
%{-n:--no-default-features} \
%{-a:--all-features} \
%{-f:--features %{-f*}} \
%{nil}
}
-%cargo_build(t:naf:) %{shrink:\
-%{__cargo} build \
- %{__cargo_common_opts} \
- --release \
- %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \
- %* \
+%cargo_build(naf:) %{shrink:\
+%{__cargo} build \
+ %{__cargo_common_opts} \
+ --release \
+ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
+ %* \
}
-%cargo_test(t:naf:) %{shrink:\
-%{__cargo} test \
- %{__cargo_common_opts} \
- --release \
- --no-fail-fast \
- %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \
- %* \
+%cargo_test(naf:) %{shrink:\
+%{__cargo} test \
+ %{__cargo_common_opts} \
+ --release \
+ --no-fail-fast \
+ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
+ %* \
}
%cargo_install(t:naf:) (\
@@ -75,7 +74,7 @@ if %__cargo_is_lib; then \
echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \
fi \
if %__cargo_is_bin; then \
- %{shrink:%{-t:CARGO_TARGET_DIR=%{-t*}} %{__cargo} install \
+ %{shrink:%{__cargo} install \
%{__cargo_common_opts} \
--path . \
--root %{buildroot}%{_prefix} \
--
2.18.0.rc2

@ -1,18 +1,14 @@
%bcond_without check %bcond_without check
%{?python_enable_dependency_generator}
Name: rust-packaging Name: rust-packaging
Version: 5 Version: 6
Release: 11%{?dist} Release: 1%{?dist}
Summary: RPM macros for building Rust packages on various architectures Summary: RPM macros for building Rust packages on various architectures
License: MIT License: MIT
URL: https://pagure.io/fedora-rust/rust2rpm URL: https://pagure.io/fedora-rust/rust2rpm
Source0: https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz 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
Patch0004: 0004-macros-make-cargo_-macros-parametric.patch
Patch0005: 0005-macros-remove-support-for-target-dir.patch
BuildArch: noarch BuildArch: noarch
ExclusiveArch: %{rust_arches} noarch ExclusiveArch: %{rust_arches} noarch
@ -23,8 +19,6 @@ Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: rust-srpm-macros = %{version} Requires: rust-srpm-macros = %{version}
Requires: rust Requires: rust
Requires: cargo Requires: cargo
# Remove in F29
Obsoletes: rust-rpm-macros < 2-2
%description %description
The package provides macros for building projects in Rust The package provides macros for building projects in Rust
@ -37,14 +31,9 @@ BuildRequires: python3-setuptools
%if %{with check} %if %{with check}
BuildRequires: python3-pytest BuildRequires: python3-pytest
BuildRequires: cargo BuildRequires: cargo
BuildRequires: python3-semantic_version BuildRequires: python3dist(rustcfg)
%endif %endif
Requires: cargo Requires: cargo
Requires: python3-semantic_version
Requires: python3-jinja2
Requires: python3-requests
Requires: python3-tqdm
Obsoletes: rust2rpm < 1-8
Provides: rust2rpm = %{version}-%{release} Provides: rust2rpm = %{version}-%{release}
%{?python_provide:%python_provide python3-rust2rpm} %{?python_provide:%python_provide python3-rust2rpm}
@ -80,6 +69,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/ %{python3_sitelib}/rust2rpm/
%changelog %changelog
* Sun Sep 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 6-1
- Update to 6
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5-11 * Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

@ -1 +1 @@
SHA512 (rust2rpm-5.tar.xz) = e61c0c9351b3bc76b576fc57950b96793f805109e56d1021da94e5dfceb9d299c868f980de298d6a7f85e1b3477f785df7b5615c702e6a0ac25070fbffc013f3 SHA512 (rust2rpm-6.tar.xz) = 408988351156d858f7429d990d7330f216b54add671c6e90e54917e717ad6f2b3b99e414289c252e6a2b5dfad73ce430ac73f03265f6e174ef53edcee34d0fe2

Loading…
Cancel
Save