51 lines
2.2 KiB
Diff
51 lines
2.2 KiB
Diff
|
|
From b1ef9afb58b2a2ba2224d777a57ffbf0666eff3f Mon Sep 17 00:00:00 2001
|
||
|
|
From: lirui <lirui130@huawei.com>
|
||
|
|
Date: Thu, 28 Jan 2021 10:09:57 +0800
|
||
|
|
Subject: [PATCH] Add macros _binaries_in_noarch_packages_terminate_build and
|
||
|
|
_build_id_links
|
||
|
|
|
||
|
|
Some noarch packages use macro _binaries_in_noarch_packages_terminate_build to
|
||
|
|
package binary files. But when rpmrebuild can't read macro
|
||
|
|
_binaries_in_noarch_packages_terminate_build, it causes a problem, so add macro
|
||
|
|
_binaries_in_noarch_packages_terminate_build to the noarch package.
|
||
|
|
|
||
|
|
On the compilation environment, the macro _build_id_links is compat,and the
|
||
|
|
compiled package does not contain build-id. But during rpmrebuild, build-id
|
||
|
|
will be generated, but the buildroot directory is read-only, causing failure,
|
||
|
|
so set macro _build_id_links to none
|
||
|
|
---
|
||
|
|
rpmrebuild.sh | 17 +++++++++++++----
|
||
|
|
1 file changed, 13 insertions(+), 4 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/rpmrebuild.sh b/rpmrebuild.sh
|
||
|
|
index df48362..545b348 100755
|
||
|
|
--- a/rpmrebuild.sh
|
||
|
|
+++ b/rpmrebuild.sh
|
||
|
|
@@ -226,10 +226,19 @@ function RpmBuild
|
||
|
|
return 1
|
||
|
|
}
|
||
|
|
fi
|
||
|
|
- eval "$change_arch" $BUILDCMD --define "'buildroot $BUILDROOT'" "$RPMREBUILD_rpm_defines" -bb "$RPMREBUILD_rpm_verbose" "$RPMREBUILD_additional" "${FIC_SPEC}" || {
|
||
|
|
- Error "(RpmBuild) package '${RPMREBUILD_PAQUET}' $BuildFailed"
|
||
|
|
- return 1
|
||
|
|
- }
|
||
|
|
+
|
||
|
|
+ # Add macros %_binaries_in_noarch_packages_terminate_build to the noarch architecture
|
||
|
|
+ if [ "$pac_arch" = "noarch" ]; then
|
||
|
|
+ eval "$change_arch" $BUILDCMD --define "'buildroot $BUILDROOT'" --define "'_build_id_links none'" --define "'%_binaries_in_noarch_packages_terminate_build 0'" "$RPMREBUILD_rpm_defines" -bb "$RPMREBUILD_rpm_verbose" "$RPMREBUILD_additional" "${FIC_SPEC}" || {
|
||
|
|
+ Error "package '${RPMREBUILD_PAQUET}' $BuildFailed"
|
||
|
|
+ return 1
|
||
|
|
+ }
|
||
|
|
+ else
|
||
|
|
+ eval "$change_arch" $BUILDCMD --define "'buildroot $BUILDROOT'" --define "'_build_id_links none'" "$RPMREBUILD_rpm_defines" -bb "$RPMREBUILD_rpm_verbose" "$RPMREBUILD_additional" "${FIC_SPEC}" || {
|
||
|
|
+ Error "package '${RPMREBUILD_PAQUET}' $BuildFailed"
|
||
|
|
+ return 1
|
||
|
|
+ }
|
||
|
|
+ fi
|
||
|
|
|
||
|
|
return 0
|
||
|
|
}
|
||
|
|
--
|
||
|
|
2.33.0
|
||
|
|
|