parent
04e7ad287a
commit
6745bc623a
@ -0,0 +1,63 @@
|
|||||||
|
From 294c6f571c0f4f7ed5a4fcb34142b0d332c55f29 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Neal Gompa <ngompa13@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@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
|
||||||
|
|
@ -0,0 +1,26 @@
|
|||||||
|
From b4e25038296cd57eba639a059e8baaf139a5d287 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Josh Stone <jistone@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
|
||||||
|
|
@ -0,0 +1,34 @@
|
|||||||
|
From a04e95bc4f807139bd3c4b75f46fd9a60ec1db8f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Josh Stone <jistone@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
|
||||||
|
|
Loading…
Reference in new issue