rpm/add-dist-to-the-name-of-package.patch

51 lines
1.6 KiB
Diff
Raw Normal View History

2020-02-27 16:59:52 +08:00
From 10261618da16162c89e770d2c708c665702781d3 Mon Sep 17 00:00:00 2001
From: openEuler Buildteam <buildteam@openeuler.org>
Date: Thu, 27 Feb 2020 02:10:17 -0500
Subject: [PATCH] add dist to the name of package
---
build/files.c | 2 +-
macros.in | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/build/files.c b/build/files.c
index 6dfd801..5a64100 100644
--- a/build/files.c
+++ b/build/files.c
@@ -2637,7 +2637,7 @@ static void genSourceRpmName(rpmSpec spec)
{
if (spec->sourceRpmName == NULL) {
char *nvr = headerGetAsString(spec->packages->header, RPMTAG_NVR);
- rasprintf(&spec->sourceRpmName, "%s.%ssrc.rpm", nvr,
+ rasprintf(&spec->sourceRpmName, "%s%{_dist}.%ssrc.rpm", nvr,
spec->noSource ? "no" : "");
free(nvr);
}
diff --git a/macros.in b/macros.in
index fe9803a..adeaa2a 100644
--- a/macros.in
+++ b/macros.in
@@ -80,6 +80,10 @@
%__remsh %{__rsh}
%__strip @__STRIP@
+#==============================================================================
+# Distribution
+%_dist %{?dist:%{dist}}%{!?dist:%{nil}}
+
#==============================================================================
# Conditional build stuff.
@@ -697,7 +701,7 @@ package or when debugging this package.\
# binary packages.
#
# XXX Note: escaped %% for use in headerSprintf()
-%_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
+%_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}%{_dist}.%%{ARCH}.rpm
# Verify digest/signature flags for various rpm modes:
# 0x30300 (RPMVSF_MASK_NODIGESTS) --nohdrchk if set, don't check digest(s)
--
2.19.1