The package rpms/rust-packaging.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/rust-packaging.git/commit/?id=965...
https://src.fedoraproject.org/cgit/rpms/rust-packaging.git/commit/?id=4e5....
Change:
+ExclusiveArch: %{rust_arches}
+ExclusiveArch: %{rust_arches} noarch
Thanks.
Full change:
============
commit 9d3869c3408529507f7902b2b2903f0de9edf4a3
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon Mar 11 00:09:20 2019 +0100
Install $PWD/Cargo.toml into $REG_DIR/Cargo.toml
For things which are just including files, deps one doesn't get
installed into the registry.
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0019-Do-not-pull-optional-dependencies.patch
b/0019-Do-not-pull-optional-dependencies.patch
index 5b8a70e..814c920 100644
--- a/0019-Do-not-pull-optional-dependencies.patch
+++ b/0019-Do-not-pull-optional-dependencies.patch
@@ -1,4 +1,4 @@
-From 643bf0d32982b67854a39586244b25f54518de02 Mon Sep 17 00:00:00 2001
+From 604938a8bab778c58333643c3e069533327699e2 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat, 9 Mar 2019 22:04:49 +0100
Subject: [PATCH 19/19] Do not pull optional dependencies
@@ -10,7 +10,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/data/macros.cargo b/data/macros.cargo
-index 96dc354..f950e79 100644
+index 96dc354..999d787 100644
--- a/data/macros.cargo
+++ b/data/macros.cargo
@@ -2,8 +2,10 @@
@@ -50,7 +50,7 @@ index 96dc354..f950e79 100644
- %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
-%endif \
+ %{__mv} Cargo.toml{.deps,} \
-+ %{__mv} $REG_DIR/Cargo.toml{.deps,} \
++ %{__cp} -a Cargo.toml $REG_DIR/Cargo.toml \
+ %{__rm} -f $REG_DIR/Cargo.toml.orig \
echo '{"files":{},"package":""}' >
$REG_DIR/.cargo-checksum.json \
fi \
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 0ea39e1..7412fdf 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -5,7 +5,7 @@
Name: rust-packaging
Version: 6
-Release: 27%{?dist}
+Release: 28%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -91,6 +91,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sun Mar 10 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-28
+- Install $PWD/Cargo.toml into $REG_DIR/Cargo.toml
+
* Sun Mar 10 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-27
- Restore Cargo.toml.deps into $PWD/Cargo.toml
commit 56c2dbcef5aaf80855873b67964e94c48d137df3
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Mar 10 23:34:05 2019 +0100
Restore Cargo.toml.deps into $PWD/Cargo.toml
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0019-Do-not-pull-optional-dependencies.patch
b/0019-Do-not-pull-optional-dependencies.patch
index 80d715a..5b8a70e 100644
--- a/0019-Do-not-pull-optional-dependencies.patch
+++ b/0019-Do-not-pull-optional-dependencies.patch
@@ -1,16 +1,16 @@
-From 72d9afecc6da319e1d59170f07a7b78afbbb1a68 Mon Sep 17 00:00:00 2001
+From 643bf0d32982b67854a39586244b25f54518de02 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat, 9 Mar 2019 22:04:49 +0100
Subject: [PATCH 19/19] Do not pull optional dependencies
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
- data/macros.cargo | 13 +++++++++++--
+ data/macros.cargo | 20 +++++++++++---------
rust2rpm/templates/main.spec | 5 -----
- 2 files changed, 11 insertions(+), 7 deletions(-)
+ 2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/data/macros.cargo b/data/macros.cargo
-index 96dc354..b1a2e0b 100644
+index 96dc354..f950e79 100644
--- a/data/macros.cargo
+++ b/data/macros.cargo
@@ -2,8 +2,10 @@
@@ -26,7 +26,18 @@ index 96dc354..b1a2e0b 100644
%__cargo_inspector %{_bindir}/cargo-inspector
%cargo_registry %{_datadir}/cargo/registry
-@@ -74,10 +76,17 @@ if %__cargo_is_lib; then
\
+@@ -36,10 +38,6 @@ registry = "https://crates.io"\
+ replace-with = "local-registry"\
+ 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 \
+-%endif \
+ )
+
+ %__cargo_parse_opts(naf:) %{shrink:\
+@@ -74,10 +72,14 @@ if %__cargo_is_lib; then
\
CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \
REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \
%{__mkdir} -p $REG_DIR \
@@ -35,12 +46,12 @@ index 96dc354..b1a2e0b 100644
+#
https://github.com/rust-lang/cargo/pull/6729 \
+ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps
'/^\\\[((.+\\\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\\\[/{f=0};
!f' Cargo.toml \
%{__cargo} package -l | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \
- %if ! %{with check} \
- %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
-+%else \
-+ %{__cp} -a Cargo.toml.deps $REG_DIR/Cargo.toml \
- %endif \
-+ %{__rm} -f $REG_DIR/Cargo.toml.{orig,deps} \
+-%if ! %{with check} \
+- %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
+-%endif \
++ %{__mv} Cargo.toml{.deps,} \
++ %{__mv} $REG_DIR/Cargo.toml{.deps,} \
++ %{__rm} -f $REG_DIR/Cargo.toml.orig \
echo '{"files":{},"package":""}' >
$REG_DIR/.cargo-checksum.json \
fi \
if %__cargo_is_bin; then \
diff --git a/rust-packaging.spec b/rust-packaging.spec
index f315a93..0ea39e1 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -5,7 +5,7 @@
Name: rust-packaging
Version: 6
-Release: 26%{?dist}
+Release: 27%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -91,6 +91,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sun Mar 10 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-27
+- Restore Cargo.toml.deps into $PWD/Cargo.toml
+
* Sun Mar 10 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-26
- Strip out target dependencies too
commit 2736dc0ce240753e28a3a2d5092925317eb8b5fe
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Mar 10 20:12:00 2019 +0100
Strip out target dependencies too
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0019-Do-not-pull-optional-dependencies.patch
b/0019-Do-not-pull-optional-dependencies.patch
index 0d746e6..80d715a 100644
--- a/0019-Do-not-pull-optional-dependencies.patch
+++ b/0019-Do-not-pull-optional-dependencies.patch
@@ -1,4 +1,4 @@
-From 5fbb0558d401c26f04e274b6b1fc5b0ed9d6e4cd Mon Sep 17 00:00:00 2001
+From 72d9afecc6da319e1d59170f07a7b78afbbb1a68 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat, 9 Mar 2019 22:04:49 +0100
Subject: [PATCH 19/19] Do not pull optional dependencies
@@ -10,7 +10,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/data/macros.cargo b/data/macros.cargo
-index 96dc354..a816578 100644
+index 96dc354..b1a2e0b 100644
--- a/data/macros.cargo
+++ b/data/macros.cargo
@@ -2,8 +2,10 @@
@@ -33,7 +33,7 @@ index 96dc354..a816578 100644
+# Drop all dependency/features information \
+# so that cargo doesn't fail resolving dependencies: \
+#
https://github.com/rust-lang/cargo/pull/6729 \
-+ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps
'/^\\\[((dev-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \
++ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps
'/^\\\[((.+\\\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\\\[/{f=0};
!f' Cargo.toml \
%{__cargo} package -l | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \
%if ! %{with check} \
%{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 2418d1d..f315a93 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -5,7 +5,7 @@
Name: rust-packaging
Version: 6
-Release: 25%{?dist}
+Release: 26%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -91,6 +91,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sun Mar 10 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-26
+- Strip out target dependencies too
+
* Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-25
- Do not error on removing files which do not exist
commit e9a1f98b3d12d3661a330dc1ff11a1593f8a594e
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Mar 10 10:42:12 2019 +0100
Do not error on removing files which do not exist
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0019-Do-not-pull-optional-dependencies.patch
b/0019-Do-not-pull-optional-dependencies.patch
index 363fdc4..0d746e6 100644
--- a/0019-Do-not-pull-optional-dependencies.patch
+++ b/0019-Do-not-pull-optional-dependencies.patch
@@ -1,4 +1,4 @@
-From ccc7ed42c168675efc4b9719dad12800b92450d5 Mon Sep 17 00:00:00 2001
+From 5fbb0558d401c26f04e274b6b1fc5b0ed9d6e4cd Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat, 9 Mar 2019 22:04:49 +0100
Subject: [PATCH 19/19] Do not pull optional dependencies
@@ -10,7 +10,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/data/macros.cargo b/data/macros.cargo
-index 96dc354..4e8f0c9 100644
+index 96dc354..a816578 100644
--- a/data/macros.cargo
+++ b/data/macros.cargo
@@ -2,8 +2,10 @@
@@ -40,7 +40,7 @@ index 96dc354..4e8f0c9 100644
+%else \
+ %{__cp} -a Cargo.toml.deps $REG_DIR/Cargo.toml \
%endif \
-+ %{__rm} $REG_DIR/Cargo.toml.{orig,deps} \
++ %{__rm} -f $REG_DIR/Cargo.toml.{orig,deps} \
echo '{"files":{},"package":""}' >
$REG_DIR/.cargo-checksum.json \
fi \
if %__cargo_is_bin; then \
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 80e49bc..2418d1d 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -5,7 +5,7 @@
Name: rust-packaging
Version: 6
-Release: 24%{?dist}
+Release: 25%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -91,6 +91,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-25
+- Do not error on removing files which do not exist
+
* Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-24
- Escape `\n` properly in macro file
commit 60f3d8f016932795e43c88d70d9bb7d733da9a92
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Mar 10 10:16:51 2019 +0100
Escape `\n` properly in macro file
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch
b/0001-name-spec-patch_file-by-real-crate-name.patch
index 54c5624..d8df04a 100644
--- a/0001-name-spec-patch_file-by-real-crate-name.patch
+++ b/0001-name-spec-patch_file-by-real-crate-name.patch
@@ -1,7 +1,7 @@
From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:37:40 +0200
-Subject: [PATCH 01/18] name spec/patch_file by real crate name
+Subject: [PATCH 01/19] name spec/patch_file by real crate name
When renaming using patch file, we really want to change file names too.
diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch
index 5264c8d..7d5550b 100644
--- a/0002-generate-doc-statements.patch
+++ b/0002-generate-doc-statements.patch
@@ -1,7 +1,7 @@
From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:40:18 +0200
-Subject: [PATCH 02/18] generate %doc statements
+Subject: [PATCH 02/19] generate %doc statements
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0003-do-better-for-renamed-crates.patch
b/0003-do-better-for-renamed-crates.patch
index 2f72093..97d5815 100644
--- a/0003-do-better-for-renamed-crates.patch
+++ b/0003-do-better-for-renamed-crates.patch
@@ -1,7 +1,7 @@
From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 00:06:50 +0200
-Subject: [PATCH 03/18] do better for renamed crates
+Subject: [PATCH 03/19] do better for renamed crates
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch
index 34dcf6a..017fb26 100644
--- a/0004-remove-pre-3.6-leftovers.patch
+++ b/0004-remove-pre-3.6-leftovers.patch
@@ -1,7 +1,7 @@
From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 10:43:53 +0200
-Subject: [PATCH 04/18] remove pre-3.6 leftovers
+Subject: [PATCH 04/19] remove pre-3.6 leftovers
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0005-Remove-half-downloaded-crate-on-C.patch
b/0005-Remove-half-downloaded-crate-on-C.patch
index 6546060..033815b 100644
--- a/0005-Remove-half-downloaded-crate-on-C.patch
+++ b/0005-Remove-half-downloaded-crate-on-C.patch
@@ -1,7 +1,7 @@
From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:03:48 +0200
-Subject: [PATCH 05/18] Remove half-downloaded crate on ^C
+Subject: [PATCH 05/19] Remove half-downloaded crate on ^C
Subsequent invocations would fail with an error about a corrupted file.
We don't have support for resuming a failed download, so let's remove the
diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
index 8efbc88..861d233 100644
--- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
+++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
@@ -1,7 +1,7 @@
From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:18:59 +0200
-Subject: [PATCH 06/18] Throw an error if -s is used without a crate
+Subject: [PATCH 06/19] Throw an error if -s is used without a crate
In the future we might want to be smarter and find the crate, but let's at least
not ignore the option completely.
diff --git a/0007-split-features-into-subpackages.patch
b/0007-split-features-into-subpackages.patch
index 9aba559..acf5911 100644
--- a/0007-split-features-into-subpackages.patch
+++ b/0007-split-features-into-subpackages.patch
@@ -1,7 +1,7 @@
From 2cac5e5ad5ff5472923ce333bef59679612bbaa2 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri, 26 Oct 2018 11:20:13 +0200
-Subject: [PATCH 07/18] split features into subpackages
+Subject: [PATCH 07/19] split features into subpackages
References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-fe...
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0008-add-support-for-dependencies-with-same-name.patch
b/0008-add-support-for-dependencies-with-same-name.patch
index 30b6c33..5412d76 100644
--- a/0008-add-support-for-dependencies-with-same-name.patch
+++ b/0008-add-support-for-dependencies-with-same-name.patch
@@ -1,7 +1,7 @@
From a1d3a84645aa7bbe5ca07b60bead1ddf90a21cc1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 30 Oct 2018 20:37:38 +0100
-Subject: [PATCH 08/18] add support for dependencies with same name
+Subject: [PATCH 08/19] add support for dependencies with same name
Reported-by: Josh Stone <jistone(a)redhat.com>
References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
diff --git a/0009-add-support-for-feeding-user-configuration.patch
b/0009-add-support-for-feeding-user-configuration.patch
index e2abc6e..8985513 100644
--- a/0009-add-support-for-feeding-user-configuration.patch
+++ b/0009-add-support-for-feeding-user-configuration.patch
@@ -1,7 +1,7 @@
From 197150ee2e862edcd46f7ab02c9e4d17e49ca75d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 18:03:21 +0100
-Subject: [PATCH 09/18] add support for feeding user configuration
+Subject: [PATCH 09/19] add support for feeding user configuration
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0010-trivial-use-f-strings-everywhere.patch
b/0010-trivial-use-f-strings-everywhere.patch
index dd9436d..c98be77 100644
--- a/0010-trivial-use-f-strings-everywhere.patch
+++ b/0010-trivial-use-f-strings-everywhere.patch
@@ -1,7 +1,7 @@
From 83ea3796cd28ec7689b39e7dc7a70bd11af1abf1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 17:00:58 +0100
-Subject: [PATCH 10/18] trivial: use f-strings everywhere
+Subject: [PATCH 10/19] trivial: use f-strings everywhere
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
index c03faa6..8457b4a 100644
--- a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
+++ b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
@@ -1,7 +1,7 @@
From 294c6f571c0f4f7ed5a4fcb34142b0d332c55f29 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13(a)gmail.com>
Date: Sun, 11 Nov 2018 11:06:27 -0500
-Subject: [PATCH 11/18] Add option to not generate a default changelog entry
+Subject: [PATCH 11/19] Add option to not generate a default changelog entry
For Rust packages created through the OBS source service, the
changelog is managed by an external <pkg>.changes file that is
diff --git a/0012-Set-CARGO_HOME-to-the-local-.config.patch
b/0012-Set-CARGO_HOME-to-the-local-.config.patch
index a8e5ea1..e9e37de 100644
--- a/0012-Set-CARGO_HOME-to-the-local-.config.patch
+++ b/0012-Set-CARGO_HOME-to-the-local-.config.patch
@@ -1,7 +1,7 @@
From b4e25038296cd57eba639a059e8baaf139a5d287 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone(a)redhat.com>
Date: Fri, 7 Dec 2018 13:58:41 -0800
-Subject: [PATCH 12/18] Set CARGO_HOME to the local .config
+Subject: [PATCH 12/19] Set CARGO_HOME to the local .config
---
data/macros.cargo | 6 +++++-
diff --git a/0013-Set-the-install-root-in-.cargo-config.patch
b/0013-Set-the-install-root-in-.cargo-config.patch
index e2ef86e..0b97943 100644
--- a/0013-Set-the-install-root-in-.cargo-config.patch
+++ b/0013-Set-the-install-root-in-.cargo-config.patch
@@ -1,7 +1,7 @@
From a04e95bc4f807139bd3c4b75f46fd9a60ec1db8f Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone(a)redhat.com>
Date: Fri, 7 Dec 2018 13:59:03 -0800
-Subject: [PATCH 13/18] Set the install root in .cargo/config
+Subject: [PATCH 13/19] Set the install root in .cargo/config
---
data/macros.cargo | 4 +++-
diff --git a/0014-licensing-fix-zlib-license-translation.patch
b/0014-licensing-fix-zlib-license-translation.patch
index fc8a165..a04f0db 100644
--- a/0014-licensing-fix-zlib-license-translation.patch
+++ b/0014-licensing-fix-zlib-license-translation.patch
@@ -1,7 +1,7 @@
From 7c00b0f29085166b1a89aec766945b10dc7aca23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Sat, 1 Dec 2018 15:40:08 +0100
-Subject: [PATCH 14/18] licensing: fix zlib license translation
+Subject: [PATCH 14/19] licensing: fix zlib license translation
The file was mangled, and something about "teeworlds" was inserted
into the line for zlib. The spdx database doesn't list "teeworlds
diff --git a/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch
b/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch
index 76be3f8..ffe83aa 100644
--- a/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch
+++ b/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch
@@ -1,7 +1,7 @@
From b0d2756917b380a5d66d2407dbeb8891c51875e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Sat, 1 Dec 2018 15:46:08 +0100
-Subject: [PATCH 15/18] licensing: rename EPL to EPL-1.0 and add EPL-2.0
+Subject: [PATCH 15/19] licensing: rename EPL to EPL-1.0 and add EPL-2.0
According to
https://fedoraproject.org/wiki/Licensing:Main#Software_License_List
EPL-1.0 and EPL-2.0 are the short tags that should be used now.
diff --git a/0016-Add-support-for-prerelease-versions.patch
b/0016-Add-support-for-prerelease-versions.patch
index 187a47d..cbffd10 100644
--- a/0016-Add-support-for-prerelease-versions.patch
+++ b/0016-Add-support-for-prerelease-versions.patch
@@ -1,7 +1,7 @@
From 00c0c5cec90d5d6abbfd4acb2f5d65439b4bfd27 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat, 26 Jan 2019 08:33:37 +0100
-Subject: [PATCH 16/18] Add support for prerelease versions
+Subject: [PATCH 16/19] Add support for prerelease versions
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0017-data-Cargo-doesn-t-escape-paths-with-space.patch
b/0017-data-Cargo-doesn-t-escape-paths-with-space.patch
index 90dadeb..0d031b0 100644
--- a/0017-data-Cargo-doesn-t-escape-paths-with-space.patch
+++ b/0017-data-Cargo-doesn-t-escape-paths-with-space.patch
@@ -1,7 +1,7 @@
From 84a73bfa24ce11602a1f19554dc495125be4d0aa Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun, 17 Feb 2019 17:19:25 +0100
-Subject: [PATCH 17/18] data: Cargo doesn't escape paths with space
+Subject: [PATCH 17/19] data: Cargo doesn't escape paths with space
When building matrixmultiply v0.2.2:
diff --git a/0018-Do-not-pull-optional-dependencies.patch
b/0018-Do-not-pull-optional-dependencies.patch
deleted file mode 100644
index 68f2a8c..0000000
--- a/0018-Do-not-pull-optional-dependencies.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From b0f34c2b6a7b8ca5b924e5c230f1271826114cb0 Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
-Date: Sat, 9 Mar 2019 22:04:49 +0100
-Subject: [PATCH 18/18] Do not pull optional dependencies
-
-Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
----
- data/macros.cargo | 13 +++++++++++--
- rust2rpm/templates/main.spec | 5 -----
- 2 files changed, 11 insertions(+), 7 deletions(-)
-
-diff --git a/data/macros.cargo b/data/macros.cargo
-index 9a375d0..0e382c8 100644
---- a/data/macros.cargo
-+++ b/data/macros.cargo
-@@ -2,8 +2,10 @@
- #
https://github.com/rust-lang/cargo/issues/6397
- # But we can set CARGO_HOME locally, which is a good idea anyway to make sure
- # it never writes to ~/.cargo during rpmbuild.
--%__cargo %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo
--%__cargo_common_opts %{?_smp_mflags}
-+# We also need RUSTC_BOOTSTRAP since we use -Z avoid-dev-deps
-+# until it gets stabilized:
https://github.com/rust-lang/cargo/issues/5133
-+%__cargo %{_bindir}/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 %{_bindir}/cargo
-+%__cargo_common_opts %{?_smp_mflags} -Z avoid-dev-deps
- %__cargo_inspector %{_bindir}/cargo-inspector
-
- %cargo_registry %{_datadir}/cargo/registry
-@@ -74,10 +76,17 @@ if %__cargo_is_lib; then
\
- CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \
- REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \
- %{__mkdir} -p $REG_DIR \
-+# Drop all dependency/features information \
-+# so that cargo doesn't fail resolving dependencies: \
-+#
https://github.com/rust-lang/cargo/pull/6729 \
-+ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps
'/^\\\[((dev-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \
- %{__cargo} package -l | xargs -d '\n' %{__cp} --parents -a -t $REG_DIR \
- %if ! %{with check} \
- %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
-+%else \
-+ %{__cp} -a Cargo.toml.deps $REG_DIR/Cargo.toml \
- %endif \
-+ %{__rm} $REG_DIR/Cargo.toml.{orig,deps} \
- echo '{"files":{},"package":""}' >
$REG_DIR/.cargo-checksum.json \
- fi \
- if %__cargo_is_bin; then \
-diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
-index 1ebef7b..f0c5445 100644
---- a/rust2rpm/templates/main.spec
-+++ b/rust2rpm/templates/main.spec
-@@ -44,12 +44,7 @@ Patch0: {{ patch_file }}
- ExclusiveArch: %{rust_arches}
-
- BuildRequires: rust-packaging
--{# We will put all non-optional and optional dependencies until
--
https://github.com/rust-lang/cargo/issues/5133
-- is solved
- {% set buildrequires = normalize_deps(md.requires("default",
resolve=True))|sort %}
--#}
--{% set buildrequires = normalize_deps(md.all_dependencies)|sort %}
- {% for req in buildrequires %}
- BuildRequires: {{ req }}
- {% endfor %}
---
-2.21.0
-
diff --git a/0018-data-Escape-n-properly.patch b/0018-data-Escape-n-properly.patch
new file mode 100644
index 0000000..c9bffdf
--- /dev/null
+++ b/0018-data-Escape-n-properly.patch
@@ -0,0 +1,26 @@
+From 7f0a499ff3fca046869ab754151ae068903c4ab9 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Sun, 10 Mar 2019 10:14:28 +0100
+Subject: [PATCH 18/19] data: Escape `\n` properly
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ data/macros.cargo | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/data/macros.cargo b/data/macros.cargo
+index 9a375d0..96dc354 100644
+--- a/data/macros.cargo
++++ b/data/macros.cargo
+@@ -74,7 +74,7 @@ if %__cargo_is_lib; then \
+ CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \
+ REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \
+ %{__mkdir} -p $REG_DIR \
+- %{__cargo} package -l | xargs -d '\n' %{__cp} --parents -a -t $REG_DIR \
++ %{__cargo} package -l | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \
+ %if ! %{with check} \
+ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
+ %endif \
+--
+2.21.0
+
diff --git a/0019-Do-not-pull-optional-dependencies.patch
b/0019-Do-not-pull-optional-dependencies.patch
new file mode 100644
index 0000000..363fdc4
--- /dev/null
+++ b/0019-Do-not-pull-optional-dependencies.patch
@@ -0,0 +1,66 @@
+From ccc7ed42c168675efc4b9719dad12800b92450d5 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Sat, 9 Mar 2019 22:04:49 +0100
+Subject: [PATCH 19/19] Do not pull optional dependencies
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ data/macros.cargo | 13 +++++++++++--
+ rust2rpm/templates/main.spec | 5 -----
+ 2 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/data/macros.cargo b/data/macros.cargo
+index 96dc354..4e8f0c9 100644
+--- a/data/macros.cargo
++++ b/data/macros.cargo
+@@ -2,8 +2,10 @@
+ #
https://github.com/rust-lang/cargo/issues/6397
+ # But we can set CARGO_HOME locally, which is a good idea anyway to make sure
+ # it never writes to ~/.cargo during rpmbuild.
+-%__cargo %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo
+-%__cargo_common_opts %{?_smp_mflags}
++# We also need RUSTC_BOOTSTRAP since we use -Z avoid-dev-deps
++# until it gets stabilized:
https://github.com/rust-lang/cargo/issues/5133
++%__cargo %{_bindir}/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 %{_bindir}/cargo
++%__cargo_common_opts %{?_smp_mflags} -Z avoid-dev-deps
+ %__cargo_inspector %{_bindir}/cargo-inspector
+
+ %cargo_registry %{_datadir}/cargo/registry
+@@ -74,10 +76,17 @@ if %__cargo_is_lib; then
\
+ CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \
+ REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \
+ %{__mkdir} -p $REG_DIR \
++# Drop all dependency/features information \
++# so that cargo doesn't fail resolving dependencies: \
++#
https://github.com/rust-lang/cargo/pull/6729 \
++ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps
'/^\\\[((dev-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \
+ %{__cargo} package -l | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \
+ %if ! %{with check} \
+ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
++%else \
++ %{__cp} -a Cargo.toml.deps $REG_DIR/Cargo.toml \
+ %endif \
++ %{__rm} $REG_DIR/Cargo.toml.{orig,deps} \
+ echo '{"files":{},"package":""}' >
$REG_DIR/.cargo-checksum.json \
+ fi \
+ if %__cargo_is_bin; then \
+diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
+index 1ebef7b..f0c5445 100644
+--- a/rust2rpm/templates/main.spec
++++ b/rust2rpm/templates/main.spec
+@@ -44,12 +44,7 @@ Patch0: {{ patch_file }}
+ ExclusiveArch: %{rust_arches}
+
+ BuildRequires: rust-packaging
+-{# We will put all non-optional and optional dependencies until
+-
https://github.com/rust-lang/cargo/issues/5133
+- is solved
+ {% set buildrequires = normalize_deps(md.requires("default",
resolve=True))|sort %}
+-#}
+-{% set buildrequires = normalize_deps(md.all_dependencies)|sort %}
+ {% for req in buildrequires %}
+ BuildRequires: {{ req }}
+ {% endfor %}
+--
+2.21.0
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 3f2294c..80e49bc 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -5,7 +5,7 @@
Name: rust-packaging
Version: 6
-Release: 23%{?dist}
+Release: 24%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -28,8 +28,9 @@ Patch0014: 0014-licensing-fix-zlib-license-translation.patch
Patch0015: 0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch
Patch0016: 0016-Add-support-for-prerelease-versions.patch
Patch0017: 0017-data-Cargo-doesn-t-escape-paths-with-space.patch
-#
https://pagure.io/fedora-rust/rust2rpm/pull-request/68<Paste>
-Patch0018: 0018-Do-not-pull-optional-dependencies.patch
+Patch0018: 0018-data-Escape-n-properly.patch
+#
https://pagure.io/fedora-rust/rust2rpm/pull-request/68
+Patch0019: 0019-Do-not-pull-optional-dependencies.patch
ExclusiveArch: %{rust_arches}
@@ -90,6 +91,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-24
+- Escape `\n` properly in macro file
+
* Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-23
- Do not pull optional deps into BRs and trivial fixes
commit 5955f7d37d64720aa2f2f4147085f23fcce36d95
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Mar 10 09:49:25 2019 +0100
Do not pull optional deps into BRs and trivial fixes
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch
b/0001-name-spec-patch_file-by-real-crate-name.patch
index 4d55717..54c5624 100644
--- a/0001-name-spec-patch_file-by-real-crate-name.patch
+++ b/0001-name-spec-patch_file-by-real-crate-name.patch
@@ -1,7 +1,7 @@
From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:37:40 +0200
-Subject: [PATCH 01/14] name spec/patch_file by real crate name
+Subject: [PATCH 01/18] name spec/patch_file by real crate name
When renaming using patch file, we really want to change file names too.
@@ -33,5 +33,5 @@ index dc78828..1575ce6 100644
if args.stdout:
print("# {}".format(spec_file))
--
-2.20.1
+2.21.0
diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch
index 42ca40d..5264c8d 100644
--- a/0002-generate-doc-statements.patch
+++ b/0002-generate-doc-statements.patch
@@ -1,7 +1,7 @@
From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:40:18 +0200
-Subject: [PATCH 02/14] generate %doc statements
+Subject: [PATCH 02/18] generate %doc statements
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -54,5 +54,5 @@ index 1aeb969..2e9f841 100644
{% endif %}
--
-2.20.1
+2.21.0
diff --git a/0003-do-better-for-renamed-crates.patch
b/0003-do-better-for-renamed-crates.patch
index 3f1bc98..2f72093 100644
--- a/0003-do-better-for-renamed-crates.patch
+++ b/0003-do-better-for-renamed-crates.patch
@@ -1,7 +1,7 @@
From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 00:06:50 +0200
-Subject: [PATCH 03/14] do better for renamed crates
+Subject: [PATCH 03/18] do better for renamed crates
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -86,5 +86,5 @@ index 2e9f841..7dbcc3f 100644
%build
--
-2.20.1
+2.21.0
diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch
index 7133f4e..34dcf6a 100644
--- a/0004-remove-pre-3.6-leftovers.patch
+++ b/0004-remove-pre-3.6-leftovers.patch
@@ -1,7 +1,7 @@
From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 10:43:53 +0200
-Subject: [PATCH 04/14] remove pre-3.6 leftovers
+Subject: [PATCH 04/18] remove pre-3.6 leftovers
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -23,5 +23,5 @@ index f52d968..5adeb65 100644
+
"--manifest-path={}".format(path)])
return cls.from_json(json.loads(metadata))
--
-2.20.1
+2.21.0
diff --git a/0005-Remove-half-downloaded-crate-on-C.patch
b/0005-Remove-half-downloaded-crate-on-C.patch
index 8ae52e4..6546060 100644
--- a/0005-Remove-half-downloaded-crate-on-C.patch
+++ b/0005-Remove-half-downloaded-crate-on-C.patch
@@ -1,7 +1,7 @@
From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:03:48 +0200
-Subject: [PATCH 05/14] Remove half-downloaded crate on ^C
+Subject: [PATCH 05/18] Remove half-downloaded crate on ^C
Subsequent invocations would fail with an error about a corrupted file.
We don't have support for resuming a failed download, so let's remove the
@@ -40,5 +40,5 @@ index e993e7b..8e6f6eb 100644
total=total, unit="B", unit_scale=True):
f.write(chunk)
--
-2.20.1
+2.21.0
diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
index 8684175..8efbc88 100644
--- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
+++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
@@ -1,7 +1,7 @@
From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:18:59 +0200
-Subject: [PATCH 06/14] Throw an error if -s is used without a crate
+Subject: [PATCH 06/18] Throw an error if -s is used without a crate
In the future we might want to be smarter and find the crate, but let's at least
not ignore the option completely.
@@ -24,5 +24,5 @@ index 8e6f6eb..f23ebbc 100644
diff = make_patch(toml, enabled=patch, tmpfile=True)
metadata = Metadata.from_file(toml)
--
-2.20.1
+2.21.0
diff --git a/0007-split-features-into-subpackages.patch
b/0007-split-features-into-subpackages.patch
index 19fd5e5..9aba559 100644
--- a/0007-split-features-into-subpackages.patch
+++ b/0007-split-features-into-subpackages.patch
@@ -1,7 +1,7 @@
From 2cac5e5ad5ff5472923ce333bef59679612bbaa2 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri, 26 Oct 2018 11:20:13 +0200
-Subject: [PATCH 07/14] split features into subpackages
+Subject: [PATCH 07/18] split features into subpackages
References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-fe...
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
@@ -1060,5 +1060,5 @@ index b856fdd..30263b4 100644
- assert [str(x) for x in md.provides] == provides
- assert [str(x) for x in md.requires] == requires
--
-2.20.1
+2.21.0
diff --git a/0008-add-support-for-dependencies-with-same-name.patch
b/0008-add-support-for-dependencies-with-same-name.patch
index f6f2743..30b6c33 100644
--- a/0008-add-support-for-dependencies-with-same-name.patch
+++ b/0008-add-support-for-dependencies-with-same-name.patch
@@ -1,7 +1,7 @@
From a1d3a84645aa7bbe5ca07b60bead1ddf90a21cc1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 30 Oct 2018 20:37:38 +0100
-Subject: [PATCH 08/14] add support for dependencies with same name
+Subject: [PATCH 08/18] add support for dependencies with same name
Reported-by: Josh Stone <jistone(a)redhat.com>
References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
@@ -70,5 +70,5 @@ index 4929cdd..328b67a 100644
if "default" not in deps_by_feature:
--
-2.20.1
+2.21.0
diff --git a/0009-add-support-for-feeding-user-configuration.patch
b/0009-add-support-for-feeding-user-configuration.patch
index 5078943..e2abc6e 100644
--- a/0009-add-support-for-feeding-user-configuration.patch
+++ b/0009-add-support-for-feeding-user-configuration.patch
@@ -1,7 +1,7 @@
From 197150ee2e862edcd46f7ab02c9e4d17e49ca75d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 18:03:21 +0100
-Subject: [PATCH 09/14] add support for feeding user configuration
+Subject: [PATCH 09/18] add support for feeding user configuration
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -144,5 +144,5 @@ index 0d9a80b..d901e6d 100644
%description {{ pkg }} %{_description}
--
-2.20.1
+2.21.0
diff --git a/0010-trivial-use-f-strings-everywhere.patch
b/0010-trivial-use-f-strings-everywhere.patch
index 72c5828..dd9436d 100644
--- a/0010-trivial-use-f-strings-everywhere.patch
+++ b/0010-trivial-use-f-strings-everywhere.patch
@@ -1,7 +1,7 @@
From 83ea3796cd28ec7689b39e7dc7a70bd11af1abf1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 17:00:58 +0100
-Subject: [PATCH 10/14] trivial: use f-strings everywhere
+Subject: [PATCH 10/18] trivial: use f-strings everywhere
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -90,5 +90,5 @@ index c691274..b60e6c4 100644
else:
with open(spec_file, "w") as fobj:
--
-2.20.1
+2.21.0
diff --git a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
index 4345add..c03faa6 100644
--- a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
+++ b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
@@ -1,7 +1,7 @@
From 294c6f571c0f4f7ed5a4fcb34142b0d332c55f29 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13(a)gmail.com>
Date: Sun, 11 Nov 2018 11:06:27 -0500
-Subject: [PATCH 11/14] Add option to not generate a default changelog entry
+Subject: [PATCH 11/18] Add option to not generate a default changelog entry
For Rust packages created through the OBS source service, the
changelog is managed by an external <pkg>.changes file that is
@@ -59,5 +59,5 @@ index d901e6d..84bd97d 100644
+ {% include target ~ "-changelog.spec.inc" %}
+{% endif %}
--
-2.20.1
+2.21.0
diff --git a/0012-Set-CARGO_HOME-to-the-local-.config.patch
b/0012-Set-CARGO_HOME-to-the-local-.config.patch
index ddf86d1..a8e5ea1 100644
--- a/0012-Set-CARGO_HOME-to-the-local-.config.patch
+++ b/0012-Set-CARGO_HOME-to-the-local-.config.patch
@@ -1,7 +1,7 @@
From b4e25038296cd57eba639a059e8baaf139a5d287 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone(a)redhat.com>
Date: Fri, 7 Dec 2018 13:58:41 -0800
-Subject: [PATCH 12/14] Set CARGO_HOME to the local .config
+Subject: [PATCH 12/18] Set CARGO_HOME to the local .config
---
data/macros.cargo | 6 +++++-
@@ -22,5 +22,5 @@ index 7fb025b..e760721 100644
%__cargo_inspector %{_bindir}/cargo-inspector
--
-2.20.1
+2.21.0
diff --git a/0013-Set-the-install-root-in-.cargo-config.patch
b/0013-Set-the-install-root-in-.cargo-config.patch
index baa5e3a..e2ef86e 100644
--- a/0013-Set-the-install-root-in-.cargo-config.patch
+++ b/0013-Set-the-install-root-in-.cargo-config.patch
@@ -1,7 +1,7 @@
From a04e95bc4f807139bd3c4b75f46fd9a60ec1db8f Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone(a)redhat.com>
Date: Fri, 7 Dec 2018 13:59:03 -0800
-Subject: [PATCH 13/14] Set the install root in .cargo/config
+Subject: [PATCH 13/18] Set the install root in .cargo/config
---
data/macros.cargo | 4 +++-
@@ -30,5 +30,5 @@ index e760721..9a9ce6a 100644
%* \
}\
--
-2.20.1
+2.21.0
diff --git a/0014-Add-support-for-prerelease-versions.patch
b/0014-Add-support-for-prerelease-versions.patch
deleted file mode 100644
index e7ec8ef..0000000
--- a/0014-Add-support-for-prerelease-versions.patch
+++ /dev/null
@@ -1,160 +0,0 @@
-From cfe4e77674ccb6e25e54a3749f4ef91b377e808f Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
-Date: Sat, 26 Jan 2019 08:33:37 +0100
-Subject: [PATCH 14/14] Add support for prerelease versions
-
-Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
----
- data/macros.rust-srpm | 38 ++++++++++++++++++++++++++++++++++++
- rust2rpm/metadata.py | 18 +++++++++++------
- rust2rpm/templates/main.spec | 10 +++-------
- test.py | 8 ++++++++
- 4 files changed, 61 insertions(+), 13 deletions(-)
-
-diff --git a/data/macros.rust-srpm b/data/macros.rust-srpm
-index f2bae9d..872b87f 100644
---- a/data/macros.rust-srpm
-+++ b/data/macros.rust-srpm
-@@ -1 +1,39 @@
- %rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x
-+%version_no_tilde() %{lua:
-+ local sep = rpm.expand('%1')
-+ local ver = rpm.expand('%2')
-+\
-+ if sep == '%1' then
-+ sep = '-'
-+ end
-+\
-+ if ver == '%2' then
-+ ver = rpm.expand('%version')
-+ end
-+ ver = ver:gsub('~', sep)
-+\
-+ print(ver)
-+}
-+%__crates_url
https://crates.io/api/v1/crates/
-+%crates_source() %{lua:
-+ local crate = rpm.expand('%1')
-+ local version = rpm.expand('%2')
-+ local url = rpm.expand('%__crates_url')
-+\
-+ if crate == '%1' then
-+ crate = rpm.expand('%real_crate')
-+ end
-+ if crate == '%real_crate' then
-+ crate = rpm.expand('%crate')
-+ end
-+ if crate == '%crate' then
-+ crate = rpm.expand('%name')
-+ end
-+\
-+ if version == '%2' then
-+ version = rpm.expand('%version')
-+ end
-+ version = version:gsub('~', '-')
-+\
-+ print(url .. crate .. '/' .. version .. '/download#/' .. crate ..
'-' .. version .. '.crate')
-+}
-diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
-index 328b67a..f0718d5 100644
---- a/rust2rpm/metadata.py
-+++ b/rust2rpm/metadata.py
-@@ -45,11 +45,13 @@ class Dependency:
- # Any means any
- continue
- ver = req.spec
-- if ver.prerelease:
-- raise NotImplementedError(f"Pre-release requirement is not
supported: {ver}")
- if req.kind in (req.KIND_NEQ, req.KIND_EMPTY):
- raise NotImplementedError(f"'!=' and empty kinds are not
supported: {req}")
-- coerced = semver.Version.coerce(str(ver))
-+ coerced = str(semver.Version.coerce(str(ver)))
-+ if ver.prerelease:
-+ coerced = coerced.replace("-", "~")
-+ # This will advance us to closest stable version (2.0.0-beta.6 2.0.0)
-+ ver = ver.next_patch()
- if req.kind == req.KIND_EQUAL:
- req.kind = req.KIND_SHORTEQ
- if req.kind in (req.KIND_CARET, req.KIND_COMPATIBLE):
-@@ -107,7 +109,11 @@ class Dependency:
- class Metadata:
- def __init__(self, name, version):
- self.name = name
-- self.version = version
-+ self._version = version
-+ version_normalized = Dependency._normalize_req(f"={self._version}")
-+ if len(version_normalized) != 1:
-+ raise Exception(f"Incorrect version: {self._version}")
-+ self.version = version_normalized[0][1]
- self.license = None
- self.license_file = None
- self.readme = None
-@@ -187,7 +193,7 @@ class Metadata:
- def provides(self, feature=None):
- if feature not in self.dependencies:
- raise KeyError(f"Feature {feature!r} doesn't exist")
-- return Dependency(self.name, f"={self.version}", features={feature})
-+ return Dependency(self.name, f"={self._version}", features={feature})
-
- @classmethod
- def _resolve(cls, deps_by_feature, feature):
-@@ -207,7 +213,7 @@ class Metadata:
- return self._resolve(self.dependencies, feature)[1]
- else:
- features, deps = self.dependencies[feature]
-- fdeps = set(Dependency(self.name, f"={self.version}",
features={feature})
-+ fdeps = set(Dependency(self.name, f"={self._version}",
features={feature})
- for feature in features)
- return fdeps | deps
-
-diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
-index 84bd97d..1ebef7b 100644
---- a/rust2rpm/templates/main.spec
-+++ b/rust2rpm/templates/main.spec
-@@ -31,11 +31,7 @@ License: {{ license|default("# FIXME") }}
- {{ license_comments }}
- {% endif %}
- URL:
https://crates.io/crates/{{ crate }}
--{% if md.name != crate %}
--Source0:
https://crates.io/api/v1/crates/%{real_crate}/%{version}/download#/%{crat...
--{% else %}
--Source0:
https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{...
--{% endif %}
-+Source: %{crates_source}
- {% if patch_file is not none %}
- {% if target == "opensuse" %}
- # PATCH-FIX-OPENSUSE {{ patch_file }} -- Initial patched metadata
-@@ -161,9 +157,9 @@ which use {% if feature is not none %}"{{ feature }}"
feature of {% endif %}"%{c
-
- %prep
- {% if md.name != crate %}
--%autosetup -n %{real_crate}-%{version} -p1
-+%autosetup -n %{real_crate}-%{version_no_tilde} -p1
- {% else %}
--%autosetup -n %{crate}-%{version} -p1
-+%autosetup -n %{crate}-%{version_no_tilde} -p1
- {% endif %}
- %cargo_prep
-
-diff --git a/test.py b/test.py
-index 30263b4..035df79 100644
---- a/test.py
-+++ b/test.py
-@@ -37,6 +37,14 @@ import rust2rpm
- "crate(test) = 1.2.3"),
- (">= 1.2, < 1.5",
- "(crate(test) >= 1.2.0 with crate(test) < 1.5.0)"),
-+ ("^2.0.0-alpha.6",
-+ "(crate(test) >= 2.0.0~alpha.6 with crate(test) < 3.0.0)"),
-+ ("^0.1.0-alpha.6",
-+ "(crate(test) >= 0.1.0~alpha.6 with crate(test) < 0.2.0)"),
-+ ("^0.0.1-alpha.6",
-+ "(crate(test) >= 0.0.1~alpha.6 with crate(test) < 0.0.2)"),
-+ ("^0.0.0-alpha.6",
-+ "(crate(test) >= 0.0.0~alpha.6 with crate(test) < 0.0.1)"),
- ])
- def test_dependency(req, rpmdep):
- dep = rust2rpm.Dependency("test", req)
---
-2.20.1
-
diff --git a/0014-licensing-fix-zlib-license-translation.patch
b/0014-licensing-fix-zlib-license-translation.patch
new file mode 100644
index 0000000..fc8a165
--- /dev/null
+++ b/0014-licensing-fix-zlib-license-translation.patch
@@ -0,0 +1,35 @@
+From 7c00b0f29085166b1a89aec766945b10dc7aca23 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
+Date: Sat, 1 Dec 2018 15:40:08 +0100
+Subject: [PATCH 14/18] licensing: fix zlib license translation
+
+The file was mangled, and something about "teeworlds" was inserted
+into the line for zlib. The spdx database doesn't list "teeworlds
+license", so let's just remove that part.
+Both [1] and [2] agree that "zlib" and "zlib license" are the same
thing.
+
+[1]
https://spdx.org/licenses/Zlib
+[2]
https://fedoraproject.org/wiki/Licensing:Main#Good_Licenses
+
+Fixes #61.
+---
+ rust2rpm/spdx_to_fedora.csv | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/rust2rpm/spdx_to_fedora.csv b/rust2rpm/spdx_to_fedora.csv
+index 829571a..1ca5a7e 100644
+--- a/rust2rpm/spdx_to_fedora.csv
++++ b/rust2rpm/spdx_to_fedora.csv
+@@ -306,8 +306,7 @@ Zed License,Zed,Zed,,,
+ Zend License v2.0,Zend-2.0,Zend,,,
+ Zimbra Public License v1.3,Zimbra-1.3,,,Fedora bad list,
+ Zimbra Public License v1.4,Zimbra-1.4,,,not on Fedora list,
+-zlib License,Zlib,"zlib
+-Teeworlds",,,Teeworlds License
++zlib License,Zlib,zlib,,,
+ zlib/libpng License with Acknowledgement,zlib-acknowledgement,zlib with
acknowledgement,,,
+ Zope Public License 1.1,ZPL-1.1,,,This specific version not on Fedora list,
+ Zope Public License 2.0,ZPL-2.0,ZPLv2.0,,,
+--
+2.21.0
+
diff --git a/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch
b/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch
new file mode 100644
index 0000000..76be3f8
--- /dev/null
+++ b/0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch
@@ -0,0 +1,31 @@
+From b0d2756917b380a5d66d2407dbeb8891c51875e8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
+Date: Sat, 1 Dec 2018 15:46:08 +0100
+Subject: [PATCH 15/18] licensing: rename EPL to EPL-1.0 and add EPL-2.0
+
+According to
https://fedoraproject.org/wiki/Licensing:Main#Software_License_List
+EPL-1.0 and EPL-2.0 are the short tags that should be used now.
+(C.f.
https://spdx.org/licenses/EPL-2.0.html.)
+
+Fixes #64.
+---
+ rust2rpm/spdx_to_fedora.csv | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/rust2rpm/spdx_to_fedora.csv b/rust2rpm/spdx_to_fedora.csv
+index 1ca5a7e..c42e66e 100644
+--- a/rust2rpm/spdx_to_fedora.csv
++++ b/rust2rpm/spdx_to_fedora.csv
+@@ -112,7 +112,8 @@ DOC License,DOC,DOC,,,
+ Dotseqn License,Dotseqn,Dotseqn,,,
+ DSDP License,DSDP,DSDP,,,
+ dvipdfm License,dvipdfm,dvipdfm,,,
+-Eclipse Public License 1.0,EPL-1.0,EPL,,,
++Eclipse Public License 1.0,EPL-1.0,EPL-1.0,,,
++Eclipse Public License 2.0,EPL-2.0,EPL-2.0,,,
+ Educational Community License v1.0,ECL-1.0,ECL 1.0,,,
+ Educational Community License v2.0,ECL-2.0,ECL 2.0,,,
+
eGenix.com Public License 1.1.0,eGenix,eGenix,,,
+--
+2.21.0
+
diff --git a/0016-Add-support-for-prerelease-versions.patch
b/0016-Add-support-for-prerelease-versions.patch
new file mode 100644
index 0000000..187a47d
--- /dev/null
+++ b/0016-Add-support-for-prerelease-versions.patch
@@ -0,0 +1,160 @@
+From 00c0c5cec90d5d6abbfd4acb2f5d65439b4bfd27 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Sat, 26 Jan 2019 08:33:37 +0100
+Subject: [PATCH 16/18] Add support for prerelease versions
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ data/macros.rust-srpm | 38 ++++++++++++++++++++++++++++++++++++
+ rust2rpm/metadata.py | 18 +++++++++++------
+ rust2rpm/templates/main.spec | 10 +++-------
+ test.py | 8 ++++++++
+ 4 files changed, 61 insertions(+), 13 deletions(-)
+
+diff --git a/data/macros.rust-srpm b/data/macros.rust-srpm
+index f2bae9d..872b87f 100644
+--- a/data/macros.rust-srpm
++++ b/data/macros.rust-srpm
+@@ -1 +1,39 @@
+ %rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x
++%version_no_tilde() %{lua:
++ local sep = rpm.expand('%1')
++ local ver = rpm.expand('%2')
++\
++ if sep == '%1' then
++ sep = '-'
++ end
++\
++ if ver == '%2' then
++ ver = rpm.expand('%version')
++ end
++ ver = ver:gsub('~', sep)
++\
++ print(ver)
++}
++%__crates_url
https://crates.io/api/v1/crates/
++%crates_source() %{lua:
++ local crate = rpm.expand('%1')
++ local version = rpm.expand('%2')
++ local url = rpm.expand('%__crates_url')
++\
++ if crate == '%1' then
++ crate = rpm.expand('%real_crate')
++ end
++ if crate == '%real_crate' then
++ crate = rpm.expand('%crate')
++ end
++ if crate == '%crate' then
++ crate = rpm.expand('%name')
++ end
++\
++ if version == '%2' then
++ version = rpm.expand('%version')
++ end
++ version = version:gsub('~', '-')
++\
++ print(url .. crate .. '/' .. version .. '/download#/' .. crate ..
'-' .. version .. '.crate')
++}
+diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
+index 328b67a..f0718d5 100644
+--- a/rust2rpm/metadata.py
++++ b/rust2rpm/metadata.py
+@@ -45,11 +45,13 @@ class Dependency:
+ # Any means any
+ continue
+ ver = req.spec
+- if ver.prerelease:
+- raise NotImplementedError(f"Pre-release requirement is not
supported: {ver}")
+ if req.kind in (req.KIND_NEQ, req.KIND_EMPTY):
+ raise NotImplementedError(f"'!=' and empty kinds are not
supported: {req}")
+- coerced = semver.Version.coerce(str(ver))
++ coerced = str(semver.Version.coerce(str(ver)))
++ if ver.prerelease:
++ coerced = coerced.replace("-", "~")
++ # This will advance us to closest stable version (2.0.0-beta.6 2.0.0)
++ ver = ver.next_patch()
+ if req.kind == req.KIND_EQUAL:
+ req.kind = req.KIND_SHORTEQ
+ if req.kind in (req.KIND_CARET, req.KIND_COMPATIBLE):
+@@ -107,7 +109,11 @@ class Dependency:
+ class Metadata:
+ def __init__(self, name, version):
+ self.name = name
+- self.version = version
++ self._version = version
++ version_normalized = Dependency._normalize_req(f"={self._version}")
++ if len(version_normalized) != 1:
++ raise Exception(f"Incorrect version: {self._version}")
++ self.version = version_normalized[0][1]
+ self.license = None
+ self.license_file = None
+ self.readme = None
+@@ -187,7 +193,7 @@ class Metadata:
+ def provides(self, feature=None):
+ if feature not in self.dependencies:
+ raise KeyError(f"Feature {feature!r} doesn't exist")
+- return Dependency(self.name, f"={self.version}", features={feature})
++ return Dependency(self.name, f"={self._version}", features={feature})
+
+ @classmethod
+ def _resolve(cls, deps_by_feature, feature):
+@@ -207,7 +213,7 @@ class Metadata:
+ return self._resolve(self.dependencies, feature)[1]
+ else:
+ features, deps = self.dependencies[feature]
+- fdeps = set(Dependency(self.name, f"={self.version}",
features={feature})
++ fdeps = set(Dependency(self.name, f"={self._version}",
features={feature})
+ for feature in features)
+ return fdeps | deps
+
+diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
+index 84bd97d..1ebef7b 100644
+--- a/rust2rpm/templates/main.spec
++++ b/rust2rpm/templates/main.spec
+@@ -31,11 +31,7 @@ License: {{ license|default("# FIXME") }}
+ {{ license_comments }}
+ {% endif %}
+ URL:
https://crates.io/crates/{{ crate }}
+-{% if md.name != crate %}
+-Source0:
https://crates.io/api/v1/crates/%{real_crate}/%{version}/download#/%{crat...
+-{% else %}
+-Source0:
https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{...
+-{% endif %}
++Source: %{crates_source}
+ {% if patch_file is not none %}
+ {% if target == "opensuse" %}
+ # PATCH-FIX-OPENSUSE {{ patch_file }} -- Initial patched metadata
+@@ -161,9 +157,9 @@ which use {% if feature is not none %}"{{ feature }}"
feature of {% endif %}"%{c
+
+ %prep
+ {% if md.name != crate %}
+-%autosetup -n %{real_crate}-%{version} -p1
++%autosetup -n %{real_crate}-%{version_no_tilde} -p1
+ {% else %}
+-%autosetup -n %{crate}-%{version} -p1
++%autosetup -n %{crate}-%{version_no_tilde} -p1
+ {% endif %}
+ %cargo_prep
+
+diff --git a/test.py b/test.py
+index 30263b4..035df79 100644
+--- a/test.py
++++ b/test.py
+@@ -37,6 +37,14 @@ import rust2rpm
+ "crate(test) = 1.2.3"),
+ (">= 1.2, < 1.5",
+ "(crate(test) >= 1.2.0 with crate(test) < 1.5.0)"),
++ ("^2.0.0-alpha.6",
++ "(crate(test) >= 2.0.0~alpha.6 with crate(test) < 3.0.0)"),
++ ("^0.1.0-alpha.6",
++ "(crate(test) >= 0.1.0~alpha.6 with crate(test) < 0.2.0)"),
++ ("^0.0.1-alpha.6",
++ "(crate(test) >= 0.0.1~alpha.6 with crate(test) < 0.0.2)"),
++ ("^0.0.0-alpha.6",
++ "(crate(test) >= 0.0.0~alpha.6 with crate(test) < 0.0.1)"),
+ ])
+ def test_dependency(req, rpmdep):
+ dep = rust2rpm.Dependency("test", req)
+--
+2.21.0
+
diff --git a/0017-data-Cargo-doesn-t-escape-paths-with-space.patch
b/0017-data-Cargo-doesn-t-escape-paths-with-space.patch
new file mode 100644
index 0000000..90dadeb
--- /dev/null
+++ b/0017-data-Cargo-doesn-t-escape-paths-with-space.patch
@@ -0,0 +1,31 @@
+From 84a73bfa24ce11602a1f19554dc495125be4d0aa Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Sun, 17 Feb 2019 17:19:25 +0100
+Subject: [PATCH 17/18] data: Cargo doesn't escape paths with space
+
+When building matrixmultiply v0.2.2:
+
+BUILDSTDERR: /usr/bin/cp: cannot stat 'spare': No such file or directory
+BUILDSTDERR: /usr/bin/cp: failed to get attributes of 'kernels': No such file or
directory
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ data/macros.cargo | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/data/macros.cargo b/data/macros.cargo
+index 9a9ce6a..9a375d0 100644
+--- a/data/macros.cargo
++++ b/data/macros.cargo
+@@ -74,7 +74,7 @@ if %__cargo_is_lib; then \
+ 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 \
++ %{__cargo} package -l | xargs -d '\n' %{__cp} --parents -a -t $REG_DIR \
+ %if ! %{with check} \
+ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
+ %endif \
+--
+2.21.0
+
diff --git a/0018-Do-not-pull-optional-dependencies.patch
b/0018-Do-not-pull-optional-dependencies.patch
new file mode 100644
index 0000000..68f2a8c
--- /dev/null
+++ b/0018-Do-not-pull-optional-dependencies.patch
@@ -0,0 +1,66 @@
+From b0f34c2b6a7b8ca5b924e5c230f1271826114cb0 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Sat, 9 Mar 2019 22:04:49 +0100
+Subject: [PATCH 18/18] Do not pull optional dependencies
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ data/macros.cargo | 13 +++++++++++--
+ rust2rpm/templates/main.spec | 5 -----
+ 2 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/data/macros.cargo b/data/macros.cargo
+index 9a375d0..0e382c8 100644
+--- a/data/macros.cargo
++++ b/data/macros.cargo
+@@ -2,8 +2,10 @@
+ #
https://github.com/rust-lang/cargo/issues/6397
+ # But we can set CARGO_HOME locally, which is a good idea anyway to make sure
+ # it never writes to ~/.cargo during rpmbuild.
+-%__cargo %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo
+-%__cargo_common_opts %{?_smp_mflags}
++# We also need RUSTC_BOOTSTRAP since we use -Z avoid-dev-deps
++# until it gets stabilized:
https://github.com/rust-lang/cargo/issues/5133
++%__cargo %{_bindir}/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 %{_bindir}/cargo
++%__cargo_common_opts %{?_smp_mflags} -Z avoid-dev-deps
+ %__cargo_inspector %{_bindir}/cargo-inspector
+
+ %cargo_registry %{_datadir}/cargo/registry
+@@ -74,10 +76,17 @@ if %__cargo_is_lib; then
\
+ CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \
+ REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \
+ %{__mkdir} -p $REG_DIR \
++# Drop all dependency/features information \
++# so that cargo doesn't fail resolving dependencies: \
++#
https://github.com/rust-lang/cargo/pull/6729 \
++ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps
'/^\\\[((dev-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \
+ %{__cargo} package -l | xargs -d '\n' %{__cp} --parents -a -t $REG_DIR \
+ %if ! %{with check} \
+ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
++%else \
++ %{__cp} -a Cargo.toml.deps $REG_DIR/Cargo.toml \
+ %endif \
++ %{__rm} $REG_DIR/Cargo.toml.{orig,deps} \
+ echo '{"files":{},"package":""}' >
$REG_DIR/.cargo-checksum.json \
+ fi \
+ if %__cargo_is_bin; then \
+diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
+index 1ebef7b..f0c5445 100644
+--- a/rust2rpm/templates/main.spec
++++ b/rust2rpm/templates/main.spec
+@@ -44,12 +44,7 @@ Patch0: {{ patch_file }}
+ ExclusiveArch: %{rust_arches}
+
+ BuildRequires: rust-packaging
+-{# We will put all non-optional and optional dependencies until
+-
https://github.com/rust-lang/cargo/issues/5133
+- is solved
+ {% set buildrequires = normalize_deps(md.requires("default",
resolve=True))|sort %}
+-#}
+-{% set buildrequires = normalize_deps(md.all_dependencies)|sort %}
+ {% for req in buildrequires %}
+ BuildRequires: {{ req }}
+ {% endfor %}
+--
+2.21.0
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 374a238..3f2294c 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -5,7 +5,7 @@
Name: rust-packaging
Version: 6
-Release: 22%{?dist}
+Release: 23%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -24,7 +24,12 @@ Patch0010: 0010-trivial-use-f-strings-everywhere.patch
Patch0011: 0011-Add-option-to-not-generate-a-default-changelog-entry.patch
Patch0012: 0012-Set-CARGO_HOME-to-the-local-.config.patch
Patch0013: 0013-Set-the-install-root-in-.cargo-config.patch
-Patch0014: 0014-Add-support-for-prerelease-versions.patch
+Patch0014: 0014-licensing-fix-zlib-license-translation.patch
+Patch0015: 0015-licensing-rename-EPL-to-EPL-1.0-and-add-EPL-2.0.patch
+Patch0016: 0016-Add-support-for-prerelease-versions.patch
+Patch0017: 0017-data-Cargo-doesn-t-escape-paths-with-space.patch
+#
https://pagure.io/fedora-rust/rust2rpm/pull-request/68<Paste>
+Patch0018: 0018-Do-not-pull-optional-dependencies.patch
ExclusiveArch: %{rust_arches}
@@ -85,6 +90,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sun Mar 10 2019 Igor Gnatenko <ignatnekobrain(a)fedoraproject.org> - 6-23
+- Do not pull optional deps into BRs and trivial fixes
+
* Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 6-22
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
commit 17a86d1495e6c6374add1f4f72dee83b14930d2e
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Sat Feb 2 14:06:10 2019 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 29dc5ec..374a238 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -5,7 +5,7 @@
Name: rust-packaging
Version: 6
-Release: 21%{?dist}
+Release: 22%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -85,6 +85,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 6-22
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+
* Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-21
- Use %%version_no_tilde
commit 6d95cfa0b0f183cb32e9a8818e582b16780a2296
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat Jan 26 12:07:13 2019 +0100
Use %version_no_tilde
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0014-Add-support-for-prerelease-versions.patch
b/0014-Add-support-for-prerelease-versions.patch
index d4c48ef..e7ec8ef 100644
--- a/0014-Add-support-for-prerelease-versions.patch
+++ b/0014-Add-support-for-prerelease-versions.patch
@@ -1,24 +1,39 @@
-From 769506caf08edb5ea2342d9add22e4db1b347375 Mon Sep 17 00:00:00 2001
+From cfe4e77674ccb6e25e54a3749f4ef91b377e808f Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat, 26 Jan 2019 08:33:37 +0100
Subject: [PATCH 14/14] Add support for prerelease versions
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
- data/macros.rust-srpm | 23 +++++++++++++++++++++++
- rust2rpm/metadata.py | 18 ++++++++++++------
- rust2rpm/templates/main.spec | 6 +-----
+ data/macros.rust-srpm | 38 ++++++++++++++++++++++++++++++++++++
+ rust2rpm/metadata.py | 18 +++++++++++------
+ rust2rpm/templates/main.spec | 10 +++-------
test.py | 8 ++++++++
- 4 files changed, 44 insertions(+), 11 deletions(-)
+ 4 files changed, 61 insertions(+), 13 deletions(-)
diff --git a/data/macros.rust-srpm b/data/macros.rust-srpm
-index f2bae9d..bd21cb5 100644
+index f2bae9d..872b87f 100644
--- a/data/macros.rust-srpm
+++ b/data/macros.rust-srpm
-@@ -1 +1,24 @@
+@@ -1 +1,39 @@
%rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x
++%version_no_tilde() %{lua:
++ local sep = rpm.expand('%1')
++ local ver = rpm.expand('%2')
++\
++ if sep == '%1' then
++ sep = '-'
++ end
++\
++ if ver == '%2' then
++ ver = rpm.expand('%version')
++ end
++ ver = ver:gsub('~', sep)
++\
++ print(ver)
++}
+%__crates_url
https://crates.io/api/v1/crates/
-+%crates_source %{lua:
++%crates_source() %{lua:
+ local crate = rpm.expand('%1')
+ local version = rpm.expand('%2')
+ local url = rpm.expand('%__crates_url')
@@ -93,7 +108,7 @@ index 328b67a..f0718d5 100644
return fdeps | deps
diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
-index 84bd97d..f67e023 100644
+index 84bd97d..1ebef7b 100644
--- a/rust2rpm/templates/main.spec
+++ b/rust2rpm/templates/main.spec
@@ -31,11 +31,7 @@ License: {{ license|default("# FIXME") }}
@@ -109,6 +124,18 @@ index 84bd97d..f67e023 100644
{% if patch_file is not none %}
{% if target == "opensuse" %}
# PATCH-FIX-OPENSUSE {{ patch_file }} -- Initial patched metadata
+@@ -161,9 +157,9 @@ which use {% if feature is not none %}"{{ feature }}"
feature of {% endif %}"%{c
+
+ %prep
+ {% if md.name != crate %}
+-%autosetup -n %{real_crate}-%{version} -p1
++%autosetup -n %{real_crate}-%{version_no_tilde} -p1
+ {% else %}
+-%autosetup -n %{crate}-%{version} -p1
++%autosetup -n %{crate}-%{version_no_tilde} -p1
+ {% endif %}
+ %cargo_prep
+
diff --git a/test.py b/test.py
index 30263b4..035df79 100644
--- a/test.py
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 2162d19..29dc5ec 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -5,7 +5,7 @@
Name: rust-packaging
Version: 6
-Release: 20%{?dist}
+Release: 21%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -85,6 +85,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-21
+- Use %%version_no_tilde
+
* Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-20
- Trivial fixes for pre-release versions
commit 2c9257ea1223fa871a2bdbd80a29eefde7b5fe5b
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat Jan 26 10:36:39 2019 +0100
Trivial fixes for pre-release versions
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0014-Add-support-for-prerelease-versions.patch
b/0014-Add-support-for-prerelease-versions.patch
index cf16439..d4c48ef 100644
--- a/0014-Add-support-for-prerelease-versions.patch
+++ b/0014-Add-support-for-prerelease-versions.patch
@@ -1,14 +1,45 @@
-From 29a3c1b84e0971fc0c2edf483ae3b04139c19b32 Mon Sep 17 00:00:00 2001
+From 769506caf08edb5ea2342d9add22e4db1b347375 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat, 26 Jan 2019 08:33:37 +0100
Subject: [PATCH 14/14] Add support for prerelease versions
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
- rust2rpm/metadata.py | 18 ++++++++++++------
- test.py | 8 ++++++++
- 2 files changed, 20 insertions(+), 6 deletions(-)
+ data/macros.rust-srpm | 23 +++++++++++++++++++++++
+ rust2rpm/metadata.py | 18 ++++++++++++------
+ rust2rpm/templates/main.spec | 6 +-----
+ test.py | 8 ++++++++
+ 4 files changed, 44 insertions(+), 11 deletions(-)
+diff --git a/data/macros.rust-srpm b/data/macros.rust-srpm
+index f2bae9d..bd21cb5 100644
+--- a/data/macros.rust-srpm
++++ b/data/macros.rust-srpm
+@@ -1 +1,24 @@
+ %rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x
++%__crates_url
https://crates.io/api/v1/crates/
++%crates_source %{lua:
++ local crate = rpm.expand('%1')
++ local version = rpm.expand('%2')
++ local url = rpm.expand('%__crates_url')
++\
++ if crate == '%1' then
++ crate = rpm.expand('%real_crate')
++ end
++ if crate == '%real_crate' then
++ crate = rpm.expand('%crate')
++ end
++ if crate == '%crate' then
++ crate = rpm.expand('%name')
++ end
++\
++ if version == '%2' then
++ version = rpm.expand('%version')
++ end
++ version = version:gsub('~', '-')
++\
++ print(url .. crate .. '/' .. version .. '/download#/' .. crate ..
'-' .. version .. '.crate')
++}
diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
index 328b67a..f0718d5 100644
--- a/rust2rpm/metadata.py
@@ -61,6 +92,23 @@ index 328b67a..f0718d5 100644
for feature in features)
return fdeps | deps
+diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
+index 84bd97d..f67e023 100644
+--- a/rust2rpm/templates/main.spec
++++ b/rust2rpm/templates/main.spec
+@@ -31,11 +31,7 @@ License: {{ license|default("# FIXME") }}
+ {{ license_comments }}
+ {% endif %}
+ URL:
https://crates.io/crates/{{ crate }}
+-{% if md.name != crate %}
+-Source0:
https://crates.io/api/v1/crates/%{real_crate}/%{version}/download#/%{crat...
+-{% else %}
+-Source0:
https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{...
+-{% endif %}
++Source: %{crates_source}
+ {% if patch_file is not none %}
+ {% if target == "opensuse" %}
+ # PATCH-FIX-OPENSUSE {{ patch_file }} -- Initial patched metadata
diff --git a/test.py b/test.py
index 30263b4..035df79 100644
--- a/test.py
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 0d97e56..2162d19 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -5,7 +5,7 @@
Name: rust-packaging
Version: 6
-Release: 19%{?dist}
+Release: 20%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -85,6 +85,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-20
+- Trivial fixes for pre-release versions
+
* Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-19
- Add support for pre-release versions
commit b078c549828898a71063bac9e3104b5a915b92ec
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat Jan 26 09:31:56 2019 +0100
Add support for pre-release versions
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch
b/0001-name-spec-patch_file-by-real-crate-name.patch
index 1f65e7f..4d55717 100644
--- a/0001-name-spec-patch_file-by-real-crate-name.patch
+++ b/0001-name-spec-patch_file-by-real-crate-name.patch
@@ -1,7 +1,7 @@
From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:37:40 +0200
-Subject: [PATCH 01/13] name spec/patch_file by real crate name
+Subject: [PATCH 01/14] name spec/patch_file by real crate name
When renaming using patch file, we really want to change file names too.
@@ -33,5 +33,5 @@ index dc78828..1575ce6 100644
if args.stdout:
print("# {}".format(spec_file))
--
-2.20.0.rc2
+2.20.1
diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch
index 581990d..42ca40d 100644
--- a/0002-generate-doc-statements.patch
+++ b/0002-generate-doc-statements.patch
@@ -1,7 +1,7 @@
From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:40:18 +0200
-Subject: [PATCH 02/13] generate %doc statements
+Subject: [PATCH 02/14] generate %doc statements
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -54,5 +54,5 @@ index 1aeb969..2e9f841 100644
{% endif %}
--
-2.20.0.rc2
+2.20.1
diff --git a/0003-do-better-for-renamed-crates.patch
b/0003-do-better-for-renamed-crates.patch
index 1640604..3f1bc98 100644
--- a/0003-do-better-for-renamed-crates.patch
+++ b/0003-do-better-for-renamed-crates.patch
@@ -1,7 +1,7 @@
From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 00:06:50 +0200
-Subject: [PATCH 03/13] do better for renamed crates
+Subject: [PATCH 03/14] do better for renamed crates
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -86,5 +86,5 @@ index 2e9f841..7dbcc3f 100644
%build
--
-2.20.0.rc2
+2.20.1
diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch
index 0ba106c..7133f4e 100644
--- a/0004-remove-pre-3.6-leftovers.patch
+++ b/0004-remove-pre-3.6-leftovers.patch
@@ -1,7 +1,7 @@
From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 10:43:53 +0200
-Subject: [PATCH 04/13] remove pre-3.6 leftovers
+Subject: [PATCH 04/14] remove pre-3.6 leftovers
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -23,5 +23,5 @@ index f52d968..5adeb65 100644
+
"--manifest-path={}".format(path)])
return cls.from_json(json.loads(metadata))
--
-2.20.0.rc2
+2.20.1
diff --git a/0005-Remove-half-downloaded-crate-on-C.patch
b/0005-Remove-half-downloaded-crate-on-C.patch
index 6f67bb9..8ae52e4 100644
--- a/0005-Remove-half-downloaded-crate-on-C.patch
+++ b/0005-Remove-half-downloaded-crate-on-C.patch
@@ -1,7 +1,7 @@
From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:03:48 +0200
-Subject: [PATCH 05/13] Remove half-downloaded crate on ^C
+Subject: [PATCH 05/14] Remove half-downloaded crate on ^C
Subsequent invocations would fail with an error about a corrupted file.
We don't have support for resuming a failed download, so let's remove the
@@ -40,5 +40,5 @@ index e993e7b..8e6f6eb 100644
total=total, unit="B", unit_scale=True):
f.write(chunk)
--
-2.20.0.rc2
+2.20.1
diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
index cc09ce2..8684175 100644
--- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
+++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
@@ -1,7 +1,7 @@
From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:18:59 +0200
-Subject: [PATCH 06/13] Throw an error if -s is used without a crate
+Subject: [PATCH 06/14] Throw an error if -s is used without a crate
In the future we might want to be smarter and find the crate, but let's at least
not ignore the option completely.
@@ -24,5 +24,5 @@ index 8e6f6eb..f23ebbc 100644
diff = make_patch(toml, enabled=patch, tmpfile=True)
metadata = Metadata.from_file(toml)
--
-2.20.0.rc2
+2.20.1
diff --git a/0007-split-features-into-subpackages.patch
b/0007-split-features-into-subpackages.patch
index 52d253e..19fd5e5 100644
--- a/0007-split-features-into-subpackages.patch
+++ b/0007-split-features-into-subpackages.patch
@@ -1,7 +1,7 @@
From 2cac5e5ad5ff5472923ce333bef59679612bbaa2 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri, 26 Oct 2018 11:20:13 +0200
-Subject: [PATCH 07/13] split features into subpackages
+Subject: [PATCH 07/14] split features into subpackages
References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-fe...
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
@@ -1060,5 +1060,5 @@ index b856fdd..30263b4 100644
- assert [str(x) for x in md.provides] == provides
- assert [str(x) for x in md.requires] == requires
--
-2.20.0.rc2
+2.20.1
diff --git a/0008-add-support-for-dependencies-with-same-name.patch
b/0008-add-support-for-dependencies-with-same-name.patch
index 378edfc..f6f2743 100644
--- a/0008-add-support-for-dependencies-with-same-name.patch
+++ b/0008-add-support-for-dependencies-with-same-name.patch
@@ -1,7 +1,7 @@
From a1d3a84645aa7bbe5ca07b60bead1ddf90a21cc1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 30 Oct 2018 20:37:38 +0100
-Subject: [PATCH 08/13] add support for dependencies with same name
+Subject: [PATCH 08/14] add support for dependencies with same name
Reported-by: Josh Stone <jistone(a)redhat.com>
References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
@@ -70,5 +70,5 @@ index 4929cdd..328b67a 100644
if "default" not in deps_by_feature:
--
-2.20.0.rc2
+2.20.1
diff --git a/0009-add-support-for-feeding-user-configuration.patch
b/0009-add-support-for-feeding-user-configuration.patch
index b130ebe..5078943 100644
--- a/0009-add-support-for-feeding-user-configuration.patch
+++ b/0009-add-support-for-feeding-user-configuration.patch
@@ -1,7 +1,7 @@
From 197150ee2e862edcd46f7ab02c9e4d17e49ca75d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 18:03:21 +0100
-Subject: [PATCH 09/13] add support for feeding user configuration
+Subject: [PATCH 09/14] add support for feeding user configuration
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -144,5 +144,5 @@ index 0d9a80b..d901e6d 100644
%description {{ pkg }} %{_description}
--
-2.20.0.rc2
+2.20.1
diff --git a/0010-trivial-use-f-strings-everywhere.patch
b/0010-trivial-use-f-strings-everywhere.patch
index f6ff2f4..72c5828 100644
--- a/0010-trivial-use-f-strings-everywhere.patch
+++ b/0010-trivial-use-f-strings-everywhere.patch
@@ -1,7 +1,7 @@
From 83ea3796cd28ec7689b39e7dc7a70bd11af1abf1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 17:00:58 +0100
-Subject: [PATCH 10/13] trivial: use f-strings everywhere
+Subject: [PATCH 10/14] trivial: use f-strings everywhere
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -90,5 +90,5 @@ index c691274..b60e6c4 100644
else:
with open(spec_file, "w") as fobj:
--
-2.20.0.rc2
+2.20.1
diff --git a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
index ccad736..4345add 100644
--- a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
+++ b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
@@ -1,7 +1,7 @@
From 294c6f571c0f4f7ed5a4fcb34142b0d332c55f29 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13(a)gmail.com>
Date: Sun, 11 Nov 2018 11:06:27 -0500
-Subject: [PATCH 11/13] Add option to not generate a default changelog entry
+Subject: [PATCH 11/14] Add option to not generate a default changelog entry
For Rust packages created through the OBS source service, the
changelog is managed by an external <pkg>.changes file that is
@@ -59,5 +59,5 @@ index d901e6d..84bd97d 100644
+ {% include target ~ "-changelog.spec.inc" %}
+{% endif %}
--
-2.20.0.rc2
+2.20.1
diff --git a/0012-Set-CARGO_HOME-to-the-local-.config.patch
b/0012-Set-CARGO_HOME-to-the-local-.config.patch
index 9f81757..ddf86d1 100644
--- a/0012-Set-CARGO_HOME-to-the-local-.config.patch
+++ b/0012-Set-CARGO_HOME-to-the-local-.config.patch
@@ -1,7 +1,7 @@
From b4e25038296cd57eba639a059e8baaf139a5d287 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone(a)redhat.com>
Date: Fri, 7 Dec 2018 13:58:41 -0800
-Subject: [PATCH 12/13] Set CARGO_HOME to the local .config
+Subject: [PATCH 12/14] Set CARGO_HOME to the local .config
---
data/macros.cargo | 6 +++++-
@@ -22,5 +22,5 @@ index 7fb025b..e760721 100644
%__cargo_inspector %{_bindir}/cargo-inspector
--
-2.20.0.rc2
+2.20.1
diff --git a/0013-Set-the-install-root-in-.cargo-config.patch
b/0013-Set-the-install-root-in-.cargo-config.patch
index cb106e8..baa5e3a 100644
--- a/0013-Set-the-install-root-in-.cargo-config.patch
+++ b/0013-Set-the-install-root-in-.cargo-config.patch
@@ -1,7 +1,7 @@
From a04e95bc4f807139bd3c4b75f46fd9a60ec1db8f Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone(a)redhat.com>
Date: Fri, 7 Dec 2018 13:59:03 -0800
-Subject: [PATCH 13/13] Set the install root in .cargo/config
+Subject: [PATCH 13/14] Set the install root in .cargo/config
---
data/macros.cargo | 4 +++-
@@ -30,5 +30,5 @@ index e760721..9a9ce6a 100644
%* \
}\
--
-2.20.0.rc2
+2.20.1
diff --git a/0014-Add-support-for-prerelease-versions.patch
b/0014-Add-support-for-prerelease-versions.patch
new file mode 100644
index 0000000..cf16439
--- /dev/null
+++ b/0014-Add-support-for-prerelease-versions.patch
@@ -0,0 +1,85 @@
+From 29a3c1b84e0971fc0c2edf483ae3b04139c19b32 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Sat, 26 Jan 2019 08:33:37 +0100
+Subject: [PATCH 14/14] Add support for prerelease versions
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ rust2rpm/metadata.py | 18 ++++++++++++------
+ test.py | 8 ++++++++
+ 2 files changed, 20 insertions(+), 6 deletions(-)
+
+diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
+index 328b67a..f0718d5 100644
+--- a/rust2rpm/metadata.py
++++ b/rust2rpm/metadata.py
+@@ -45,11 +45,13 @@ class Dependency:
+ # Any means any
+ continue
+ ver = req.spec
+- if ver.prerelease:
+- raise NotImplementedError(f"Pre-release requirement is not
supported: {ver}")
+ if req.kind in (req.KIND_NEQ, req.KIND_EMPTY):
+ raise NotImplementedError(f"'!=' and empty kinds are not
supported: {req}")
+- coerced = semver.Version.coerce(str(ver))
++ coerced = str(semver.Version.coerce(str(ver)))
++ if ver.prerelease:
++ coerced = coerced.replace("-", "~")
++ # This will advance us to closest stable version (2.0.0-beta.6 2.0.0)
++ ver = ver.next_patch()
+ if req.kind == req.KIND_EQUAL:
+ req.kind = req.KIND_SHORTEQ
+ if req.kind in (req.KIND_CARET, req.KIND_COMPATIBLE):
+@@ -107,7 +109,11 @@ class Dependency:
+ class Metadata:
+ def __init__(self, name, version):
+ self.name = name
+- self.version = version
++ self._version = version
++ version_normalized = Dependency._normalize_req(f"={self._version}")
++ if len(version_normalized) != 1:
++ raise Exception(f"Incorrect version: {self._version}")
++ self.version = version_normalized[0][1]
+ self.license = None
+ self.license_file = None
+ self.readme = None
+@@ -187,7 +193,7 @@ class Metadata:
+ def provides(self, feature=None):
+ if feature not in self.dependencies:
+ raise KeyError(f"Feature {feature!r} doesn't exist")
+- return Dependency(self.name, f"={self.version}", features={feature})
++ return Dependency(self.name, f"={self._version}", features={feature})
+
+ @classmethod
+ def _resolve(cls, deps_by_feature, feature):
+@@ -207,7 +213,7 @@ class Metadata:
+ return self._resolve(self.dependencies, feature)[1]
+ else:
+ features, deps = self.dependencies[feature]
+- fdeps = set(Dependency(self.name, f"={self.version}",
features={feature})
++ fdeps = set(Dependency(self.name, f"={self._version}",
features={feature})
+ for feature in features)
+ return fdeps | deps
+
+diff --git a/test.py b/test.py
+index 30263b4..035df79 100644
+--- a/test.py
++++ b/test.py
+@@ -37,6 +37,14 @@ import rust2rpm
+ "crate(test) = 1.2.3"),
+ (">= 1.2, < 1.5",
+ "(crate(test) >= 1.2.0 with crate(test) < 1.5.0)"),
++ ("^2.0.0-alpha.6",
++ "(crate(test) >= 2.0.0~alpha.6 with crate(test) < 3.0.0)"),
++ ("^0.1.0-alpha.6",
++ "(crate(test) >= 0.1.0~alpha.6 with crate(test) < 0.2.0)"),
++ ("^0.0.1-alpha.6",
++ "(crate(test) >= 0.0.1~alpha.6 with crate(test) < 0.0.2)"),
++ ("^0.0.0-alpha.6",
++ "(crate(test) >= 0.0.0~alpha.6 with crate(test) < 0.0.1)"),
+ ])
+ def test_dependency(req, rpmdep):
+ dep = rust2rpm.Dependency("test", req)
+--
+2.20.1
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 5b5682d..0d97e56 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -5,7 +5,7 @@
Name: rust-packaging
Version: 6
-Release: 18%{?dist}
+Release: 19%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -24,6 +24,7 @@ Patch0010: 0010-trivial-use-f-strings-everywhere.patch
Patch0011: 0011-Add-option-to-not-generate-a-default-changelog-entry.patch
Patch0012: 0012-Set-CARGO_HOME-to-the-local-.config.patch
Patch0013: 0013-Set-the-install-root-in-.cargo-config.patch
+Patch0014: 0014-Add-support-for-prerelease-versions.patch
ExclusiveArch: %{rust_arches}
@@ -84,6 +85,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sat Jan 26 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-19
+- Add support for pre-release versions
+
* Fri Dec 07 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-18
- Set CARGO_HOME
commit 6745bc623a3106cefedced2c8073010a7ac732aa
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri Dec 7 23:17:39 2018 +0100
Set CARGO_HOME
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch
b/0001-name-spec-patch_file-by-real-crate-name.patch
index 3049ab2..1f65e7f 100644
--- a/0001-name-spec-patch_file-by-real-crate-name.patch
+++ b/0001-name-spec-patch_file-by-real-crate-name.patch
@@ -1,7 +1,7 @@
From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:37:40 +0200
-Subject: [PATCH 01/10] name spec/patch_file by real crate name
+Subject: [PATCH 01/13] name spec/patch_file by real crate name
When renaming using patch file, we really want to change file names too.
@@ -33,5 +33,5 @@ index dc78828..1575ce6 100644
if args.stdout:
print("# {}".format(spec_file))
--
-2.19.1
+2.20.0.rc2
diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch
index fb8f36b..581990d 100644
--- a/0002-generate-doc-statements.patch
+++ b/0002-generate-doc-statements.patch
@@ -1,7 +1,7 @@
From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:40:18 +0200
-Subject: [PATCH 02/10] generate %doc statements
+Subject: [PATCH 02/13] generate %doc statements
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -54,5 +54,5 @@ index 1aeb969..2e9f841 100644
{% endif %}
--
-2.19.1
+2.20.0.rc2
diff --git a/0003-do-better-for-renamed-crates.patch
b/0003-do-better-for-renamed-crates.patch
index e70a367..1640604 100644
--- a/0003-do-better-for-renamed-crates.patch
+++ b/0003-do-better-for-renamed-crates.patch
@@ -1,7 +1,7 @@
From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 00:06:50 +0200
-Subject: [PATCH 03/10] do better for renamed crates
+Subject: [PATCH 03/13] do better for renamed crates
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -86,5 +86,5 @@ index 2e9f841..7dbcc3f 100644
%build
--
-2.19.1
+2.20.0.rc2
diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch
index 0f2a391..0ba106c 100644
--- a/0004-remove-pre-3.6-leftovers.patch
+++ b/0004-remove-pre-3.6-leftovers.patch
@@ -1,7 +1,7 @@
From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 10:43:53 +0200
-Subject: [PATCH 04/10] remove pre-3.6 leftovers
+Subject: [PATCH 04/13] remove pre-3.6 leftovers
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -23,5 +23,5 @@ index f52d968..5adeb65 100644
+
"--manifest-path={}".format(path)])
return cls.from_json(json.loads(metadata))
--
-2.19.1
+2.20.0.rc2
diff --git a/0005-Remove-half-downloaded-crate-on-C.patch
b/0005-Remove-half-downloaded-crate-on-C.patch
index 6daebcc..6f67bb9 100644
--- a/0005-Remove-half-downloaded-crate-on-C.patch
+++ b/0005-Remove-half-downloaded-crate-on-C.patch
@@ -1,7 +1,7 @@
From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:03:48 +0200
-Subject: [PATCH 05/10] Remove half-downloaded crate on ^C
+Subject: [PATCH 05/13] Remove half-downloaded crate on ^C
Subsequent invocations would fail with an error about a corrupted file.
We don't have support for resuming a failed download, so let's remove the
@@ -40,5 +40,5 @@ index e993e7b..8e6f6eb 100644
total=total, unit="B", unit_scale=True):
f.write(chunk)
--
-2.19.1
+2.20.0.rc2
diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
index 1f2a4e0..cc09ce2 100644
--- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
+++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
@@ -1,7 +1,7 @@
From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:18:59 +0200
-Subject: [PATCH 06/10] Throw an error if -s is used without a crate
+Subject: [PATCH 06/13] Throw an error if -s is used without a crate
In the future we might want to be smarter and find the crate, but let's at least
not ignore the option completely.
@@ -24,5 +24,5 @@ index 8e6f6eb..f23ebbc 100644
diff = make_patch(toml, enabled=patch, tmpfile=True)
metadata = Metadata.from_file(toml)
--
-2.19.1
+2.20.0.rc2
diff --git a/0007-split-features-into-subpackages.patch
b/0007-split-features-into-subpackages.patch
index ac08472..52d253e 100644
--- a/0007-split-features-into-subpackages.patch
+++ b/0007-split-features-into-subpackages.patch
@@ -1,7 +1,7 @@
From 2cac5e5ad5ff5472923ce333bef59679612bbaa2 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri, 26 Oct 2018 11:20:13 +0200
-Subject: [PATCH 07/10] split features into subpackages
+Subject: [PATCH 07/13] split features into subpackages
References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-fe...
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
@@ -1060,5 +1060,5 @@ index b856fdd..30263b4 100644
- assert [str(x) for x in md.provides] == provides
- assert [str(x) for x in md.requires] == requires
--
-2.19.1
+2.20.0.rc2
diff --git a/0008-add-support-for-dependencies-with-same-name.patch
b/0008-add-support-for-dependencies-with-same-name.patch
index d63d0c4..378edfc 100644
--- a/0008-add-support-for-dependencies-with-same-name.patch
+++ b/0008-add-support-for-dependencies-with-same-name.patch
@@ -1,7 +1,7 @@
From a1d3a84645aa7bbe5ca07b60bead1ddf90a21cc1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 30 Oct 2018 20:37:38 +0100
-Subject: [PATCH 08/10] add support for dependencies with same name
+Subject: [PATCH 08/13] add support for dependencies with same name
Reported-by: Josh Stone <jistone(a)redhat.com>
References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
@@ -70,5 +70,5 @@ index 4929cdd..328b67a 100644
if "default" not in deps_by_feature:
--
-2.19.1
+2.20.0.rc2
diff --git a/0009-add-support-for-feeding-user-configuration.patch
b/0009-add-support-for-feeding-user-configuration.patch
index 233c11c..b130ebe 100644
--- a/0009-add-support-for-feeding-user-configuration.patch
+++ b/0009-add-support-for-feeding-user-configuration.patch
@@ -1,7 +1,7 @@
From 197150ee2e862edcd46f7ab02c9e4d17e49ca75d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 18:03:21 +0100
-Subject: [PATCH 09/10] add support for feeding user configuration
+Subject: [PATCH 09/13] add support for feeding user configuration
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -144,5 +144,5 @@ index 0d9a80b..d901e6d 100644
%description {{ pkg }} %{_description}
--
-2.19.1
+2.20.0.rc2
diff --git a/0010-trivial-use-f-strings-everywhere.patch
b/0010-trivial-use-f-strings-everywhere.patch
index 32bae14..f6ff2f4 100644
--- a/0010-trivial-use-f-strings-everywhere.patch
+++ b/0010-trivial-use-f-strings-everywhere.patch
@@ -1,7 +1,7 @@
From 83ea3796cd28ec7689b39e7dc7a70bd11af1abf1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 17:00:58 +0100
-Subject: [PATCH 10/10] trivial: use f-strings everywhere
+Subject: [PATCH 10/13] trivial: use f-strings everywhere
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
@@ -90,5 +90,5 @@ index c691274..b60e6c4 100644
else:
with open(spec_file, "w") as fobj:
--
-2.19.1
+2.20.0.rc2
diff --git a/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
new file mode 100644
index 0000000..ccad736
--- /dev/null
+++ b/0011-Add-option-to-not-generate-a-default-changelog-entry.patch
@@ -0,0 +1,63 @@
+From 294c6f571c0f4f7ed5a4fcb34142b0d332c55f29 Mon Sep 17 00:00:00 2001
+From: Neal Gompa <ngompa13(a)gmail.com>
+Date: Sun, 11 Nov 2018 11:06:27 -0500
+Subject: [PATCH 11/13] Add option to not generate a default changelog entry
+
+For Rust packages created through the OBS source service, the
+changelog is managed by an external <pkg>.changes file that is
+transformed into an RPM changelog and appended to the spec file
+automatically by the Open Build Service.
+
+Having a default entry means that the changelog handling will not
+always work correctly and package builds may fail due to changelog
+entries not being in reverse chronological order.
+
+This also is a future enabler for other workflows for external
+changelog management in automated package builds.
+
+Signed-off-by: Neal Gompa <ngompa13(a)gmail.com>
+---
+ rust2rpm/__main__.py | 7 +++++++
+ rust2rpm/templates/main.spec | 4 +++-
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
+index b60e6c4..747328e 100644
+--- a/rust2rpm/__main__.py
++++ b/rust2rpm/__main__.py
+@@ -209,6 +209,8 @@ def main():
+ formatter_class=argparse.RawTextHelpFormatter)
+ parser.add_argument("--show-license-map", action="store_true",
+ help="Print license mappings and exit")
++ parser.add_argument("--no-auto-changelog-entry",
action="store_true",
++ help="Do not generate a changelog entry")
+ parser.add_argument("-", "--stdout",
action="store_true",
+ help="Print spec and patches into stdout")
+ parser.add_argument("-t", "--target", action="store",
+@@ -261,6 +263,11 @@ def main():
+ raise ValueError("No bins and no libs")
+ kwargs["include_devel"] = is_lib
+
++ if args.no_auto_changelog_entry:
++ kwargs["auto_changelog_entry"] = False
++ else:
++ kwargs["auto_changelog_entry"] = True
++
+ if args.target in ("fedora", "mageia", "opensuse"):
+ kwargs["include_build_requires"] = True
+ kwargs["include_provides"] = False
+diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
+index d901e6d..84bd97d 100644
+--- a/rust2rpm/templates/main.spec
++++ b/rust2rpm/templates/main.spec
+@@ -179,4 +179,6 @@ which use {% if feature is not none %}"{{ feature }}"
feature of {% endif %}"%{c
+ %endif
+
+ %changelog
+-{% include target ~ "-changelog.spec.inc" %}
++{% if auto_changelog_entry %}
++ {% include target ~ "-changelog.spec.inc" %}
++{% endif %}
+--
+2.20.0.rc2
+
diff --git a/0012-Set-CARGO_HOME-to-the-local-.config.patch
b/0012-Set-CARGO_HOME-to-the-local-.config.patch
new file mode 100644
index 0000000..9f81757
--- /dev/null
+++ b/0012-Set-CARGO_HOME-to-the-local-.config.patch
@@ -0,0 +1,26 @@
+From b4e25038296cd57eba639a059e8baaf139a5d287 Mon Sep 17 00:00:00 2001
+From: Josh Stone <jistone(a)redhat.com>
+Date: Fri, 7 Dec 2018 13:58:41 -0800
+Subject: [PATCH 12/13] Set CARGO_HOME to the local .config
+
+---
+ data/macros.cargo | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/data/macros.cargo b/data/macros.cargo
+index 7fb025b..e760721 100644
+--- a/data/macros.cargo
++++ b/data/macros.cargo
+@@ -1,4 +1,8 @@
+-%__cargo %{_bindir}/cargo
++# Since cargo 1.31, install only uses $CARGO_HOME/config, ignoring $PWD.
++#
https://github.com/rust-lang/cargo/issues/6397
++# But we can set CARGO_HOME locally, which is a good idea anyway to make sure
++# it never writes to ~/.cargo during rpmbuild.
++%__cargo %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo
+ %__cargo_common_opts %{?_smp_mflags}
+ %__cargo_inspector %{_bindir}/cargo-inspector
+
+--
+2.20.0.rc2
+
diff --git a/0013-Set-the-install-root-in-.cargo-config.patch
b/0013-Set-the-install-root-in-.cargo-config.patch
new file mode 100644
index 0000000..cb106e8
--- /dev/null
+++ b/0013-Set-the-install-root-in-.cargo-config.patch
@@ -0,0 +1,34 @@
+From a04e95bc4f807139bd3c4b75f46fd9a60ec1db8f Mon Sep 17 00:00:00 2001
+From: Josh Stone <jistone(a)redhat.com>
+Date: Fri, 7 Dec 2018 13:59:03 -0800
+Subject: [PATCH 13/13] Set the install root in .cargo/config
+
+---
+ data/macros.cargo | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/data/macros.cargo b/data/macros.cargo
+index e760721..9a9ce6a 100644
+--- a/data/macros.cargo
++++ b/data/macros.cargo
+@@ -20,6 +20,9 @@ rustc = "%{__rustc}"\
+ rustdoc = "%{__rustdoc}"\
+ rustflags = %{__global_rustflags_toml}\
+ \
++[install]\
++root = "%{buildroot}%{_prefix}"\
++\
+ [term]\
+ verbose = true\
+ \
+@@ -81,7 +84,6 @@ if %__cargo_is_bin; then \
+ %{shrink:%{__cargo} install \
+ %{__cargo_common_opts} \
+ --path . \
+- --root %{buildroot}%{_prefix} \
+ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
+ %* \
+ }\
+--
+2.20.0.rc2
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 98fa000..5b5682d 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -5,7 +5,7 @@
Name: rust-packaging
Version: 6
-Release: 17%{?dist}
+Release: 18%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -17,11 +17,13 @@ Patch0003: 0003-do-better-for-renamed-crates.patch
Patch0004: 0004-remove-pre-3.6-leftovers.patch
Patch0005: 0005-Remove-half-downloaded-crate-on-C.patch
Patch0006: 0006-Throw-an-error-if-s-is-used-without-a-crate.patch
-# Still in PR
Patch0007: 0007-split-features-into-subpackages.patch
Patch0008: 0008-add-support-for-dependencies-with-same-name.patch
Patch0009: 0009-add-support-for-feeding-user-configuration.patch
Patch0010: 0010-trivial-use-f-strings-everywhere.patch
+Patch0011: 0011-Add-option-to-not-generate-a-default-changelog-entry.patch
+Patch0012: 0012-Set-CARGO_HOME-to-the-local-.config.patch
+Patch0013: 0013-Set-the-install-root-in-.cargo-config.patch
ExclusiveArch: %{rust_arches}
@@ -82,6 +84,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Fri Dec 07 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-18
+- Set CARGO_HOME
+
* Sat Nov 03 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-17
- Update patchset
commit 04e7ad287a632a68ccd10cfd35a636852108ad28
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat Nov 3 21:45:54 2018 +0100
Update patchset
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0007-split-features-into-subpackages.patch
b/0007-split-features-into-subpackages.patch
index 519b6ac..ac08472 100644
--- a/0007-split-features-into-subpackages.patch
+++ b/0007-split-features-into-subpackages.patch
@@ -1,4 +1,4 @@
-From 5471c1916a5e947ba1b21343b70abd6d4aaf97de Mon Sep 17 00:00:00 2001
+From 2cac5e5ad5ff5472923ce333bef59679612bbaa2 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri, 26 Oct 2018 11:20:13 +0200
Subject: [PATCH 07/10] split features into subpackages
@@ -7,12 +7,13 @@ References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-desi
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
data/cargo.attr | 4 +-
- data/macros.cargo | 10 ++
+ data/macros.cargo | 10 +
rust2rpm/__main__.py | 11 +-
rust2rpm/inspector.py | 22 ++-
- rust2rpm/metadata.py | 315 +++++++++++++++++------------------
- rust2rpm/templates/main.spec | 142 ++++++++--------
- 6 files changed, 260 insertions(+), 244 deletions(-)
+ rust2rpm/metadata.py | 317 ++++++++++++++++----------------
+ rust2rpm/templates/main.spec | 142 +++++++-------
+ test.py | 347 ++++-------------------------------
+ 7 files changed, 298 insertions(+), 555 deletions(-)
diff --git a/data/cargo.attr b/data/cargo.attr
index 392a72b..4910b5c 100644
@@ -143,10 +144,10 @@ index 2d488b2..9e79e88 100644
if __name__ == "__main__":
main()
diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
-index 5adeb65..119dea5 100644
+index 5adeb65..4929cdd 100644
--- a/rust2rpm/metadata.py
+++ b/rust2rpm/metadata.py
-@@ -1,208 +1,205 @@
+@@ -1,208 +1,207 @@
__all__ = ["Dependency", "Metadata"]
-import itertools
@@ -260,8 +261,8 @@ index 5adeb65..119dea5 100644
- spec = semver.Spec(s.replace(" ", ""))
- parsed = []
+ def _normalize_req(req):
-+ if "*" in req:
-+ return NotImplemented
++ if "*" in req and req != "*":
++ raise NotImplementedError(f"'*' is not supported: {req}")
+ spec = semver.Spec(req.replace(" ", ""))
+ reqs = []
for req in spec.specs:
@@ -271,8 +272,10 @@ index 5adeb65..119dea5 100644
+ # Any means any
continue
+ ver = req.spec
-+ if ver.prerelease or req.kind in (req.KIND_NEQ, req.KIND_EMPTY):
-+ return NotImplemented
++ if ver.prerelease:
++ raise NotImplementedError(f"Pre-release requirement is not
supported: {ver}")
++ if req.kind in (req.KIND_NEQ, req.KIND_EMPTY):
++ raise NotImplementedError(f"'!=' and empty kinds are not
supported: {req}")
coerced = semver.Version.coerce(str(ver))
- if req.kind in (req.KIND_CARET, req.KIND_TILDE):
- if ver.prerelease:
@@ -697,6 +700,365 @@ index 7dbcc3f..0d9a80b 100644
-{% endif %}
%changelog
{% include target ~ "-changelog.spec.inc" %}
+diff --git a/test.py b/test.py
+index b856fdd..30263b4 100644
+--- a/test.py
++++ b/test.py
+@@ -1,318 +1,43 @@
+-import os
+-import shutil
+-import subprocess
+-import sys
+-import tempfile
+-import textwrap
+-
+ import pytest
+
+ import rust2rpm
+
+-DUMMY_LIB = """
+-pub fn say_hello() {
+- println!("Hello, World!");
+-}
+-"""
+-DEPGEN = os.path.join(os.path.dirname(__file__), "cargodeps.py")
+-
+-
+-(a)pytest.mark.parametrize("req, features, rpmdep", [
+- ("=1.0.0", [],
+- "crate(test) = 1.0.0"),
+- ("=1.0.0", ["feature"],
+- "(crate(test) = 1.0.0 with crate(test/feature))"),
+- (">=1.0.0,<2.0.0", [],
++(a)pytest.mark.parametrize("req, rpmdep", [
++ ("^1.2.3",
++ "(crate(test) >= 1.2.3 with crate(test) < 2.0.0)"),
++ ("^1.2",
++ "(crate(test) >= 1.2.0 with crate(test) < 2.0.0)"),
++ ("^1",
+ "(crate(test) >= 1.0.0 with crate(test) < 2.0.0)"),
+- (">=1.0.0,<2.0.0", ["feature"],
+- "((crate(test) >= 1.0.0 with crate(test) < 2.0.0) with
crate(test/feature))"),
++ ("^0.2.3",
++ "(crate(test) >= 0.2.3 with crate(test) < 0.3.0)"),
++ ("^0.2",
++ "(crate(test) >= 0.2.0 with crate(test) < 0.3.0)"),
++ ("^0.0.3",
++ "(crate(test) >= 0.0.3 with crate(test) < 0.0.4)"),
++ ("^0.0",
++ "(crate(test) >= 0.0.0 with crate(test) < 0.1.0)"),
++ ("^0",
++ "(crate(test) >= 0.0.0 with crate(test) < 1.0.0)"),
++ ("~1.2.3",
++ "(crate(test) >= 1.2.3 with crate(test) < 1.3.0)"),
++ ("~1.2",
++ "(crate(test) >= 1.2.0 with crate(test) < 1.3.0)"),
++ ("~1",
++ "(crate(test) >= 1.0.0 with crate(test) < 2.0.0)"),
++ ("*",
++ "crate(test)"),
++ (">= 1.2.0",
++ "crate(test) >= 1.2.0"),
++ ("> 1",
++ "crate(test) > 1.0.0"),
++ ("< 2",
++ "crate(test) < 2.0.0"),
++ ("= 1.2.3",
++ "crate(test) = 1.2.3"),
++ (">= 1.2, < 1.5",
++ "(crate(test) >= 1.2.0 with crate(test) < 1.5.0)"),
+ ])
+-def test_dependency(req, features, rpmdep):
+- dep = rust2rpm.Dependency("test", req, features)
++def test_dependency(req, rpmdep):
++ dep = rust2rpm.Dependency("test", req)
+ assert str(dep) == rpmdep
+-
+-(a)pytest.fixture
+-def cargo_toml(request):
+- def make_cargo_toml(contents):
+- toml = os.path.join(tmpdir, "Cargo.toml")
+- with open(toml, "w") as fobj:
+- fobj.write(textwrap.dedent(contents))
+- return toml
+-
+- tmpdir = tempfile.mkdtemp(prefix="cargo-deps-")
+- srcdir = os.path.join(tmpdir, "src")
+- os.mkdir(srcdir)
+- with open(os.path.join(srcdir, "lib.rs"), "w") as fobj:
+- fobj.write(DUMMY_LIB)
+-
+- def finalize():
+- shutil.rmtree(tmpdir)
+- request.addfinalizer(finalize)
+-
+- return make_cargo_toml
+-
+-(a)pytest.mark.parametrize("toml, provides, requires", [
+-
+- # Basic provides
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+- """,
+- ["crate(hello) = 0.0.0"],
+- []),
+-
+- # Basic provides for feature
+- ("""
+- [package]
+- name = "hello"
+- version = "1.2.3"
+-
+- [features]
+- color = []
+- """,
+- ["crate(hello) = 1.2.3",
+- "crate(hello/color) = 1.2.3"],
+- []),
+-
+- # Provides for optional dependencies
+- ("""
+- [package]
+- name = "hello"
+- version = "1.2.3"
+-
+- [dependencies]
+- non_optional = "1"
+- serde = { version = "1", optional = true }
+- rand = { version = "0.4", optional = true }
+-
+- [features]
+- std = []
+- v1 = ["rand"]
+- """,
+- ["crate(hello) = 1.2.3",
+- "crate(hello/rand) = 1.2.3",
+- "crate(hello/serde) = 1.2.3",
+- "crate(hello/std) = 1.2.3",
+- "crate(hello/v1) = 1.2.3"],
+- ["(crate(non_optional) >= 1.0.0 with crate(non_optional) <
2.0.0)",
+- "(crate(rand) >= 0.4.0 with crate(rand) < 0.5.0)",
+- "(crate(serde) >= 1.0.0 with crate(serde) < 2.0.0)"]),
+-
+- # Caret requirements
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "^0"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 0.0.0 with crate(libc) < 1.0.0)"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "^0.0"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 0.0.0 with crate(libc) < 0.1.0)"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "^0.0.3"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 0.0.3 with crate(libc) < 0.0.4)"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "^0.2.3"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 0.2.3 with crate(libc) < 0.3.0)"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "^1"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 1.0.0 with crate(libc) < 2.0.0)"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "^1.2"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 1.2.0 with crate(libc) < 2.0.0)"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "^1.2.3"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 1.2.3 with crate(libc) < 2.0.0)"]),
+-
+- # Tilde requirements
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "~1"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 1.0.0 with crate(libc) < 2.0.0)"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "~1.2"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 1.2.0 with crate(libc) < 1.3.0)"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "~1.2.3"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 1.2.3 with crate(libc) < 1.3.0)"]),
+-
+- # Wildcard requirements
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "*"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["crate(libc)"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "1.*"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 1.0.0 with crate(libc) < 2.0.0)"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "1.2.*"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 1.2.0 with crate(libc) < 1.3.0)"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "1.*.*"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 1.0.0 with crate(libc) < 2.0.0)"]),
+-
+- # Inequality requirements
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = ">= 1.2.0"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["crate(libc) >= 1.2.0"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "> 1"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["crate(libc) > 1.0.0"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "< 2"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["crate(libc) < 2.0.0"]),
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = "= 1.2.3"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["crate(libc) = 1.2.3"]),
+-
+- # Multiple requirements
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0"
+-
+- [dependencies]
+- libc = ">= 1.2, < 1.5"
+- """,
+- ["crate(hello) = 0.0.0"],
+- ["(crate(libc) >= 1.2.0 with crate(libc) < 1.5.0)"]),
+-
+- # Pre-release requirements
+- ("""
+- [package]
+- name = "hello"
+- version = "0.0.0-alpha"
+-
+- [dependencies]
+- foo-bar = "1.2.3-beta"
+- """,
+- ["crate(hello) = 0.0.0~alpha"],
+- ["(crate(foo-bar) >= 1.2.3~beta with crate(foo-bar) < 1.2.3)"]),
+-
+-])
+-def test_depgen(toml, provides, requires, cargo_toml):
+- md = rust2rpm.Metadata.from_file(cargo_toml(toml))
+- assert [str(x) for x in md.provides] == provides
+- assert [str(x) for x in md.requires] == requires
--
2.19.1
diff --git a/0008-add-support-for-dependencies-with-same-name.patch
b/0008-add-support-for-dependencies-with-same-name.patch
index 1932281..d63d0c4 100644
--- a/0008-add-support-for-dependencies-with-same-name.patch
+++ b/0008-add-support-for-dependencies-with-same-name.patch
@@ -1,4 +1,4 @@
-From 8905032db2b0198c6426011807f3b75fc91c38b5 Mon Sep 17 00:00:00 2001
+From a1d3a84645aa7bbe5ca07b60bead1ddf90a21cc1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 30 Oct 2018 20:37:38 +0100
Subject: [PATCH 08/10] add support for dependencies with same name
@@ -11,7 +11,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
-index 119dea5..febf1e5 100644
+index 4929cdd..328b67a 100644
--- a/rust2rpm/metadata.py
+++ b/rust2rpm/metadata.py
@@ -1,5 +1,6 @@
@@ -21,7 +21,7 @@ index 119dea5..febf1e5 100644
import copy
import json
import subprocess
-@@ -124,9 +125,11 @@ class Metadata:
+@@ -126,9 +127,11 @@ class Metadata:
self.description = md.get("description")
# dependencies + build-dependencies runtime
@@ -36,7 +36,7 @@ index 119dea5..febf1e5 100644
deps_by_feature = {}
for feature, f_deps in md["features"].items():
-@@ -137,18 +140,23 @@ class Metadata:
+@@ -139,18 +142,23 @@ class Metadata:
features.add(dep)
else:
pkg, _, f = dep.partition("/")
diff --git a/0009-add-support-for-feeding-user-configuration.patch
b/0009-add-support-for-feeding-user-configuration.patch
index d811dac..233c11c 100644
--- a/0009-add-support-for-feeding-user-configuration.patch
+++ b/0009-add-support-for-feeding-user-configuration.patch
@@ -1,4 +1,4 @@
-From 9ef415cbd5e204849793a16fa1b8a9ed40c0be73 Mon Sep 17 00:00:00 2001
+From 197150ee2e862edcd46f7ab02c9e4d17e49ca75d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 18:03:21 +0100
Subject: [PATCH 09/10] add support for feeding user configuration
diff --git a/0010-trivial-use-f-strings-everywhere.patch
b/0010-trivial-use-f-strings-everywhere.patch
index dd42d58..32bae14 100644
--- a/0010-trivial-use-f-strings-everywhere.patch
+++ b/0010-trivial-use-f-strings-everywhere.patch
@@ -1,4 +1,4 @@
-From be0464ab8a235b4c3b49e711140c2de2f0dcf6d8 Mon Sep 17 00:00:00 2001
+From 83ea3796cd28ec7689b39e7dc7a70bd11af1abf1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 17:00:58 +0100
Subject: [PATCH 10/10] trivial: use f-strings everywhere
diff --git a/rust-packaging.spec b/rust-packaging.spec
index f80f490..98fa000 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -1,12 +1,11 @@
-# Tests need fixing after patches
-%bcond_with check
+%bcond_without check
%{?python_enable_dependency_generator}
#
https://pagure.io/koji/issue/659
%global debug_package %{nil}
Name: rust-packaging
Version: 6
-Release: 16%{?dist}
+Release: 17%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -83,6 +82,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sat Nov 03 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-17
+- Update patchset
+
* Sat Nov 03 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-16
- Make package archful
commit 965e2b87b5dc2618aacb99bd2875fc673f6746eb
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat Nov 3 10:15:56 2018 +0100
Make package archful
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 524b739..f80f490 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -1,10 +1,12 @@
# Tests need fixing after patches
%bcond_with check
%{?python_enable_dependency_generator}
+#
https://pagure.io/koji/issue/659
+%global debug_package %{nil}
Name: rust-packaging
Version: 6
-Release: 15%{?dist}
+Release: 16%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -22,8 +24,7 @@ Patch0008: 0008-add-support-for-dependencies-with-same-name.patch
Patch0009: 0009-add-support-for-feeding-user-configuration.patch
Patch0010: 0010-trivial-use-f-strings-everywhere.patch
-BuildArch: noarch
-ExclusiveArch: %{rust_arches} noarch
+ExclusiveArch: %{rust_arches}
# gawk is needed for stripping dev-deps in macro, 4.1.0 is needed for inplace feature
Requires: gawk >= 4.1.0
@@ -82,6 +83,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sat Nov 03 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-16
+- Make package archful
+
* Fri Nov 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-15
- Support .rust2rpm.conf
commit 5ab9ed56cb2342f2e30413ce4cf1d3c499b5bfd2
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri Nov 2 17:05:14 2018 +0100
update patches
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0007-split-features-into-subpackages.patch
b/0007-split-features-into-subpackages.patch
index 0d4c7e2..519b6ac 100644
--- a/0007-split-features-into-subpackages.patch
+++ b/0007-split-features-into-subpackages.patch
@@ -1,4 +1,4 @@
-From 6f95899a21799054165858cacbe588a2a8bc6020 Mon Sep 17 00:00:00 2001
+From 5471c1916a5e947ba1b21343b70abd6d4aaf97de Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri, 26 Oct 2018 11:20:13 +0200
Subject: [PATCH 07/10] split features into subpackages
diff --git a/0008-add-support-for-dependencies-with-same-name.patch
b/0008-add-support-for-dependencies-with-same-name.patch
index 490338c..1932281 100644
--- a/0008-add-support-for-dependencies-with-same-name.patch
+++ b/0008-add-support-for-dependencies-with-same-name.patch
@@ -1,4 +1,4 @@
-From a5fd01ecd0fd600a096c060ddfe77a21f54b045f Mon Sep 17 00:00:00 2001
+From 8905032db2b0198c6426011807f3b75fc91c38b5 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 30 Oct 2018 20:37:38 +0100
Subject: [PATCH 08/10] add support for dependencies with same name
diff --git a/0009-add-support-for-feeding-user-configuration.patch
b/0009-add-support-for-feeding-user-configuration.patch
index 1a33fae..d811dac 100644
--- a/0009-add-support-for-feeding-user-configuration.patch
+++ b/0009-add-support-for-feeding-user-configuration.patch
@@ -1,4 +1,4 @@
-From 52b6ff8d55d59ace29950621ed41175ac31fa90c Mon Sep 17 00:00:00 2001
+From 9ef415cbd5e204849793a16fa1b8a9ed40c0be73 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 18:03:21 +0100
Subject: [PATCH 09/10] add support for feeding user configuration
@@ -57,7 +57,7 @@ index 8866027..0000000
-
-Convert Rust crates to RPM.
diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
-index d19cb47..18fac5c 100644
+index d19cb47..c691274 100644
--- a/rust2rpm/__main__.py
+++ b/rust2rpm/__main__.py
@@ -199,6 +199,11 @@ def make_diff_metadata(crate, version, patch=False, store=False):
@@ -84,7 +84,7 @@ index d19cb47..18fac5c 100644
kwargs["license"] = license
kwargs["license_comments"] = comments
-+ conf = configparser.ConfigParser()
++ conf =
configparser.ConfigParser(interpolation=configparser.ExtendedInterpolation())
+ conf.read(".rust2rpm.conf")
+ if args.target not in conf:
+ conf.add_section(args.target)
diff --git a/0010-trivial-use-f-strings-everywhere.patch
b/0010-trivial-use-f-strings-everywhere.patch
index 3d8ca14..dd42d58 100644
--- a/0010-trivial-use-f-strings-everywhere.patch
+++ b/0010-trivial-use-f-strings-everywhere.patch
@@ -1,4 +1,4 @@
-From 00ed1ce05d9dd4c8042f27ca959350ce34fb1be5 Mon Sep 17 00:00:00 2001
+From be0464ab8a235b4c3b49e711140c2de2f0dcf6d8 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed, 31 Oct 2018 17:00:58 +0100
Subject: [PATCH 10/10] trivial: use f-strings everywhere
@@ -9,7 +9,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
-index 18fac5c..b4eb624 100644
+index c691274..b60e6c4 100644
--- a/rust2rpm/__main__.py
+++ b/rust2rpm/__main__.py
@@ -79,7 +79,7 @@ def detect_packager():
commit ae59ba471de8c4fbf9b5b99030f71b5758ce1a2e
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri Nov 2 17:00:14 2018 +0100
Support .rust2rpm.conf
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch
b/0001-name-spec-patch_file-by-real-crate-name.patch
index 27fbbfa..3049ab2 100644
--- a/0001-name-spec-patch_file-by-real-crate-name.patch
+++ b/0001-name-spec-patch_file-by-real-crate-name.patch
@@ -1,7 +1,7 @@
From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:37:40 +0200
-Subject: [PATCH 1/8] name spec/patch_file by real crate name
+Subject: [PATCH 01/10] name spec/patch_file by real crate name
When renaming using patch file, we really want to change file names too.
diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch
index fb5ec59..fb8f36b 100644
--- a/0002-generate-doc-statements.patch
+++ b/0002-generate-doc-statements.patch
@@ -1,7 +1,7 @@
From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:40:18 +0200
-Subject: [PATCH 2/8] generate %doc statements
+Subject: [PATCH 02/10] generate %doc statements
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0003-do-better-for-renamed-crates.patch
b/0003-do-better-for-renamed-crates.patch
index 0c9c3fd..e70a367 100644
--- a/0003-do-better-for-renamed-crates.patch
+++ b/0003-do-better-for-renamed-crates.patch
@@ -1,7 +1,7 @@
From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 00:06:50 +0200
-Subject: [PATCH 3/8] do better for renamed crates
+Subject: [PATCH 03/10] do better for renamed crates
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch
index 79d041d..0f2a391 100644
--- a/0004-remove-pre-3.6-leftovers.patch
+++ b/0004-remove-pre-3.6-leftovers.patch
@@ -1,7 +1,7 @@
From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 10:43:53 +0200
-Subject: [PATCH 4/8] remove pre-3.6 leftovers
+Subject: [PATCH 04/10] remove pre-3.6 leftovers
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0005-Remove-half-downloaded-crate-on-C.patch
b/0005-Remove-half-downloaded-crate-on-C.patch
index ef0eb21..6daebcc 100644
--- a/0005-Remove-half-downloaded-crate-on-C.patch
+++ b/0005-Remove-half-downloaded-crate-on-C.patch
@@ -1,7 +1,7 @@
From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:03:48 +0200
-Subject: [PATCH 5/8] Remove half-downloaded crate on ^C
+Subject: [PATCH 05/10] Remove half-downloaded crate on ^C
Subsequent invocations would fail with an error about a corrupted file.
We don't have support for resuming a failed download, so let's remove the
diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
index 44bc5b1..1f2a4e0 100644
--- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
+++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
@@ -1,7 +1,7 @@
From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:18:59 +0200
-Subject: [PATCH 6/8] Throw an error if -s is used without a crate
+Subject: [PATCH 06/10] Throw an error if -s is used without a crate
In the future we might want to be smarter and find the crate, but let's at least
not ignore the option completely.
diff --git a/0007-split-features-into-subpackages.patch
b/0007-split-features-into-subpackages.patch
index fe96334..0d4c7e2 100644
--- a/0007-split-features-into-subpackages.patch
+++ b/0007-split-features-into-subpackages.patch
@@ -1,7 +1,7 @@
-From d7caa1148d5fcac70030e3fb1eb698927e69960f Mon Sep 17 00:00:00 2001
+From 6f95899a21799054165858cacbe588a2a8bc6020 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri, 26 Oct 2018 11:20:13 +0200
-Subject: [PATCH 7/8] split features into subpackages
+Subject: [PATCH 07/10] split features into subpackages
References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-fe...
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0008-add-support-for-dependencies-with-same-name.patch
b/0008-add-support-for-dependencies-with-same-name.patch
index dbbad89..490338c 100644
--- a/0008-add-support-for-dependencies-with-same-name.patch
+++ b/0008-add-support-for-dependencies-with-same-name.patch
@@ -1,7 +1,7 @@
-From 129d556d19d2e41135f5e98ed028d7d00e66b524 Mon Sep 17 00:00:00 2001
+From a5fd01ecd0fd600a096c060ddfe77a21f54b045f Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 30 Oct 2018 20:37:38 +0100
-Subject: [PATCH 8/8] add support for dependencies with same name
+Subject: [PATCH 08/10] add support for dependencies with same name
Reported-by: Josh Stone <jistone(a)redhat.com>
References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
diff --git a/0009-add-support-for-feeding-user-configuration.patch
b/0009-add-support-for-feeding-user-configuration.patch
new file mode 100644
index 0000000..1a33fae
--- /dev/null
+++ b/0009-add-support-for-feeding-user-configuration.patch
@@ -0,0 +1,148 @@
+From 52b6ff8d55d59ace29950621ed41175ac31fa90c Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Wed, 31 Oct 2018 18:03:21 +0100
+Subject: [PATCH 09/10] add support for feeding user configuration
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ README.md | 26 ++++++++++++++++++++++++++
+ README.rst | 5 -----
+ rust2rpm/__main__.py | 13 +++++++++++++
+ rust2rpm/templates/main.spec | 17 ++++++++++++++++-
+ 4 files changed, 55 insertions(+), 6 deletions(-)
+ create mode 100644 README.md
+ delete mode 100644 README.rst
+
+diff --git a/README.md b/README.md
+new file mode 100644
+index 0000000..22b4b30
+--- /dev/null
++++ b/README.md
+@@ -0,0 +1,26 @@
++# rust2rpm
++
++Convert Rust crates to RPM.
++
++## `.rust2rpm.conf`
++
++You can place configuration file which is used as source for additional
++information for spec generation.
++
++Some simple example would be better than many words ;)
++
++```ini
++[DEFAULT]
++buildrequires =
++ pkgconfig(foo) >= 1.2.3
++lib.requires =
++ pkgconfig(foo) >= 1.2.3
++
++[fedora]
++bin.requires =
++ findutils
++buildrequires =
++lib.requires =
++lib+default.requires =
++ pkgconfig(bar) >= 2.0.0
++```
+diff --git a/README.rst b/README.rst
+deleted file mode 100644
+index 8866027..0000000
+--- a/README.rst
++++ /dev/null
+@@ -1,5 +0,0 @@
+-========
+-rust2rpm
+-========
+-
+-Convert Rust crates to RPM.
+diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
+index d19cb47..18fac5c 100644
+--- a/rust2rpm/__main__.py
++++ b/rust2rpm/__main__.py
+@@ -199,6 +199,11 @@ def make_diff_metadata(crate, version, patch=False, store=False):
+ shutil.copy2(cratef, os.path.join(os.getcwd(),
f"{metadata.name}-{version}.crate"))
+ return crate, diff, metadata
+
++def to_list(s):
++ if not s:
++ return []
++ return list(filter(None, (l.strip() for l in s.splitlines())))
++
+ def main():
+ parser = argparse.ArgumentParser("rust2rpm",
+ formatter_class=argparse.RawTextHelpFormatter)
+@@ -232,6 +237,7 @@ def main():
+ store=args.store_crate)
+
+ JINJA_ENV.globals["normalize_deps"] = normalize_deps
++ JINJA_ENV.globals["to_list"] = to_list
+ template = JINJA_ENV.get_template("main.spec")
+
+ if args.patch and len(diff) > 0:
+@@ -287,6 +293,13 @@ def main():
+ kwargs["license"] = license
+ kwargs["license_comments"] = comments
+
++ conf = configparser.ConfigParser()
++ conf.read(".rust2rpm.conf")
++ if args.target not in conf:
++ conf.add_section(args.target)
++
++ kwargs["distconf"] = conf[args.target]
++
+ spec_file = f"rust-{metadata.name}.spec"
+ spec_contents = template.render(md=metadata, patch_file=patch_file, **kwargs)
+ if args.stdout:
+diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
+index 0d9a80b..d901e6d 100644
+--- a/rust2rpm/templates/main.spec
++++ b/rust2rpm/templates/main.spec
+@@ -65,6 +65,9 @@ BuildRequires: {{ req }}
+ {% endfor %}
+ %endif
+ {% endif %}
++{% for req in to_list(distconf.get("buildrequires"))|sort %}
++BuildRequires: {{ req }}
++{% endfor %}
+
+ %global _description \
+ {% if md.description is none %}
+@@ -81,6 +84,9 @@ Summary: %{summary}
+ {% if rust_group is defined %}
+ Group: # FIXME
+ {% endif %}
++ {% for req in to_list(distconf.get("bin.requires"))|sort %}
++Requires: {{ req }}
++ {% endfor %}
+
+ %description -n %{crate}
+ %{summary}.
+@@ -106,7 +112,13 @@ Group: # FIXME
+ {% do features.insert(0, None) %}
+ {% do features.insert(1, "default") %}
+ {% for feature in features %}
+- {% set pkg = "-n %%{name}+%s-devel"|format(feature) if feature is not none
else " devel" %}
++ {% if feature is none %}
++ {% set pkg = " devel" %}
++ {% set conf_prefix = "lib" %}
++ {% else %}
++ {% set pkg = "-n %%{name}+%s-devel"|format(feature) %}
++ {% set conf_prefix = "lib+%s"|format(feature) %}
++ {% endif %}
+ %package {{ pkg }}
+ Summary: %{summary}
+ {% if rust_group is defined %}
+@@ -122,6 +134,9 @@ Requires: cargo
+ Requires: {{ req }}
+ {% endfor %}
+ {% endif %}
++ {% for req in
to_list(distconf.get("%s.requires"|format(conf_prefix)))|sort %}
++Requires: {{ req }}
++ {% endfor %}
+
+ %description {{ pkg }} %{_description}
+
+--
+2.19.1
+
diff --git a/0010-trivial-use-f-strings-everywhere.patch
b/0010-trivial-use-f-strings-everywhere.patch
new file mode 100644
index 0000000..3d8ca14
--- /dev/null
+++ b/0010-trivial-use-f-strings-everywhere.patch
@@ -0,0 +1,94 @@
+From 00ed1ce05d9dd4c8042f27ca959350ce34fb1be5 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Wed, 31 Oct 2018 17:00:58 +0100
+Subject: [PATCH 10/10] trivial: use f-strings everywhere
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ rust2rpm/__main__.py | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
+index 18fac5c..b4eb624 100644
+--- a/rust2rpm/__main__.py
++++ b/rust2rpm/__main__.py
+@@ -79,7 +79,7 @@ def detect_packager():
+ if git is not None:
+ name = subprocess.check_output([git, "config", "user.name"],
universal_newlines=True).strip()
+ email = subprocess.check_output([git, "config",
"user.email"], universal_newlines=True).strip()
+- return "{} <{}>".format(name, email)
++ return f"{name} <{email}>"
+
+ return None
+
+@@ -108,23 +108,23 @@ def local_crate(crate, version):
+ def download(crate, version):
+ if version is None:
+ # Now we need to get latest version
+- url = requests.compat.urljoin(API_URL,
"crates/{}/versions".format(crate))
++ url = requests.compat.urljoin(API_URL, f"crates/{crate}/versions")
+ req = requests.get(url)
+ req.raise_for_status()
+ versions = req.json()["versions"]
+ version = next(version["num"] for version in versions if not
version["yanked"])
+
+ os.makedirs(CACHEDIR, exist_ok=True)
+- cratef_base = "{}-{}.crate".format(crate, version)
++ cratef_base = f"{crate}-{version}.crate"
+ cratef = os.path.join(CACHEDIR, cratef_base)
+ if not os.path.isfile(cratef):
+- url = requests.compat.urljoin(API_URL,
"crates/{}/{}/download#".format(crate, version))
++ url = requests.compat.urljoin(API_URL,
f"crates/{crate}/{version}/download#")
+ req = requests.get(url, stream=True)
+ req.raise_for_status()
+ total = int(req.headers["Content-Length"])
+ with remove_on_error(cratef), \
+ open(cratef, "wb") as f:
+- for chunk in tqdm.tqdm(req.iter_content(), "Downloading
{}".format(cratef_base),
++ for chunk in tqdm.tqdm(req.iter_content(), f"Downloading
{cratef_base}".format(cratef_base),
+ total=total, unit="B", unit_scale=True):
+ f.write(chunk)
+ return cratef, crate, version
+@@ -132,14 +132,14 @@ def download(crate, version):
+ @contextlib.contextmanager
+ def toml_from_crate(cratef, crate, version):
+ with tempfile.TemporaryDirectory() as tmpdir:
+- target_dir = "{}/".format(tmpdir)
++ target_dir = f"{tmpdir}/"
+ with tarfile.open(cratef, "r") as archive:
+ for n in archive.getnames():
+ if not os.path.abspath(os.path.join(target_dir,
n)).startswith(target_dir):
+ raise Exception("Unsafe filenames!")
+ archive.extractall(target_dir)
+- toml_relpath = "{}-{}/Cargo.toml".format(crate, version)
+- toml = "{}/{}".format(tmpdir, toml_relpath)
++ toml_relpath = f"{crate}-{version}/Cargo.toml"
++ toml = f"{tmpdir}/{toml_relpath}"
+ if not os.path.isfile(toml):
+ raise IOError("crate does not contain Cargo.toml file")
+ yield toml
+@@ -270,7 +270,7 @@ def main():
+ kwargs["include_provides"] = True
+ kwargs["include_requires"] = True
+ else:
+- assert False, "Unknown target {!r}".format(args.target)
++ assert False, f"Unknown target {args.target!r}"
+
+ if args.target == "mageia":
+ kwargs["pkg_release"] = "%mkrel 1"
+@@ -303,10 +303,10 @@ def main():
+ spec_file = f"rust-{metadata.name}.spec"
+ spec_contents = template.render(md=metadata, patch_file=patch_file, **kwargs)
+ if args.stdout:
+- print("# {}".format(spec_file))
++ print(f"# {spec_file}")
+ print(spec_contents)
+ if patch_file is not None:
+- print("# {}".format(patch_file))
++ print(f"# {patch_file}")
+ print("".join(diff), end="")
+ else:
+ with open(spec_file, "w") as fobj:
+--
+2.19.1
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 21198c6..524b739 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -4,7 +4,7 @@
Name: rust-packaging
Version: 6
-Release: 14%{?dist}
+Release: 15%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -19,6 +19,8 @@ Patch0006: 0006-Throw-an-error-if-s-is-used-without-a-crate.patch
# Still in PR
Patch0007: 0007-split-features-into-subpackages.patch
Patch0008: 0008-add-support-for-dependencies-with-same-name.patch
+Patch0009: 0009-add-support-for-feeding-user-configuration.patch
+Patch0010: 0010-trivial-use-f-strings-everywhere.patch
BuildArch: noarch
ExclusiveArch: %{rust_arches} noarch
@@ -80,6 +82,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Fri Nov 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-15
+- Support .rust2rpm.conf
+
* Wed Oct 31 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-14
- Fix syntax error
commit a31cf1d2bad4be6805604ffb0230bf09d4f3f45f
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed Oct 31 11:40:04 2018 +0100
fix syntax error
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0008-add-support-for-dependencies-with-same-name.patch
b/0008-add-support-for-dependencies-with-same-name.patch
index 5d8af44..dbbad89 100644
--- a/0008-add-support-for-dependencies-with-same-name.patch
+++ b/0008-add-support-for-dependencies-with-same-name.patch
@@ -1,4 +1,4 @@
-From 6b5c116b0369a0a6c6ecb40c8bcc0974a36fa714 Mon Sep 17 00:00:00 2001
+From 129d556d19d2e41135f5e98ed028d7d00e66b524 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 30 Oct 2018 20:37:38 +0100
Subject: [PATCH 8/8] add support for dependencies with same name
@@ -11,7 +11,7 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
-index 119dea5..10c0011 100644
+index 119dea5..febf1e5 100644
--- a/rust2rpm/metadata.py
+++ b/rust2rpm/metadata.py
@@ -1,5 +1,6 @@
@@ -57,7 +57,7 @@ index 119dea5..10c0011 100644
- deps_by_feature[dep.name] = ({None}, {copy.deepcopy(dep)})
- else:
- mandatory_deps.add(copy.deepcopy(dep))
-+ for deps in deps_by_name.values():
++ for name, deps in deps_by_name.items():
+ fdeps = set()
+ for dep in deps:
+ if dep.optional:
diff --git a/rust-packaging.spec b/rust-packaging.spec
index c5bd19c..21198c6 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -4,7 +4,7 @@
Name: rust-packaging
Version: 6
-Release: 13%{?dist}
+Release: 14%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -80,6 +80,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Wed Oct 31 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-14
+- Fix syntax error
+
* Tue Oct 30 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-13
- Support multiple dependencies with same name
commit 7b23eaea0455f811e2ffad86346e9470612f9e8a
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue Oct 30 20:47:39 2018 +0100
support multiple dependencies with same name
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch
b/0001-name-spec-patch_file-by-real-crate-name.patch
index 7a14de3..27fbbfa 100644
--- a/0001-name-spec-patch_file-by-real-crate-name.patch
+++ b/0001-name-spec-patch_file-by-real-crate-name.patch
@@ -1,7 +1,7 @@
From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:37:40 +0200
-Subject: [PATCH 1/7] name spec/patch_file by real crate name
+Subject: [PATCH 1/8] name spec/patch_file by real crate name
When renaming using patch file, we really want to change file names too.
diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch
index 3bb4409..fb5ec59 100644
--- a/0002-generate-doc-statements.patch
+++ b/0002-generate-doc-statements.patch
@@ -1,7 +1,7 @@
From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 10 Sep 2018 23:40:18 +0200
-Subject: [PATCH 2/7] generate %doc statements
+Subject: [PATCH 2/8] generate %doc statements
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0003-do-better-for-renamed-crates.patch
b/0003-do-better-for-renamed-crates.patch
index a501e87..0c9c3fd 100644
--- a/0003-do-better-for-renamed-crates.patch
+++ b/0003-do-better-for-renamed-crates.patch
@@ -1,7 +1,7 @@
From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 00:06:50 +0200
-Subject: [PATCH 3/7] do better for renamed crates
+Subject: [PATCH 3/8] do better for renamed crates
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch
index 5e7848c..79d041d 100644
--- a/0004-remove-pre-3.6-leftovers.patch
+++ b/0004-remove-pre-3.6-leftovers.patch
@@ -1,7 +1,7 @@
From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 11 Sep 2018 10:43:53 +0200
-Subject: [PATCH 4/7] remove pre-3.6 leftovers
+Subject: [PATCH 4/8] remove pre-3.6 leftovers
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
---
diff --git a/0005-Remove-half-downloaded-crate-on-C.patch
b/0005-Remove-half-downloaded-crate-on-C.patch
index d822219..ef0eb21 100644
--- a/0005-Remove-half-downloaded-crate-on-C.patch
+++ b/0005-Remove-half-downloaded-crate-on-C.patch
@@ -1,7 +1,7 @@
From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:03:48 +0200
-Subject: [PATCH 5/7] Remove half-downloaded crate on ^C
+Subject: [PATCH 5/8] Remove half-downloaded crate on ^C
Subsequent invocations would fail with an error about a corrupted file.
We don't have support for resuming a failed download, so let's remove the
diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
index 44219dd..44bc5b1 100644
--- a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
+++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
@@ -1,7 +1,7 @@
From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
Date: Fri, 17 Aug 2018 10:18:59 +0200
-Subject: [PATCH 6/7] Throw an error if -s is used without a crate
+Subject: [PATCH 6/8] Throw an error if -s is used without a crate
In the future we might want to be smarter and find the crate, but let's at least
not ignore the option completely.
diff --git a/0007-split-features-into-subpackages.patch
b/0007-split-features-into-subpackages.patch
index 5455ccc..fe96334 100644
--- a/0007-split-features-into-subpackages.patch
+++ b/0007-split-features-into-subpackages.patch
@@ -1,7 +1,7 @@
-From a61a367883b7cd60f600d25958fb634c530500fa Mon Sep 17 00:00:00 2001
+From d7caa1148d5fcac70030e3fb1eb698927e69960f Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri, 26 Oct 2018 11:20:13 +0200
-Subject: [PATCH 7/7] split features into subpackages
+Subject: [PATCH 7/8] split features into subpackages
References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-fe...
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
@@ -11,8 +11,8 @@ Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
rust2rpm/__main__.py | 11 +-
rust2rpm/inspector.py | 22 ++-
rust2rpm/metadata.py | 315 +++++++++++++++++------------------
- rust2rpm/templates/main.spec | 141 ++++++++--------
- 6 files changed, 259 insertions(+), 244 deletions(-)
+ rust2rpm/templates/main.spec | 142 ++++++++--------
+ 6 files changed, 260 insertions(+), 244 deletions(-)
diff --git a/data/cargo.attr b/data/cargo.attr
index 392a72b..4910b5c 100644
@@ -512,10 +512,10 @@ index 5adeb65..119dea5 100644
+def normalize_deps(deps):
+ return set().union(*(d.normalize() for d in deps))
diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
-index 7dbcc3f..27a448f 100644
+index 7dbcc3f..0d9a80b 100644
--- a/rust2rpm/templates/main.spec
+++ b/rust2rpm/templates/main.spec
-@@ -48,82 +48,101 @@ Patch0: {{ patch_file }}
+@@ -48,82 +48,102 @@ Patch0: {{ patch_file }}
ExclusiveArch: %{rust_arches}
BuildRequires: rust-packaging
@@ -586,6 +586,7 @@ index 7dbcc3f..27a448f 100644
+ {% for bin in bins %}
+%{_bindir}/{{ bin.name }}
+ {% endfor %}
++
+{% endif -%}
+
{% if include_devel %}
@@ -666,7 +667,7 @@ index 7dbcc3f..27a448f 100644
%prep
{% if md.name != crate %}
%autosetup -n %{real_crate}-%{version} -p1
-@@ -143,29 +162,5 @@ which use %{crate} from crates.io.
+@@ -143,29 +163,5 @@ which use %{crate} from crates.io.
%cargo_test
%endif
diff --git a/0008-add-support-for-dependencies-with-same-name.patch
b/0008-add-support-for-dependencies-with-same-name.patch
new file mode 100644
index 0000000..5d8af44
--- /dev/null
+++ b/0008-add-support-for-dependencies-with-same-name.patch
@@ -0,0 +1,74 @@
+From 6b5c116b0369a0a6c6ecb40c8bcc0974a36fa714 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Tue, 30 Oct 2018 20:37:38 +0100
+Subject: [PATCH 8/8] add support for dependencies with same name
+
+Reported-by: Josh Stone <jistone(a)redhat.com>
+References:
https://internals.rust-lang.org/t/optional-dependencies-with-same-name/8728
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ rust2rpm/metadata.py | 32 ++++++++++++++++++++------------
+ 1 file changed, 20 insertions(+), 12 deletions(-)
+
+diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
+index 119dea5..10c0011 100644
+--- a/rust2rpm/metadata.py
++++ b/rust2rpm/metadata.py
+@@ -1,5 +1,6 @@
+ __all__ = ["Dependency", "Metadata"]
+
++import collections
+ import copy
+ import json
+ import subprocess
+@@ -124,9 +125,11 @@ class Metadata:
+ self.description = md.get("description")
+
+ # dependencies + build-dependencies runtime
+- deps_by_name = {dep["name"]: Dependency.from_json(dep)
+- for dep in md["dependencies"]
+- if dep["kind"] != "dev"}
++ deps_by_name = collections.defaultdict(list)
++ for dep in md["dependencies"]:
++ if dep["kind"] == "dev":
++ continue
++ deps_by_name[dep["name"]].append(Dependency.from_json(dep))
+
+ deps_by_feature = {}
+ for feature, f_deps in md["features"].items():
+@@ -137,18 +140,23 @@ class Metadata:
+ features.add(dep)
+ else:
+ pkg, _, f = dep.partition("/")
+- dep = copy.deepcopy(deps_by_name[pkg])
+- if f:
+- dep.features = {f}
+- deps.add(dep)
++ for dep in deps_by_name[pkg]:
++ dep = copy.deepcopy(dep)
++ if f:
++ dep.features = {f}
++ deps.add(dep)
+ deps_by_feature[feature] = (features, deps)
+
+ mandatory_deps = set()
+- for dep in deps_by_name.values():
+- if dep.optional:
+- deps_by_feature[dep.name] = ({None}, {copy.deepcopy(dep)})
+- else:
+- mandatory_deps.add(copy.deepcopy(dep))
++ for deps in deps_by_name.values():
++ fdeps = set()
++ for dep in deps:
++ if dep.optional:
++ fdeps.add(copy.deepcopy(dep))
++ else:
++ mandatory_deps.add(copy.deepcopy(dep))
++ if fdeps:
++ deps_by_feature[name] = ({None}, fdeps)
+ deps_by_feature[None] = (set(), mandatory_deps)
+
+ if "default" not in deps_by_feature:
+--
+2.19.1
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 157a08e..c5bd19c 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -4,7 +4,7 @@
Name: rust-packaging
Version: 6
-Release: 12%{?dist}
+Release: 13%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -18,6 +18,7 @@ Patch0005: 0005-Remove-half-downloaded-crate-on-C.patch
Patch0006: 0006-Throw-an-error-if-s-is-used-without-a-crate.patch
# Still in PR
Patch0007: 0007-split-features-into-subpackages.patch
+Patch0008: 0008-add-support-for-dependencies-with-same-name.patch
BuildArch: noarch
ExclusiveArch: %{rust_arches} noarch
@@ -79,6 +80,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Tue Oct 30 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-13
+- Support multiple dependencies with same name
+
* Sat Oct 27 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-12
- Fix requirements with space
commit 28d6d0d63a2ba1fc30449fb504ba7cdbe9bee3c2
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat Oct 27 12:57:42 2018 +0200
fix dependencies with space
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0007-split-features-into-subpackages.patch
b/0007-split-features-into-subpackages.patch
index 79909ab..5455ccc 100644
--- a/0007-split-features-into-subpackages.patch
+++ b/0007-split-features-into-subpackages.patch
@@ -1,4 +1,4 @@
-From 571ba6b1f2a886b40a7de76980cd8c479015cc9e Mon Sep 17 00:00:00 2001
+From a61a367883b7cd60f600d25958fb634c530500fa Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri, 26 Oct 2018 11:20:13 +0200
Subject: [PATCH 7/7] split features into subpackages
@@ -143,7 +143,7 @@ index 2d488b2..9e79e88 100644
if __name__ == "__main__":
main()
diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
-index 5adeb65..95aa142 100644
+index 5adeb65..119dea5 100644
--- a/rust2rpm/metadata.py
+++ b/rust2rpm/metadata.py
@@ -1,208 +1,205 @@
@@ -262,7 +262,7 @@ index 5adeb65..95aa142 100644
+ def _normalize_req(req):
+ if "*" in req:
+ return NotImplemented
-+ spec = semver.Spec(req)
++ spec = semver.Spec(req.replace(" ", ""))
+ reqs = []
for req in spec.specs:
- ver = req.spec
diff --git a/rust-packaging.spec b/rust-packaging.spec
index e206b06..157a08e 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -4,7 +4,7 @@
Name: rust-packaging
Version: 6
-Release: 11%{?dist}
+Release: 12%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -79,6 +79,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sat Oct 27 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-12
+- Fix requirements with space
+
* Fri Oct 26 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-11
- Trivial fixes to last patchset
commit c28b58679db5bd1910f1edc87c2c0c0231805cd4
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri Oct 26 20:57:20 2018 +0200
trivial fixes to last patchset
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0007-split-features-into-subpackages.patch
b/0007-split-features-into-subpackages.patch
index 58e5e8d..79909ab 100644
--- a/0007-split-features-into-subpackages.patch
+++ b/0007-split-features-into-subpackages.patch
@@ -1,4 +1,4 @@
-From 83a9b92d68e8c5d6f2ab75b287be7ea69275fb90 Mon Sep 17 00:00:00 2001
+From 571ba6b1f2a886b40a7de76980cd8c479015cc9e Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri, 26 Oct 2018 11:20:13 +0200
Subject: [PATCH 7/7] split features into subpackages
@@ -512,7 +512,7 @@ index 5adeb65..95aa142 100644
+def normalize_deps(deps):
+ return set().union(*(d.normalize() for d in deps))
diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
-index 7dbcc3f..4acfab7 100644
+index 7dbcc3f..27a448f 100644
--- a/rust2rpm/templates/main.spec
+++ b/rust2rpm/templates/main.spec
@@ -48,82 +48,101 @@ Patch0: {{ patch_file }}
@@ -613,7 +613,7 @@ index 7dbcc3f..4acfab7 100644
-{% endif %}
-{% if include_requires %}
+ {% if include_provides %}
-+Provides: {{ md.provides() }}
++Provides: {{ md.provides(feature) }}
+ {% endif %}
+ {% if include_requires %}
Requires: cargo
@@ -644,7 +644,7 @@ index 7dbcc3f..4acfab7 100644
This package contains library source intended for building other packages
-which use %{crate} from crates.io.
-+which use {% if feature is not none %}"{{ feature }}" of {% endif
%}"%{crate}" crate.
++which use {% if feature is not none %}"{{ feature }}" feature of {% endif
%}"%{crate}" crate.
+
+%files {{ pkg }}
+ {% if feature is none %}
diff --git a/rust-packaging.spec b/rust-packaging.spec
index a7ba418..e206b06 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -4,7 +4,7 @@
Name: rust-packaging
Version: 6
-Release: 10%{?dist}
+Release: 11%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -79,6 +79,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Fri Oct 26 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-11
+- Trivial fixes to last patchset
+
* Fri Oct 26 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-10
- Split features into subpackages
commit 0cf7c3e18ab067d1fc0a7d37e901914c64b48d1e
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri Oct 26 15:59:03 2018 +0200
split features into subpackages
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-name-spec-patch_file-by-real-crate-name.patch
b/0001-name-spec-patch_file-by-real-crate-name.patch
new file mode 100644
index 0000000..7a14de3
--- /dev/null
+++ b/0001-name-spec-patch_file-by-real-crate-name.patch
@@ -0,0 +1,37 @@
+From 0dc9fc182edf0791ca697f587e48dd39948d63c1 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Mon, 10 Sep 2018 23:37:40 +0200
+Subject: [PATCH 1/7] name spec/patch_file by real crate name
+
+When renaming using patch file, we really want to change file names too.
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ rust2rpm/__main__.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
+index dc78828..1575ce6 100644
+--- a/rust2rpm/__main__.py
++++ b/rust2rpm/__main__.py
+@@ -218,7 +218,7 @@ def main():
+ template = JINJA_ENV.get_template("main.spec")
+
+ if args.patch and len(diff) > 0:
+- patch_file = "{}-fix-metadata.diff".format(crate)
++ patch_file = "{}-fix-metadata.diff".format(metadata.name)
+ else:
+ patch_file = None
+
+@@ -269,7 +269,7 @@ def main():
+ kwargs["license"] = license
+ kwargs["license_comments"] = comments
+
+- spec_file = "rust-{}.spec".format(crate)
++ spec_file = "rust-{}.spec".format(metadata.name)
+ spec_contents = template.render(md=metadata, patch_file=patch_file, **kwargs)
+ if args.stdout:
+ print("# {}".format(spec_file))
+--
+2.19.1
+
diff --git a/0002-generate-doc-statements.patch b/0002-generate-doc-statements.patch
new file mode 100644
index 0000000..3bb4409
--- /dev/null
+++ b/0002-generate-doc-statements.patch
@@ -0,0 +1,58 @@
+From 561280a0ea35f226ef243526be2bbb656db44af6 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Mon, 10 Sep 2018 23:40:18 +0200
+Subject: [PATCH 2/7] generate %doc statements
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ rust2rpm/metadata.py | 2 ++
+ rust2rpm/templates/main.spec | 6 ++++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
+index 5dae1d3..f52d968 100644
+--- a/rust2rpm/metadata.py
++++ b/rust2rpm/metadata.py
+@@ -140,6 +140,7 @@ class Metadata(object):
+ self.name = None
+ self.license = None
+ self.license_file = None
++ self.readme = None
+ self.description = None
+ self.version = None
+ self._targets = []
+@@ -156,6 +157,7 @@ class Metadata(object):
+ self.name = md["name"]
+ self.license = md["license"]
+ self.license_file = md["license_file"]
++ self.readme = md["readme"]
+ self.description = md.get("description")
+ self.version = md["version"]
+ version = "={}".format(self.version)
+diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
+index 1aeb969..2e9f841 100644
+--- a/rust2rpm/templates/main.spec
++++ b/rust2rpm/templates/main.spec
+@@ -137,6 +137,9 @@ which use %{crate} from crates.io.
+ {% if md.license_file is not none %}
+ %license {{ md.license_file }}
+ {% endif %}
++{% if md.readme is not none %}
++%doc {{ md.readme }}
++{% endif %}
+ {% for bin in bins %}
+ %{_bindir}/{{ bin.name }}
+ {% endfor %}
+@@ -147,6 +150,9 @@ which use %{crate} from crates.io.
+ {% if md.license_file is not none %}
+ %license {{ md.license_file }}
+ {% endif %}
++{% if md.readme is not none %}
++%doc {{ md.readme }}
++{% endif %}
+ %{cargo_registry}/%{crate}-%{version}/
+
+ {% endif %}
+--
+2.19.1
+
diff --git a/0003-do-better-for-renamed-crates.patch
b/0003-do-better-for-renamed-crates.patch
new file mode 100644
index 0000000..a501e87
--- /dev/null
+++ b/0003-do-better-for-renamed-crates.patch
@@ -0,0 +1,90 @@
+From 2050880140d4953b9ebdc7211e30df3ccf5dd61d Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Tue, 11 Sep 2018 00:06:50 +0200
+Subject: [PATCH 3/7] do better for renamed crates
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ rust2rpm/__main__.py | 7 ++++---
+ rust2rpm/templates/main.spec | 13 ++++++++++++-
+ 2 files changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
+index 1575ce6..e993e7b 100644
+--- a/rust2rpm/__main__.py
++++ b/rust2rpm/__main__.py
+@@ -180,7 +180,7 @@ def make_diff_metadata(crate, version, patch=False, store=False):
+ diff = make_patch(toml, enabled=patch)
+ metadata = Metadata.from_file(toml)
+ if store:
+- shutil.copy2(cratef, os.path.join(os.getcwd(),
f"{crate}-{version}.crate"))
++ shutil.copy2(cratef, os.path.join(os.getcwd(),
f"{metadata.name}-{version}.crate"))
+ return crate, diff, metadata
+
+ def main():
+@@ -218,11 +218,12 @@ def main():
+ template = JINJA_ENV.get_template("main.spec")
+
+ if args.patch and len(diff) > 0:
+- patch_file = "{}-fix-metadata.diff".format(metadata.name)
++ patch_file = f"{metadata.name}-fix-metadata.diff"
+ else:
+ patch_file = None
+
+ kwargs = {}
++ kwargs["crate"] = crate
+ kwargs["target"] = args.target
+ bins = [tgt for tgt in metadata.targets if tgt.kind == "bin"]
+ libs = [tgt for tgt in metadata.targets if tgt.kind in ("lib",
"rlib", "proc-macro")]
+@@ -269,7 +270,7 @@ def main():
+ kwargs["license"] = license
+ kwargs["license_comments"] = comments
+
+- spec_file = "rust-{}.spec".format(metadata.name)
++ spec_file = f"rust-{metadata.name}.spec"
+ spec_contents = template.render(md=metadata, patch_file=patch_file, **kwargs)
+ if args.stdout:
+ print("# {}".format(spec_file))
+diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
+index 2e9f841..7dbcc3f 100644
+--- a/rust2rpm/templates/main.spec
++++ b/rust2rpm/templates/main.spec
+@@ -6,6 +6,9 @@
+ {% endif %}
+
+ %global crate {{ md.name }}
++{% if md.name != crate %}
++%global real_crate {{ crate }}
++{% endif %}
+
+ Name: rust-%{crate}
+ Version: {{ md.version }}
+@@ -27,8 +30,12 @@ License: {{ license|default("# FIXME") }}
+ {% if license_comments is not none %}
+ {{ license_comments }}
+ {% endif %}
+-URL:
https://crates.io/crates/{{ md.name }}
++URL:
https://crates.io/crates/{{ crate }}
++{% if md.name != crate %}
++Source0:
https://crates.io/api/v1/crates/%{real_crate}/%{version}/download#/%{crat...
++{% else %}
+ Source0:
https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{...
++{% endif %}
+ {% if patch_file is not none %}
+ {% if target == "opensuse" %}
+ # PATCH-FIX-OPENSUSE {{ patch_file }} -- Initial patched metadata
+@@ -118,7 +125,11 @@ which use %{crate} from crates.io.
+
+ {% endif %}
+ %prep
++{% if md.name != crate %}
++%autosetup -n %{real_crate}-%{version} -p1
++{% else %}
+ %autosetup -n %{crate}-%{version} -p1
++{% endif %}
+ %cargo_prep
+
+ %build
+--
+2.19.1
+
diff --git a/0004-remove-pre-3.6-leftovers.patch b/0004-remove-pre-3.6-leftovers.patch
new file mode 100644
index 0000000..5e7848c
--- /dev/null
+++ b/0004-remove-pre-3.6-leftovers.patch
@@ -0,0 +1,27 @@
+From e6e9cbbb71199c2773b47fa21f1c917a167c1743 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Tue, 11 Sep 2018 10:43:53 +0200
+Subject: [PATCH 4/7] remove pre-3.6 leftovers
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ rust2rpm/metadata.py | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
+index f52d968..5adeb65 100644
+--- a/rust2rpm/metadata.py
++++ b/rust2rpm/metadata.py
+@@ -203,8 +203,6 @@ class Metadata(object):
+
+ @classmethod
+ def from_file(cls, path):
+- do_decode = sys.version_info < (3, 6)
+ metadata = subprocess.check_output(["cargo",
"read-manifest",
+-
"--manifest-path={}".format(path)],
+- universal_newlines=do_decode)
++
"--manifest-path={}".format(path)])
+ return cls.from_json(json.loads(metadata))
+--
+2.19.1
+
diff --git a/0005-Remove-half-downloaded-crate-on-C.patch
b/0005-Remove-half-downloaded-crate-on-C.patch
new file mode 100644
index 0000000..d822219
--- /dev/null
+++ b/0005-Remove-half-downloaded-crate-on-C.patch
@@ -0,0 +1,44 @@
+From 2f12c83d14afe71e9efed2d1be62e1e610e602e9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
+Date: Fri, 17 Aug 2018 10:03:48 +0200
+Subject: [PATCH 5/7] Remove half-downloaded crate on ^C
+
+Subsequent invocations would fail with an error about a corrupted file.
+We don't have support for resuming a failed download, so let's remove the
+partial download results.
+---
+ rust2rpm/__main__.py | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
+index e993e7b..8e6f6eb 100644
+--- a/rust2rpm/__main__.py
++++ b/rust2rpm/__main__.py
+@@ -83,6 +83,14 @@ def file_mtime(path):
+ t = datetime.fromtimestamp(os.stat(path).st_mtime, timezone.utc)
+ return t.astimezone().isoformat()
+
++(a)contextlib.contextmanager
++def remove_on_error(path):
++ try:
++ yield
++ except: # this is supposed to include ^C
++ os.unlink(path)
++ raise
++
+ def local_toml(toml, version):
+ if os.path.isdir(toml):
+ toml = os.path.join(toml, "Cargo.toml")
+@@ -110,7 +118,8 @@ def download(crate, version):
+ req = requests.get(url, stream=True)
+ req.raise_for_status()
+ total = int(req.headers["Content-Length"])
+- with open(cratef, "wb") as f:
++ with remove_on_error(cratef), \
++ open(cratef, "wb") as f:
+ for chunk in tqdm.tqdm(req.iter_content(), "Downloading
{}".format(cratef_base),
+ total=total, unit="B", unit_scale=True):
+ f.write(chunk)
+--
+2.19.1
+
diff --git a/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
new file mode 100644
index 0000000..44219dd
--- /dev/null
+++ b/0006-Throw-an-error-if-s-is-used-without-a-crate.patch
@@ -0,0 +1,28 @@
+From 5a1cde5b8dcaea74ebb2050879036bf46df63adc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek(a)in.waw.pl>
+Date: Fri, 17 Aug 2018 10:18:59 +0200
+Subject: [PATCH 6/7] Throw an error if -s is used without a crate
+
+In the future we might want to be smarter and find the crate, but let's at least
+not ignore the option completely.
+---
+ rust2rpm/__main__.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
+index 8e6f6eb..f23ebbc 100644
+--- a/rust2rpm/__main__.py
++++ b/rust2rpm/__main__.py
+@@ -178,6 +178,9 @@ def make_diff_metadata(crate, version, patch=False, store=False):
+ if crate.endswith(".crate"):
+ cratef, crate, version = local_crate(crate, version)
+ else:
++ if store:
++ raise ValueError('--store-crate can only be used for a crate')
++
+ toml, crate, version = local_toml(crate, version)
+ diff = make_patch(toml, enabled=patch, tmpfile=True)
+ metadata = Metadata.from_file(toml)
+--
+2.19.1
+
diff --git a/0007-split-features-into-subpackages.patch
b/0007-split-features-into-subpackages.patch
new file mode 100644
index 0000000..58e5e8d
--- /dev/null
+++ b/0007-split-features-into-subpackages.patch
@@ -0,0 +1,701 @@
+From 83a9b92d68e8c5d6f2ab75b287be7ea69275fb90 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Fri, 26 Oct 2018 11:20:13 +0200
+Subject: [PATCH 7/7] split features into subpackages
+
+References:
https://discussion.fedoraproject.org/t/rfc-new-crates-packaging-design-fe...
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ data/cargo.attr | 4 +-
+ data/macros.cargo | 10 ++
+ rust2rpm/__main__.py | 11 +-
+ rust2rpm/inspector.py | 22 ++-
+ rust2rpm/metadata.py | 315 +++++++++++++++++------------------
+ rust2rpm/templates/main.spec | 141 ++++++++--------
+ 6 files changed, 259 insertions(+), 244 deletions(-)
+
+diff --git a/data/cargo.attr b/data/cargo.attr
+index 392a72b..4910b5c 100644
+--- a/data/cargo.attr
++++ b/data/cargo.attr
+@@ -1,3 +1,3 @@
+-%__cargo_provides %{_bindir}/cargo-inspector --provides
+-%__cargo_requires %{_bindir}/cargo-inspector --requires
++%__cargo_provides %{_bindir}/cargo-inspector --provides
--feature=%{__cargo_feature_from_name -n %{name}}
++%__cargo_requires %{_bindir}/cargo-inspector --requires
--feature=%{__cargo_feature_from_name -n %{name}}
+ %__cargo_path ^%{cargo_registry}/[^/]+/Cargo\\.toml$
+diff --git a/data/macros.cargo b/data/macros.cargo
+index a0c456a..7fb025b 100644
+--- a/data/macros.cargo
++++ b/data/macros.cargo
+@@ -84,3 +84,13 @@ if %__cargo_is_bin; then \
+ %{__rm} %{buildroot}%{_prefix}/.crates.toml \
+ fi \
+ )
++
++%__cargo_feature_from_name(n:) %{lua:
++local name = rpm.expand("%{-n*}")
++local feature = string.match(name, "^.+%+(.+)-devel$")
++if feature == nil then
++ print()
++else
++ print(feature)
++end
++}
+diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
+index f23ebbc..d19cb47 100644
+--- a/rust2rpm/__main__.py
++++ b/rust2rpm/__main__.py
+@@ -18,15 +18,19 @@ import requests
+ import tqdm
+
+ from . import Metadata, licensing
++from .metadata import normalize_deps
+
+ DEFAULT_EDITOR = "vi"
+ XDG_CACHE_HOME = os.getenv("XDG_CACHE_HOME",
os.path.expanduser("~/.cache"))
+ CACHEDIR = os.path.join(XDG_CACHE_HOME, "rust2rpm")
+ API_URL = "https://crates.io/api/v1/"
+ JINJA_ENV = jinja2.Environment(loader=jinja2.ChoiceLoader([
+- jinja2.FileSystemLoader(["/"]),
+- jinja2.PackageLoader("rust2rpm",
"templates"), ]),
+- trim_blocks=True, lstrip_blocks=True)
++ jinja2.FileSystemLoader(["/"]),
++ jinja2.PackageLoader("rust2rpm",
"templates"),
++ ]),
++ extensions=["jinja2.ext.do"],
++ trim_blocks=True,
++ lstrip_blocks=True)
+
+ def get_default_target():
+ # TODO: add fallback for /usr/lib/os-release
+@@ -227,6 +231,7 @@ def main():
+ patch=args.patch,
+ store=args.store_crate)
+
++ JINJA_ENV.globals["normalize_deps"] = normalize_deps
+ template = JINJA_ENV.get_template("main.spec")
+
+ if args.patch and len(diff) > 0:
+diff --git a/rust2rpm/inspector.py b/rust2rpm/inspector.py
+index 2d488b2..9e79e88 100644
+--- a/rust2rpm/inspector.py
++++ b/rust2rpm/inspector.py
+@@ -1,8 +1,8 @@
+ import argparse
+-import itertools
+ import sys
+
+ from . import Metadata
++from .metadata import normalize_deps
+
+ def main():
+ parser = argparse.ArgumentParser()
+@@ -10,18 +10,23 @@ def main():
+ group.add_argument("-n", "--name",
action="store_true", help="Print name")
+ group.add_argument("-v", "--version",
action="store_true", help="Print version")
+ group.add_argument("-t", "--target-kinds",
action="store_true", help="Print target kinds")
++ group.add_argument("-l", "--list-features",
action="store_true", help="Print features")
+ group.add_argument("-P", "--provides",
action="store_true", help="Print Provides")
+ group.add_argument("-R", "--requires",
action="store_true", help="Print Requires")
+ group.add_argument("-BR", "--build-requires",
action="store_true", help="Print BuildRequires")
+ group.add_argument("-TR", "--test-requires",
action="store_true", help="Print TestRequires")
++ parser.add_argument("-f", "--feature", help="Feature to
work on")
+ parser.add_argument("file", nargs="*", help="Path(s) to
Cargo.toml")
+ args = parser.parse_args()
+
+ files = args.file or sys.stdin.readlines()
+
++ if not args.feature:
++ args.feature = None
++
+ def print_deps(deps):
+ if len(deps) > 0:
+- print("\n".join(str(dep) for dep in deps))
++ print("\n".join(sorted(normalize_deps(deps))))
+
+ for f in files:
+ f = f.rstrip()
+@@ -32,17 +37,20 @@ def main():
+ print(md.version)
+ if args.target_kinds:
+ print("\n".join(set(tgt.kind for tgt in md.targets)))
++ if args.list_features:
++ for f in sorted(f for f in md.dependencies if f is not None):
++ print(f)
+ if args.provides:
+- print_deps(md.provides)
+- if args.requires or args.build_requires:
+- print_deps(list(itertools.chain(md.requires, md.build_requires)))
+- if args.test_requires:
+- print_deps(md.test_requires)
++ print(md.provides(args.feature))
+ if args.requires:
+ # Someone should own /usr/share/cargo/registry
+ print("cargo")
++ print_deps(md.requires(args.feature))
+ if args.build_requires:
+ print("rust-packaging")
++ print_deps(md.requires(args.feature or "default", resolve=True))
++ if args.test_requires:
++ print_deps(md.dev_dependencies)
+
+ if __name__ == "__main__":
+ main()
+diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
+index 5adeb65..95aa142 100644
+--- a/rust2rpm/metadata.py
++++ b/rust2rpm/metadata.py
+@@ -1,208 +1,205 @@
+ __all__ = ["Dependency", "Metadata"]
+
+-import itertools
++import copy
+ import json
+ import subprocess
+-import sys
+
+ import semantic_version as semver
+ import rustcfg
+
+-class Target(object):
+- def __init__(self, kind, name):
+- self.kind = kind
++class Target:
++ def __init__(self, name, kind):
+ self.name = name
++ self.kind = kind
+
+ def __repr__(self):
+- return "<Target {self.kind}|{self.name}>".format(self=self)
+-
+-
+-def _req_to_str(name, spec=None, feature=None):
+- f_part = "/{}".format(feature) if feature is not None else ""
+- basestr = "crate({}{})".format(name, f_part)
+- if spec is None:
+- return basestr
+- if spec.kind == spec.KIND_EQUAL:
+- spec.kind = spec.KIND_SHORTEQ
+- if spec.kind == spec.KIND_ANY:
+- if spec.spec == "":
+- # Just wildcard
+- return basestr
+- else:
+- # Wildcard in string
+- assert False, spec.spec
+- version = str(spec.spec).replace("-", "~")
+- return "{} {} {}".format(basestr, spec.kind, version)
++ return f"<Target {self.name} ({self.kind})>"
+
+-class Dependency(object):
+- def __init__(self, name, req, features=(), provides=False):
++class Dependency:
++ def __init__(self, name, req=None, features=(), optional=False):
+ self.name = name
+- self.spec = self._parse_req(req)
++ self.req = req
+ self.features = features
+- self.provides = provides
+- if self.provides:
+- if len(self.spec.specs) > 1 or \
+- (len(self.spec.specs) == 1 and self.spec.specs[0].kind !=
self.spec.specs[0].KIND_EQUAL):
+- raise Exception("Provides can't be applied to ranged version,
{!r}".format(self.spec))
+-
+- def __repr__(self):
+- if self.provides:
+- spec = self.spec.specs[0]
+- provs = [_req_to_str(self.name, spec)]
+- for feature in self.features:
+- provs.append(_req_to_str(self.name, spec, feature))
+- return " and ".join(provs)
+-
+- reqs = [_req_to_str(self.name, spec=req) for req in self.spec.specs]
+- features = [_req_to_str(self.name, feature=feature) for feature in
self.features]
++ self.optional = optional
+
+- use_rich = False
+- if len(reqs) > 1:
+- reqstr = "({})".format(" with ".join(reqs))
+- use_rich = True
+- elif len(reqs) == 1:
+- reqstr = reqs[0]
+- else:
+- reqstr = ""
+- if len(features) > 0:
+- featurestr = " with ".join(features)
+- use_rich = True
+- else:
+- featurestr = ""
+-
+- if use_rich:
+- if reqstr and featurestr:
+- return "({} with {})".format(reqstr, featurestr)
+- elif reqstr and not featurestr:
+- return reqstr
+- elif not reqstr and featurestr:
+- return "({})".format(featurestr)
+- else:
+- assert False
+- else:
+- return reqstr
++ @classmethod
++ def from_json(cls, metadata):
++ features = set(metadata['features'])
++ if metadata['uses_default_features']:
++ features.add('default')
++ kwargs = {'name': metadata['name'],
++ 'req': metadata['req'],
++ 'optional': metadata['optional'],
++ 'features': features}
++ return cls(**kwargs)
+
+ @staticmethod
+- def _parse_req(s):
+- if "*" in s and s != "*":
+- # XXX:
https://github.com/rbarrois/python-semanticversion/issues/51
+- s = "~{}".format(s.replace(".*", "", 1))
+- if ".*" in s:
+- s = s.replace(".*", "")
+- spec = semver.Spec(s.replace(" ", ""))
+- parsed = []
++ def _normalize_req(req):
++ if "*" in req:
++ return NotImplemented
++ spec = semver.Spec(req)
++ reqs = []
+ for req in spec.specs:
+- ver = req.spec
+ if req.kind == req.KIND_ANY:
+- parsed.append("*")
++ # Any means any
+ continue
++ ver = req.spec
++ if ver.prerelease or req.kind in (req.KIND_NEQ, req.KIND_EMPTY):
++ return NotImplemented
+ coerced = semver.Version.coerce(str(ver))
+- if req.kind in (req.KIND_CARET, req.KIND_TILDE):
+- if ver.prerelease:
+- # pre-release versions only match the same x.y.z
+- if ver.patch is not None:
+- upper = ver.next_patch()
+- elif ver.minor is not None:
+- upper = ver.next_minor()
+- else:
+- upper = ver.next_major()
+- elif req.kind == req.KIND_CARET:
+- if ver.major == 0:
+- if ver.minor is not None:
+- if ver.patch is None or ver.minor != 0:
+- upper = ver.next_minor()
+- else:
+- upper = ver.next_patch()
++ if req.kind == req.KIND_EQUAL:
++ req.kind = req.KIND_SHORTEQ
++ if req.kind in (req.KIND_CARET, req.KIND_COMPATIBLE):
++ if ver.major == 0:
++ if ver.minor is not None:
++ if ver.minor != 0 or ver.patch is None:
++ upper = ver.next_minor()
+ else:
+- upper = ver.next_major()
++ upper = ver.next_patch()
+ else:
+ upper = ver.next_major()
+- elif req.kind == req.KIND_TILDE:
+- if ver.minor is None:
+- upper = ver.next_major()
+- else:
+- upper = ver.next_minor()
+ else:
+- assert False
+- parsed.append(">={}".format(coerced))
+- parsed.append("<{}".format(upper))
+- elif req.kind == req.KIND_NEQ:
+- parsed.append(">{}".format(coerced))
+- parsed.append("<{}".format(coerced))
+- elif req.kind in (req.KIND_EQUAL, req.KIND_GT, req.KIND_GTE, req.KIND_LT,
req.KIND_LTE):
+- parsed.append("{}{}".format(req.kind, coerced))
++ upper = ver.next_major()
++ reqs.append((">=", coerced))
++ reqs.append(("<", upper))
++ elif req.kind == req.KIND_TILDE:
++ if ver.minor is None:
++ upper = ver.next_major()
++ else:
++ upper = ver.next_minor()
++ reqs.append((">=", coerced))
++ reqs.append(("<", upper))
++ elif req.kind in (req.KIND_SHORTEQ,
++ req.KIND_GT,
++ req.KIND_GTE,
++ req.KIND_LT,
++ req.KIND_LTE):
++ reqs.append((str(req.kind), coerced))
+ else:
+- assert False, req.kind
+- return semver.Spec(",".join(parsed))
++ raise AssertionError(f"Found unhandled kind: {req.kind}")
++ return reqs
+
+-class Metadata(object):
+- def __init__(self):
+- self.name = None
++ @staticmethod
++ def _apply_reqs(name, reqs, feature=None):
++ fstr = f"/{feature}" if feature is not None else ""
++ cap = f"crate({name}{fstr})"
++ if not reqs:
++ return cap
++ deps = " with ".join(f"{cap} {op} {version}" for op, version
in reqs)
++ if len(reqs) > 1:
++ return f"({deps})"
++ else:
++ return deps
++
++ def normalize(self):
++ return [self._apply_reqs(self.name, self._normalize_req(self.req), feature)
++ for feature in self.features or (None,)]
++
++ def __repr__(self):
++ return f"<Dependency: {self.name} {self.req} ({',
'.join(sorted(self.features))})>"
++
++ def __str__(self):
++ return "\n".join(self.normalize())
++
++class Metadata:
++ def __init__(self, name, version):
++ self.name = name
++ self.version = version
+ self.license = None
+ self.license_file = None
+ self.readme = None
+ self.description = None
+- self.version = None
+- self._targets = []
+- self.provides = []
+- self.requires = []
+- self.build_requires = []
+- self.test_requires = []
++ self.targets = set()
++ self.dependencies = {}
++ self.dev_dependencies = set()
+
+ @classmethod
+ def from_json(cls, metadata):
+- self = cls()
+-
+ md = metadata
+- self.name = md["name"]
++ self = cls(md["name"], md["version"])
++
+ self.license = md["license"]
+ self.license_file = md["license_file"]
+ self.readme = md["readme"]
+ self.description = md.get("description")
+- self.version = md["version"]
+- version = "={}".format(self.version)
+-
+- # Targets
+- self.targets = [Target(tgt["kind"][0], tgt["name"]) for tgt
in md["targets"]]
+-
+- # Provides
+- # All optional dependencies are also features
+- #
https://github.com/rust-lang/cargo/issues/4911
+- features = itertools.chain((x["name"] for x in
md["dependencies"] if x["optional"]),
+- md["features"])
+- provides = Dependency(self.name, version, features=features, provides=True)
+- self.provides = str(provides).split(" and ")
+-
+- ev = rustcfg.Evaluator.platform()
+-
+- # Dependencies
+- for dep in md["dependencies"]:
+- kind = dep["kind"]
+- if kind is None:
+- requires = self.requires
+- elif kind == "build":
+- requires = self.build_requires
+- elif kind == "dev":
+- requires = self.test_requires
+- else:
+- raise ValueError("Unknown kind: {!r}, please report
bug.".format(kind))
+
+- target = dep["target"]
+- if target is None:
+- pass
++ # dependencies + build-dependencies runtime
++ deps_by_name = {dep["name"]: Dependency.from_json(dep)
++ for dep in md["dependencies"]
++ if dep["kind"] != "dev"}
++
++ deps_by_feature = {}
++ for feature, f_deps in md["features"].items():
++ features = {None}
++ deps = set()
++ for dep in f_deps:
++ if dep in md["features"]:
++ features.add(dep)
++ else:
++ pkg, _, f = dep.partition("/")
++ dep = copy.deepcopy(deps_by_name[pkg])
++ if f:
++ dep.features = {f}
++ deps.add(dep)
++ deps_by_feature[feature] = (features, deps)
++
++ mandatory_deps = set()
++ for dep in deps_by_name.values():
++ if dep.optional:
++ deps_by_feature[dep.name] = ({None}, {copy.deepcopy(dep)})
+ else:
+- cond = ev.parse_and_eval(target)
+- if not cond:
+- print(f'Dependency {dep["name"]} for target {target!r}
is not needed, ignoring.',
+- file=sys.stderr)
+- continue
++ mandatory_deps.add(copy.deepcopy(dep))
++ deps_by_feature[None] = (set(), mandatory_deps)
++
++ if "default" not in deps_by_feature:
++ deps_by_feature["default"] = ({None}, set())
+
+- requires.append(Dependency(dep["name"], dep["req"],
features=dep["features"]))
++ self.dependencies = deps_by_feature
++ self.dev_dependencies = {Dependency.from_json(dep)
++ for dep in md["dependencies"]
++ if dep["kind"] == "dev"}
++
++ self.targets = {Target(tgt["name"], tgt["kind"][0])
++ for tgt in md["targets"]}
+
+ return self
+
+ @classmethod
+ def from_file(cls, path):
+ metadata = subprocess.check_output(["cargo",
"read-manifest",
+-
"--manifest-path={}".format(path)])
++ f"--manifest-path={path}"])
+ return cls.from_json(json.loads(metadata))
++
++ @property
++ def all_dependencies(self):
++ return set().union(*(x[1] for x in self.dependencies.values()))
++
++ def provides(self, feature=None):
++ if feature not in self.dependencies:
++ raise KeyError(f"Feature {feature!r} doesn't exist")
++ return Dependency(self.name, f"={self.version}", features={feature})
++
++ @classmethod
++ def _resolve(cls, deps_by_feature, feature):
++ all_features = set()
++ all_deps = set()
++ ff, dd = copy.deepcopy(deps_by_feature[feature])
++ all_features |= ff
++ all_deps |= dd
++ for f in ff:
++ ff1, dd1 = cls._resolve(deps_by_feature, f)
++ all_features |= ff1
++ all_deps |= dd1
++ return all_features, all_deps
++
++ def requires(self, feature=None, resolve=False):
++ if resolve:
++ return self._resolve(self.dependencies, feature)[1]
++ else:
++ features, deps = self.dependencies[feature]
++ fdeps = set(Dependency(self.name, f"={self.version}",
features={feature})
++ for feature in features)
++ return fdeps | deps
++
++def normalize_deps(deps):
++ return set().union(*(d.normalize() for d in deps))
+diff --git a/rust2rpm/templates/main.spec b/rust2rpm/templates/main.spec
+index 7dbcc3f..4acfab7 100644
+--- a/rust2rpm/templates/main.spec
++++ b/rust2rpm/templates/main.spec
+@@ -48,82 +48,101 @@ Patch0: {{ patch_file }}
+ ExclusiveArch: %{rust_arches}
+
+ BuildRequires: rust-packaging
+-{% if include_build_requires %}
+-{% if md.requires|length > 0 %}
+-# [dependencies]
+-{% for req in md.requires|sort(attribute="name") %}
++{# We will put all non-optional and optional dependencies until
++
https://github.com/rust-lang/cargo/issues/5133
++ is solved
++{% set buildrequires = normalize_deps(md.requires("default",
resolve=True))|sort %}
++#}
++{% set buildrequires = normalize_deps(md.all_dependencies)|sort %}
++{% for req in buildrequires %}
+ BuildRequires: {{ req }}
+ {% endfor %}
+-{% endif %}
+-{% if md.build_requires|length > 0 %}
+-# [build-dependencies]
+-{% for req in md.build_requires|sort(attribute="name") %}
+-BuildRequires: {{ req }}
+-{% endfor %}
+-{% endif %}
+-{% if md.test_requires|length > 0 %}
++{% set testrequires = normalize_deps(md.dev_dependencies)|sort %}
++{% if testrequires|length > 0 %}
+ %if %{with check}
+-# [dev-dependencies]
+-{% for req in md.test_requires|sort(attribute="name") %}
++ {% for req in testrequires %}
+ BuildRequires: {{ req }}
+-{% endfor %}
++ {% endfor %}
+ %endif
+ {% endif %}
+-{% endif %}
+
+-%description
++%global _description \
++{% if md.description is none %}
+ %{summary}.
++{% else %}
++{{ md.description|wordwrap(wrapstring="\\\n")|trim }}
++{% endif %}
++
++%description %{_description}
+
+ {% if include_main %}
+ %package -n %{crate}
+ Summary: %{summary}
+-{% if rust_group is defined %}
++ {% if rust_group is defined %}
+ Group: # FIXME
+-{% endif %}
++ {% endif %}
+
+ %description -n %{crate}
+ %{summary}.
+
+-{% endif %}
++%files -n %{crate}
++ {% if md.license_file is not none %}
++%license {{ md.license_file }}
++ {% endif %}
++ {% if md.readme is not none %}
++%doc {{ md.readme }}
++ {% endif %}
++ {% for bin in bins %}
++%{_bindir}/{{ bin.name }}
++ {% endfor %}
++{% endif -%}
++
+ {% if include_devel %}
+-%package devel
++ {% set features = md.dependencies.keys()|list %}
++ {% do features.remove(None) %}
++ {% do features.remove("default") %}
++ {% set features = features|sort %}
++ {% do features.insert(0, None) %}
++ {% do features.insert(1, "default") %}
++ {% for feature in features %}
++ {% set pkg = "-n %%{name}+%s-devel"|format(feature) if feature is not none
else " devel" %}
++%package {{ pkg }}
+ Summary: %{summary}
+-{% if rust_group is defined %}
++ {% if rust_group is defined %}
+ Group: {{ rust_group }}
+-{% endif %}
++ {% endif %}
+ BuildArch: noarch
+-{% if include_provides %}
+-{% for prv in md.provides %}
+-Provides: {{ prv }}
+-{% endfor %}
+-{% endif %}
+-{% if include_requires %}
++ {% if include_provides %}
++Provides: {{ md.provides() }}
++ {% endif %}
++ {% if include_requires %}
+ Requires: cargo
+-{% if md.requires|length > 0 %}
+-# [dependencies]
+-{% for req in md.requires|sort(attribute="name") %}
+-Requires: {{ req }}
+-{% endfor %}
+-{% endif %}
+-{% if md.build_requires|length > 0 %}
+-# [build-dependencies]
+-{% for req in md.build_requires|sort(attribute="name") %}
++ {% for req in md.requires(feature)|map("string")|sort %}
+ Requires: {{ req }}
+-{% endfor %}
+-{% endif %}
+-{% endif %}
++ {% endfor %}
++ {% endif %}
+
+-%description devel
+-{% if md.description is none %}
+-%{summary}.
+-{% else %}
+-{{ md.description|wordwrap|trim }}
+-{% endif %}
++%description {{ pkg }} %{_description}
+
+ This package contains library source intended for building other packages
+-which use %{crate} from crates.io.
++which use {% if feature is not none %}"{{ feature }}" of {% endif
%}"%{crate}" crate.
++
++%files {{ pkg }}
++ {% if feature is none %}
++ {% if md.license_file is not none %}
++%license {{ md.license_file }}
++ {% endif %}
++ {% if md.readme is not none %}
++%doc {{ md.readme }}
++ {% endif %}
++%{cargo_registry}/%{crate}-%{version}/
++ {% else %}
++%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml
++ {% endif %}
++
++ {% endfor %}
++{% endif -%}
+
+-{% endif %}
+ %prep
+ {% if md.name != crate %}
+ %autosetup -n %{real_crate}-%{version} -p1
+@@ -143,29 +162,5 @@ which use %{crate} from crates.io.
+ %cargo_test
+ %endif
+
+-{% if include_main %}
+-%files -n %{crate}
+-{% if md.license_file is not none %}
+-%license {{ md.license_file }}
+-{% endif %}
+-{% if md.readme is not none %}
+-%doc {{ md.readme }}
+-{% endif %}
+-{% for bin in bins %}
+-%{_bindir}/{{ bin.name }}
+-{% endfor %}
+-
+-{% endif %}
+-{% if include_devel %}
+-%files devel
+-{% if md.license_file is not none %}
+-%license {{ md.license_file }}
+-{% endif %}
+-{% if md.readme is not none %}
+-%doc {{ md.readme }}
+-{% endif %}
+-%{cargo_registry}/%{crate}-%{version}/
+-
+-{% endif %}
+ %changelog
+ {% include target ~ "-changelog.spec.inc" %}
+--
+2.19.1
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 98159e2..a7ba418 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -1,14 +1,23 @@
-%bcond_without check
+# Tests need fixing after patches
+%bcond_with check
%{?python_enable_dependency_generator}
Name: rust-packaging
Version: 6
-Release: 1%{?dist}
+Release: 10%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
+Patch0001: 0001-name-spec-patch_file-by-real-crate-name.patch
+Patch0002: 0002-generate-doc-statements.patch
+Patch0003: 0003-do-better-for-renamed-crates.patch
+Patch0004: 0004-remove-pre-3.6-leftovers.patch
+Patch0005: 0005-Remove-half-downloaded-crate-on-C.patch
+Patch0006: 0006-Throw-an-error-if-s-is-used-without-a-crate.patch
+# Still in PR
+Patch0007: 0007-split-features-into-subpackages.patch
BuildArch: noarch
ExclusiveArch: %{rust_arches} noarch
@@ -70,6 +79,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Fri Oct 26 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-10
+- Split features into subpackages
+
* Sun Sep 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-1
- Update to 6
commit faa0f2d171638d6bf82d36c487101cf54abd384c
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Sep 2 18:43:27 2018 +0200
add missing BR back
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 495e71d..98159e2 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -31,6 +31,7 @@ BuildRequires: python3-setuptools
%if %{with check}
BuildRequires: python3-pytest
BuildRequires: cargo
+BuildRequires: python3dist(semantic-version)
BuildRequires: python3dist(rustcfg)
%endif
Requires: cargo
commit a85e0d862fa1796d526f242b974c9e5e67fe9567
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Sep 2 18:29:13 2018 +0200
Update to 6
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/.gitignore b/.gitignore
index d47206f..388ca95 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/rust2rpm-4.tar.xz
/rust2rpm-5.tar.xz
+/rust2rpm-6.tar.xz
diff --git a/0001-macros-remove-Cargo.lock.patch b/0001-macros-remove-Cargo.lock.patch
deleted file mode 100644
index 57069a3..0000000
--- a/0001-macros-remove-Cargo.lock.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 5313b352712486b4001827b04d906bdb91be2314 Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenkobrain(a)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(a)redhat.com>
-Signed-off-by: Igor Gnatenko <ignatenkobrain(a)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
-
diff --git a/0002-macros-remove-spurious-whitespace.patch
b/0002-macros-remove-spurious-whitespace.patch
deleted file mode 100644
index 9e11804..0000000
--- a/0002-macros-remove-spurious-whitespace.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From cd6329635329fc7742a18f7ed0933298a0c56cf7 Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenkobrain(a)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(a)redhat.com>
-Signed-off-by: Igor Gnatenko <ignatenkobrain(a)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
-
diff --git a/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch
b/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch
deleted file mode 100644
index c5ff4b6..0000000
--- a/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From c5bab762f56bf07cd0f4a2e2d58b7c295cddedd8 Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenkobrain(a)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(a)redhat.com>
-Signed-off-by: Igor Gnatenko <ignatenkobrain(a)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
-
diff --git a/0004-macros-make-cargo_-macros-parametric.patch
b/0004-macros-make-cargo_-macros-parametric.patch
deleted file mode 100644
index 8d8028a..0000000
--- a/0004-macros-make-cargo_-macros-parametric.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From c9ce952e260ec0adb166bd6e1de652a0277d2437 Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenkobrain(a)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(a)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
-
diff --git a/0005-macros-remove-support-for-target-dir.patch
b/0005-macros-remove-support-for-target-dir.patch
deleted file mode 100644
index e8fbfcc..0000000
--- a/0005-macros-remove-support-for-target-dir.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 80237720ae3397fc66d8f06e13f868c4bd2723c1 Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenkobrain(a)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(a)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
-
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 016f782..495e71d 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -1,18 +1,14 @@
%bcond_without check
+%{?python_enable_dependency_generator}
Name: rust-packaging
-Version: 5
-Release: 11%{?dist}
+Version: 6
+Release: 1%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
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
-Patch0004: 0004-macros-make-cargo_-macros-parametric.patch
-Patch0005: 0005-macros-remove-support-for-target-dir.patch
BuildArch: noarch
ExclusiveArch: %{rust_arches} noarch
@@ -23,8 +19,6 @@ Requires: python3-rust2rpm =
%{?epoch:%{epoch}:}%{version}-%{release}
Requires: rust-srpm-macros = %{version}
Requires: rust
Requires: cargo
-# Remove in F29
-Obsoletes: rust-rpm-macros < 2-2
%description
The package provides macros for building projects in Rust
@@ -37,14 +31,9 @@ BuildRequires: python3-setuptools
%if %{with check}
BuildRequires: python3-pytest
BuildRequires: cargo
-BuildRequires: python3-semantic_version
+BuildRequires: python3dist(rustcfg)
%endif
Requires: cargo
-Requires: python3-semantic_version
-Requires: python3-jinja2
-Requires: python3-requests
-Requires: python3-tqdm
-Obsoletes: rust2rpm < 1-8
Provides: rust2rpm = %{version}-%{release}
%{?python_provide:%python_provide python3-rust2rpm}
@@ -80,6 +69,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sun Sep 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 6-1
+- Update to 6
+
* Sat Jul 14 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 5-11
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
diff --git a/sources b/sources
index 0745d57..9f6fa6f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (rust2rpm-5.tar.xz) =
e61c0c9351b3bc76b576fc57950b96793f805109e56d1021da94e5dfceb9d299c868f980de298d6a7f85e1b3477f785df7b5615c702e6a0ac25070fbffc013f3
+SHA512 (rust2rpm-6.tar.xz) =
408988351156d858f7429d990d7330f216b54add671c6e90e54917e717ad6f2b3b99e414289c252e6a2b5dfad73ce430ac73f03265f6e174ef53edcee34d0fe2
commit 84bf5595e3951aa209c83c79c4564d69cf8d32bd
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Sat Jul 14 05:20:48 2018 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 73d8668..016f782 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,7 +2,7 @@
Name: rust-packaging
Version: 5
-Release: 10%{?dist}
+Release: 11%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -80,6 +80,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sat Jul 14 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 5-11
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+
* Mon Jul 02 2018 Miro Hronok <mhroncok(a)redhat.com> - 5-10
- Rebuilt for Python 3.7
commit b5750174ce98b9754d480856c3662e6a910bef83
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Mon Jul 2 18:24:06 2018 +0200
Rebuilt for Python 3.7
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 1b4c7c2..73d8668 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,7 +2,7 @@
Name: rust-packaging
Version: 5
-Release: 9%{?dist}
+Release: 10%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -80,6 +80,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Mon Jul 02 2018 Miro Hronok <mhroncok(a)redhat.com> - 5-10
+- Rebuilt for Python 3.7
+
* Mon Jul 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-9
- Rebuilt for Python 3.7
commit 104d9fcc10c4002f0e0f3f39e93c8e9737f08487
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon Jul 2 17:19:07 2018 +0100
Rebuilt for Python 3.7
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index dabffa1..1b4c7c2 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,7 +2,7 @@
Name: rust-packaging
Version: 5
-Release: 8%{?dist}
+Release: 9%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -80,6 +80,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Mon Jul 02 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-9
+- Rebuilt for Python 3.7
+
* Fri Jun 22 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-8
- Various improvements for %%cargo_* macros
commit fb6d2b02177659c987b42014f5d457cdc76221ed
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri Jun 22 21:57:54 2018 +0200
Various improvements for %%cargo_* macros
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-macros-remove-Cargo.lock.patch b/0001-macros-remove-Cargo.lock.patch
index eac95b4..57069a3 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 <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 8 Jan 2018 23:57:03 +0100
-Subject: [PATCH 1/3] macros: remove Cargo.lock
+Subject: [PATCH 1/5] 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.16.2
+2.18.0.rc2
diff --git a/0002-macros-remove-spurious-whitespace.patch
b/0002-macros-remove-spurious-whitespace.patch
index 2033124..9e11804 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 <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 9 Jan 2018 06:52:36 +0100
-Subject: [PATCH 2/3] macros: remove spurious whitespace
+Subject: [PATCH 2/5] macros: remove spurious whitespace
Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/48
Reported-by: Josh Stone <jistone(a)redhat.com>
@@ -24,5 +24,5 @@ index 288554c..67b1950 100644
%if ! %{with check} \
#
https://github.com/rust-lang/cargo/issues/3732 \
--
-2.16.2
+2.18.0.rc2
diff --git a/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch
b/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch
index f719a78..c5ff4b6 100644
--- a/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch
+++ b/0003-macros-pass-__cargo_common_opts-to-cargo_install.patch
@@ -1,7 +1,7 @@
From c5bab762f56bf07cd0f4a2e2d58b7c295cddedd8 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue, 20 Feb 2018 22:04:35 +0100
-Subject: [PATCH 3/3] macros: pass %__cargo_common_opts to %cargo_install
+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
@@ -46,5 +46,5 @@ index 67b1950..22721e9 100644
fi \
)
--
-2.16.2
+2.18.0.rc2
diff --git a/0004-macros-make-cargo_-macros-parametric.patch
b/0004-macros-make-cargo_-macros-parametric.patch
new file mode 100644
index 0000000..8d8028a
--- /dev/null
+++ b/0004-macros-make-cargo_-macros-parametric.patch
@@ -0,0 +1,96 @@
+From c9ce952e260ec0adb166bd6e1de652a0277d2437 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)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(a)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
+
diff --git a/0005-macros-remove-support-for-target-dir.patch
b/0005-macros-remove-support-for-target-dir.patch
new file mode 100644
index 0000000..e8fbfcc
--- /dev/null
+++ b/0005-macros-remove-support-for-target-dir.patch
@@ -0,0 +1,71 @@
+From 80237720ae3397fc66d8f06e13f868c4bd2723c1 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)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(a)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
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 9f6162f..dabffa1 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,7 +2,7 @@
Name: rust-packaging
Version: 5
-Release: 7%{?dist}
+Release: 8%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -11,6 +11,8 @@ Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{vers
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
ExclusiveArch: %{rust_arches} noarch
@@ -78,6 +80,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Fri Jun 22 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-8
+- Various improvements for %%cargo_* macros
+
* Tue Jun 19 2018 Miro Hronok <mhroncok(a)redhat.com> - 5-7
- Rebuilt for Python 3.7
commit fe7dc1b94a637386dbda072d8f7ceede532637c8
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Tue Jun 19 11:27:00 2018 +0200
Rebuilt for Python 3.7
diff --git a/rust-packaging.spec b/rust-packaging.spec
index f6ce2e1..9f6162f 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,7 +2,7 @@
Name: rust-packaging
Version: 5
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -78,6 +78,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Tue Jun 19 2018 Miro Hronok <mhroncok(a)redhat.com> - 5-7
+- Rebuilt for Python 3.7
+
* Wed Feb 21 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-6
- Pass %%__cargo_common_opts to %%cargo_install
commit 6e2f4c83784eb959fcfafea022f6c78770dadf3d
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed Feb 21 08:15:29 2018 +0100
Pass %__cargo_common_opts to %cargo_install
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
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 <ignatenkobrain(a)fedoraproject.org>
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 <ignatenkobrain(a)fedoraproject.org>
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 <jistone(a)redhat.com>
@@ -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 <ignatenkobrain(a)fedoraproject.org>
+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 <jistone(a)redhat.com>
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)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.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 <ignatenkobrain(a)fedoraproject.org> - 5-6
+- Pass %%__cargo_common_opts to %%cargo_install
+
* Tue Feb 20 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-5
- Explicitly require rust/cargo
commit 210d2aa95c2dbda70e4081d015e87a297a268ece
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue Feb 20 14:21:10 2018 +0100
Explicitly require rust/cargo
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index eade1ea..1d5bfbc 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,7 +2,7 @@
Name: rust-packaging
Version: 5
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -18,6 +18,8 @@ ExclusiveArch: %{rust_arches} noarch
Requires: gawk >= 4.1.0
Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: rust-srpm-macros = %{version}
+Requires: rust
+Requires: cargo
# Remove in F29
Obsoletes: rust-rpm-macros < 2-2
@@ -87,6 +89,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Tue Feb 20 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-5
+- Explicitly require rust/cargo
+
* Fri Feb 09 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 5-4
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
commit 7edf0c5e79fa9747ef661cc8bd8f3b7ab6acbc81
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Fri Feb 9 15:38:01 2018 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 7b3ccea..eade1ea 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,7 +2,7 @@
Name: rust-packaging
Version: 5
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -87,6 +87,9 @@ py.test-%{python3_version} -vv test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Fri Feb 09 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 5-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+
* Tue Jan 09 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-3
- Fix syntax error
commit 1f1f7784f40645adf884f8c18f3c1f09920a5f9c
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Jan 14 17:01:28 2018 +0100
use %_rpmmacrodir and %_fileattrsdir
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 9bef763..7b3ccea 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -66,8 +66,8 @@ lang=en_US.UTF-8
%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
+install -D -p -m 0644 -t %{buildroot}%{_rpmmacrodir} data/macros.rust data/macros.cargo
+install -D -p -m 0644 -t %{buildroot}%{_fileattrsdir} data/cargo.attr
%if %{with check}
%check
@@ -75,9 +75,9 @@ py.test-%{python3_version} -vv test.py
%endif
%files
-%{_rpmconfigdir}/macros.d/macros.rust
-%{_rpmconfigdir}/macros.d/macros.cargo
-%{_rpmconfigdir}/fileattrs/cargo.attr
+%{_rpmmacrodir}/macros.rust
+%{_rpmmacrodir}/macros.cargo
+%{_fileattrsdir}/cargo.attr
%files -n python3-rust2rpm
%license LICENSE
commit e99965a091ab45b9013cc9b8cfe68e1682d66682
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Jan 14 17:01:10 2018 +0100
remove obsolete conditions
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index a47ac1f..9bef763 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -52,7 +52,7 @@ Provides: rust2rpm = %{version}-%{release}
%prep
%autosetup -n rust2rpm-%{version} -p1
lang=
-%if (0%{?fedora} && 0%{?fedora} <= 25) || (0%{?rhel} && 0%{?rhel}
<= 7)
+%if 0%{?rhel} && 0%{?rhel} <= 7
lang=C.UTF-8
%else
%if 0%{?mageia}
commit 0e91fb3355fe994f41b16165a44b0e20ba16d8a3
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Jan 14 09:07:34 2018 +0100
be super-verbose in tests
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 20d6cc3..a47ac1f 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -71,7 +71,7 @@ install -D -p -m 0644 -t %{buildroot}%{_rpmconfigdir}/fileattrs
data/cargo.attr
%if %{with check}
%check
-py.test-%{python3_version} -v test.py
+py.test-%{python3_version} -vv test.py
%endif
%files
commit f45176f7dee892d1048a4f71c762ec74900da55b
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue Jan 9 06:54:39 2018 +0100
Fix syntax error
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-macros-remove-Cargo.lock.patch b/0001-macros-remove-Cargo.lock.patch
index c86f872..435710c 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 <ignatenkobrain(a)fedoraproject.org>
Date: Mon, 8 Jan 2018 23:57:03 +0100
-Subject: [PATCH] macros: remove Cargo.lock
+Subject: [PATCH 1/2] macros: remove Cargo.lock
cargo-package automatically strips it out, but we package also some
things directly from git.
diff --git a/0002-macros-remove-spurious-whitespace.patch
b/0002-macros-remove-spurious-whitespace.patch
new file mode 100644
index 0000000..522e2b0
--- /dev/null
+++ b/0002-macros-remove-spurious-whitespace.patch
@@ -0,0 +1,28 @@
+From cd6329635329fc7742a18f7ed0933298a0c56cf7 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Tue, 9 Jan 2018 06:52:36 +0100
+Subject: [PATCH 2/2] macros: remove spurious whitespace
+
+Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/48
+Reported-by: Josh Stone <jistone(a)redhat.com>
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)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.15.1
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index af03432..20d6cc3 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,13 +2,14 @@
Name: rust-packaging
Version: 5
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
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
BuildArch: noarch
ExclusiveArch: %{rust_arches} noarch
@@ -86,6 +87,9 @@ py.test-%{python3_version} -v test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Tue Jan 09 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-3
+- Fix syntax error
+
* Tue Jan 09 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-2
- Remove Cargo.lock
commit b22849eefe9f75d9e5e5e364ab740c768324002e
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Tue Jan 9 00:02:01 2018 +0100
Remove Cargo.lock
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-macros-remove-Cargo.lock.patch b/0001-macros-remove-Cargo.lock.patch
new file mode 100644
index 0000000..c86f872
--- /dev/null
+++ b/0001-macros-remove-Cargo.lock.patch
@@ -0,0 +1,31 @@
+From 5313b352712486b4001827b04d906bdb91be2314 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Mon, 8 Jan 2018 23:57:03 +0100
+Subject: [PATCH] macros: remove Cargo.lock
+
+cargo-package automatically strips it out, but we package also some
+things directly from git.
+
+Acked-by: Josh Stone <jistone(a)redhat.com>
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)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.15.1
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 651c352..af03432 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,12 +2,13 @@
Name: rust-packaging
Version: 5
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
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
BuildArch: noarch
ExclusiveArch: %{rust_arches} noarch
@@ -85,6 +86,9 @@ py.test-%{python3_version} -v test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Tue Jan 09 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-2
+- Remove Cargo.lock
+
* Mon Jan 08 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-1
- Update to 5
commit 2ce47297c5751f725f2fc720355ef8025225d44b
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon Jan 8 20:52:27 2018 +0100
commit sources
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/.gitignore b/.gitignore
index aaa8cf4..d47206f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/rust2rpm-4.tar.xz
+/rust2rpm-5.tar.xz
diff --git a/sources b/sources
index a81110b..0745d57 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (rust2rpm-4.tar.xz) =
d8527c72f34b31086d3c6dbfae7fd25709525e5aa941d9de47efaefb07a04782d8f7c561b258145df1413fbfee5cd76e24d7d3787107aa36e2d9d1a1e6577637
+SHA512 (rust2rpm-5.tar.xz) =
e61c0c9351b3bc76b576fc57950b96793f805109e56d1021da94e5dfceb9d299c868f980de298d6a7f85e1b3477f785df7b5615c702e6a0ac25070fbffc013f3
commit f0f5561dea6f3667228f30880e0622f418f2618b
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon Jan 8 20:32:16 2018 +0100
Update to 5
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-inspector-inject-cargo-dependency-in-runtime.patch
b/0001-inspector-inject-cargo-dependency-in-runtime.patch
deleted file mode 100644
index 675f2ca..0000000
--- a/0001-inspector-inject-cargo-dependency-in-runtime.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 9e0a872ece6f5aedf76ffd67044f22c7d0cba8aa Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
-Date: Fri, 20 Oct 2017 18:04:31 +0200
-Subject: [PATCH 1/3] inspector: inject cargo dependency in runtime
-
-Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/42
-Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
----
- rust2rpm/__main__.py | 1 +
- rust2rpm/inspector.py | 3 +++
- 2 files changed, 4 insertions(+)
-
-diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
-index 0121a33..bb92fa3 100644
---- a/rust2rpm/__main__.py
-+++ b/rust2rpm/__main__.py
-@@ -91,6 +91,7 @@ Provides: {{ prv }}
- {% endfor %}
- {% endif %}
- {% if include_requires %}
-+Requires: cargo
- {% if md.requires|length > 0 %}
- # [dependencies]
- {% for req in md.requires|sort(attribute="name") %}
-diff --git a/rust2rpm/inspector.py b/rust2rpm/inspector.py
-index d08f1aa..6ccdbc2 100644
---- a/rust2rpm/inspector.py
-+++ b/rust2rpm/inspector.py
-@@ -38,6 +38,9 @@ def main():
- print_deps(list(itertools.chain(md.requires, md.build_requires)))
- if args.test_requires:
- print_deps(md.test_requires)
-+ if args.requires:
-+ # Someone should own /usr/share/cargo/registry
-+ print("cargo")
-
- if __name__ == "__main__":
- main()
---
-2.15.0
-
diff --git a/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
b/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
deleted file mode 100644
index bfa9764..0000000
--- a/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 45a5caf30060c182fb0ae03a1a7e4e707599aaa3 Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
-Date: Sat, 21 Oct 2017 09:45:30 +0200
-Subject: [PATCH 2/3] inspector: inject rust-packaging dependency in buildtime
-
-For consistency with previous commit.
-
-Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
----
- rust2rpm/inspector.py | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/rust2rpm/inspector.py b/rust2rpm/inspector.py
-index 6ccdbc2..2d488b2 100644
---- a/rust2rpm/inspector.py
-+++ b/rust2rpm/inspector.py
-@@ -41,6 +41,8 @@ def main():
- if args.requires:
- # Someone should own /usr/share/cargo/registry
- print("cargo")
-+ if args.build_requires:
-+ print("rust-packaging")
-
- if __name__ == "__main__":
- main()
---
-2.15.0
-
diff --git a/0003-use-cp-instead-of-install.patch b/0003-use-cp-instead-of-install.patch
deleted file mode 100644
index 7c7b726..0000000
--- a/0003-use-cp-instead-of-install.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 59809d4940822edaa361507ecea93b84e3c43ec0 Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
-Date: Sat, 4 Nov 2017 15:32:39 +0100
-Subject: [PATCH 3/3] use cp instead of install
-
-We want to preserve original modes and so on.
-
-Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
----
- data/macros.cargo | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/data/macros.cargo b/data/macros.cargo
-index 09bbcea..e52f87c 100644
---- a/data/macros.cargo
-+++ b/data/macros.cargo
-@@ -45,9 +45,9 @@ if %__cargo_is_lib; then
\
- 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 -p -t $REG_DIR \
-+ %__cargo package -l | xargs %{__cp} --parents -a -t $REG_DIR \
- %if ! %{with check} \
-- %{__install} -p Cargo.toml.orig $REG_DIR/Cargo.toml \
-+ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
- %endif \
- echo '{"files":{},"package":""}' >
$REG_DIR/.cargo-checksum.json \
- fi \
---
-2.15.0
-
diff --git a/rust-packaging.spec b/rust-packaging.spec
index bbc94f3..651c352 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -1,17 +1,13 @@
%bcond_without check
Name: rust-packaging
-Version: 4
-Release: 7%{?dist}
+Version: 5
+Release: 1%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
-# Commits since last release
-Patch0001: 0001-inspector-inject-cargo-dependency-in-runtime.patch
-Patch0002: 0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
-Patch0003: 0003-use-cp-instead-of-install.patch
BuildArch: noarch
ExclusiveArch: %{rust_arches} noarch
@@ -89,6 +85,9 @@ py.test-%{python3_version} -v test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Mon Jan 08 2018 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 5-1
+- Update to 5
+
* Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-7
- Add Obsoletes for rust-rpm-macros
commit 1b0abb676f4af171ba164700431e8362f45e5c69
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat Nov 4 15:48:01 2017 +0100
Add Obsoletes for rust-rpm-macros
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 4ee9c1f..bbc94f3 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,7 +2,7 @@
Name: rust-packaging
Version: 4
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -20,6 +20,8 @@ ExclusiveArch: %{rust_arches} noarch
Requires: gawk >= 4.1.0
Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: rust-srpm-macros = %{version}
+# Remove in F29
+Obsoletes: rust-rpm-macros < 2-2
%description
The package provides macros for building projects in Rust
@@ -87,6 +89,9 @@ py.test-%{python3_version} -v test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-7
+- Add Obsoletes for rust-rpm-macros
+
* Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-6
- Use cp instead of install
commit d98b1ace2dd0352476b0409f833b6a1d5073c00f
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat Nov 4 15:35:35 2017 +0100
Use cp instead of install
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-inspector-inject-cargo-dependency-in-runtime.patch
b/0001-inspector-inject-cargo-dependency-in-runtime.patch
index 35e2831..675f2ca 100644
--- a/0001-inspector-inject-cargo-dependency-in-runtime.patch
+++ b/0001-inspector-inject-cargo-dependency-in-runtime.patch
@@ -1,7 +1,7 @@
From 9e0a872ece6f5aedf76ffd67044f22c7d0cba8aa Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Fri, 20 Oct 2017 18:04:31 +0200
-Subject: [PATCH 1/2] inspector: inject cargo dependency in runtime
+Subject: [PATCH 1/3] inspector: inject cargo dependency in runtime
Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/42
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
@@ -37,5 +37,5 @@ index d08f1aa..6ccdbc2 100644
if __name__ == "__main__":
main()
--
-2.14.2
+2.15.0
diff --git a/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
b/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
index 44777cf..bfa9764 100644
--- a/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
+++ b/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
@@ -1,7 +1,7 @@
From 45a5caf30060c182fb0ae03a1a7e4e707599aaa3 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat, 21 Oct 2017 09:45:30 +0200
-Subject: [PATCH 2/2] inspector: inject rust-packaging dependency in buildtime
+Subject: [PATCH 2/3] inspector: inject rust-packaging dependency in buildtime
For consistency with previous commit.
@@ -24,5 +24,5 @@ index 6ccdbc2..2d488b2 100644
if __name__ == "__main__":
main()
--
-2.14.2
+2.15.0
diff --git a/0003-use-cp-instead-of-install.patch b/0003-use-cp-instead-of-install.patch
new file mode 100644
index 0000000..7c7b726
--- /dev/null
+++ b/0003-use-cp-instead-of-install.patch
@@ -0,0 +1,31 @@
+From 59809d4940822edaa361507ecea93b84e3c43ec0 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Sat, 4 Nov 2017 15:32:39 +0100
+Subject: [PATCH 3/3] use cp instead of install
+
+We want to preserve original modes and so on.
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ data/macros.cargo | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/data/macros.cargo b/data/macros.cargo
+index 09bbcea..e52f87c 100644
+--- a/data/macros.cargo
++++ b/data/macros.cargo
+@@ -45,9 +45,9 @@ if %__cargo_is_lib; then
\
+ 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 -p -t $REG_DIR \
++ %__cargo package -l | xargs %{__cp} --parents -a -t $REG_DIR \
+ %if ! %{with check} \
+- %{__install} -p Cargo.toml.orig $REG_DIR/Cargo.toml \
++ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
+ %endif \
+ echo '{"files":{},"package":""}' >
$REG_DIR/.cargo-checksum.json \
+ fi \
+--
+2.15.0
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index edae99b..4ee9c1f 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,15 +2,16 @@
Name: rust-packaging
Version: 4
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
-#
https://pagure.io/fedora-rust/rust2rpm/pull-request/43
+# Commits since last release
Patch0001: 0001-inspector-inject-cargo-dependency-in-runtime.patch
Patch0002: 0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
+Patch0003: 0003-use-cp-instead-of-install.patch
BuildArch: noarch
ExclusiveArch: %{rust_arches} noarch
@@ -86,6 +87,9 @@ py.test-%{python3_version} -v test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sat Nov 04 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-6
+- Use cp instead of install
+
* Sat Oct 21 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-5
- Generate runtime dependencyon cargo for devel subpackages
commit 6b81b17f09c4168a13a81f0c305ddd13117ef61d
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat Oct 21 09:58:43 2017 +0200
Generate runtime dependencyon cargo for devel subpackages
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-inspector-inject-cargo-dependency-in-runtime.patch
b/0001-inspector-inject-cargo-dependency-in-runtime.patch
new file mode 100644
index 0000000..35e2831
--- /dev/null
+++ b/0001-inspector-inject-cargo-dependency-in-runtime.patch
@@ -0,0 +1,41 @@
+From 9e0a872ece6f5aedf76ffd67044f22c7d0cba8aa Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Fri, 20 Oct 2017 18:04:31 +0200
+Subject: [PATCH 1/2] inspector: inject cargo dependency in runtime
+
+Fixes:
https://pagure.io/fedora-rust/rust2rpm/issue/42
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ rust2rpm/__main__.py | 1 +
+ rust2rpm/inspector.py | 3 +++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
+index 0121a33..bb92fa3 100644
+--- a/rust2rpm/__main__.py
++++ b/rust2rpm/__main__.py
+@@ -91,6 +91,7 @@ Provides: {{ prv }}
+ {% endfor %}
+ {% endif %}
+ {% if include_requires %}
++Requires: cargo
+ {% if md.requires|length > 0 %}
+ # [dependencies]
+ {% for req in md.requires|sort(attribute="name") %}
+diff --git a/rust2rpm/inspector.py b/rust2rpm/inspector.py
+index d08f1aa..6ccdbc2 100644
+--- a/rust2rpm/inspector.py
++++ b/rust2rpm/inspector.py
+@@ -38,6 +38,9 @@ def main():
+ print_deps(list(itertools.chain(md.requires, md.build_requires)))
+ if args.test_requires:
+ print_deps(md.test_requires)
++ if args.requires:
++ # Someone should own /usr/share/cargo/registry
++ print("cargo")
+
+ if __name__ == "__main__":
+ main()
+--
+2.14.2
+
diff --git a/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
b/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
new file mode 100644
index 0000000..44777cf
--- /dev/null
+++ b/0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
@@ -0,0 +1,28 @@
+From 45a5caf30060c182fb0ae03a1a7e4e707599aaa3 Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+Date: Sat, 21 Oct 2017 09:45:30 +0200
+Subject: [PATCH 2/2] inspector: inject rust-packaging dependency in buildtime
+
+For consistency with previous commit.
+
+Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
+---
+ rust2rpm/inspector.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/rust2rpm/inspector.py b/rust2rpm/inspector.py
+index 6ccdbc2..2d488b2 100644
+--- a/rust2rpm/inspector.py
++++ b/rust2rpm/inspector.py
+@@ -41,6 +41,8 @@ def main():
+ if args.requires:
+ # Someone should own /usr/share/cargo/registry
+ print("cargo")
++ if args.build_requires:
++ print("rust-packaging")
+
+ if __name__ == "__main__":
+ main()
+--
+2.14.2
+
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 5de07c4..edae99b 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,12 +2,15 @@
Name: rust-packaging
Version: 4
-Release: 3%{?dist}
+Release: 5%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
URL:
https://pagure.io/fedora-rust/rust2rpm
Source0:
https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz
+#
https://pagure.io/fedora-rust/rust2rpm/pull-request/43
+Patch0001: 0001-inspector-inject-cargo-dependency-in-runtime.patch
+Patch0002: 0002-inspector-inject-rust-packaging-dependency-in-buildt.patch
BuildArch: noarch
ExclusiveArch: %{rust_arches} noarch
@@ -83,6 +86,9 @@ py.test-%{python3_version} -v test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Sat Oct 21 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-5
+- Generate runtime dependencyon cargo for devel subpackages
+
* Thu Jul 27 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 4-3
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
commit 46f705671d983393718d94f489070362fe07317a
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sat Oct 21 09:57:46 2017 +0200
adopt to new RPM 4.14 behavior for returning proper exit status
Since RPM 4.14, it started to return exit status of last executed
statement which on rawhide returns false so right condition doesn't
run.
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/rust-packaging.spec b/rust-packaging.spec
index fe71057..5de07c4 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -55,7 +55,7 @@ lang=C.UTF-8
lang=en_US.UTF-8
%endif
%endif
-[ -n "$lang" ] && sed -r -i -e
"s|(%\{_bindir\}/cargo-inspector)|env LANG=$lang \1|" data/cargo.attr
data/macros.cargo
+[ -z "$lang" ] || sed -r -i -e "s|(%\{_bindir\}/cargo-inspector)|env
LANG=$lang \1|" data/cargo.attr data/macros.cargo
%build
%py3_build
commit 85772b9e87a16911d2365af1dd20ce50100e2587
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Thu Jul 27 18:01:59 2017 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
diff --git a/rust-packaging.spec b/rust-packaging.spec
index 91e4eb9..fe71057 100644
--- a/rust-packaging.spec
+++ b/rust-packaging.spec
@@ -2,7 +2,7 @@
Name: rust-packaging
Version: 4
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: RPM macros for building Rust packages on various architectures
License: MIT
@@ -83,6 +83,9 @@ py.test-%{python3_version} -v test.py
%{python3_sitelib}/rust2rpm/
%changelog
+* Thu Jul 27 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 4-3
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
* Sat Jul 08 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-2
- Include license
commit 4e5904b9ac6f208d08f51fd46059878856a03db4
Author: Igor Gnatenko <ignatenko(a)redhat.com>
Date: Sun Jul 9 09:22:14 2017 +0200
initial import
Signed-off-by: Igor Gnatenko <ignatenko(a)redhat.com>
diff --git a/.gitignore b/.gitignore
index e69de29..aaa8cf4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/rust2rpm-4.tar.xz
diff --git a/rust-packaging.spec b/rust-packaging.spec
new file mode 100644
index 0000000..91e4eb9
--- /dev/null
+++ b/rust-packaging.spec
@@ -0,0 +1,105 @@
+%bcond_without check
+
+Name: rust-packaging
+Version: 4
+Release: 2%{?dist}
+Summary: RPM macros for building Rust packages on various architectures
+
+License: MIT
+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: gawk >= 4.1.0
+Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release}
+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
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+%if %{with check}
+BuildRequires: python3-pytest
+BuildRequires: cargo
+BuildRequires: python3-semantic_version
+%endif
+Requires: cargo
+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}
+
+%description -n python3-rust2rpm
+%{summary}.
+
+%prep
+%autosetup -n rust2rpm-%{version} -p1
+lang=
+%if (0%{?fedora} && 0%{?fedora} <= 25) || (0%{?rhel} && 0%{?rhel}
<= 7)
+lang=C.UTF-8
+%else
+%if 0%{?mageia}
+lang=en_US.UTF-8
+%endif
+%endif
+[ -n "$lang" ] && sed -r -i -e
"s|(%\{_bindir\}/cargo-inspector)|env LANG=$lang \1|" data/cargo.attr
data/macros.cargo
+
+%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} -v test.py
+%endif
+
+%files
+%{_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
+* Sat Jul 08 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-2
+- Include license
+
+* Sat Jul 08 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 4-1
+- Update to 4
+
+* Fri Jun 23 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 3-5
+- Explicitly set rustdoc path
+
+* Wed Jun 21 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 3-4
+- Mageia doesn't have C.UTF-8 lang
+
+* Wed Jun 21 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 3-3
+- Switch cargo_registry to /usr/share/cargo/registry
+
+* Wed Jun 14 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 3-2
+- Set C.UTF-8 for cargo inspector where python doesn't do locale coercing
+
+* Tue Jun 13 2017 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 3-1
+- Initial package
diff --git a/sources b/sources
index e69de29..a81110b 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (rust2rpm-4.tar.xz) =
d8527c72f34b31086d3c6dbfae7fd25709525e5aa941d9de47efaefb07a04782d8f7c561b258145df1413fbfee5cd76e24d7d3787107aa36e2d9d1a1e6577637