!64 revert: remove the require to rpm-build.For consistency with other community-released dependencies

From: @dongyuzhen 
Reviewed-by: @xujing99 
Signed-off-by: @xujing99
This commit is contained in:
openeuler-ci-bot 2024-01-20 01:30:38 +00:00 committed by Gitee
commit 688219136e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 64 deletions

View File

@ -1,6 +1,6 @@
Name: rpmrebuild Name: rpmrebuild
Version: 2.18 Version: 2.18
Release: 4 Release: 5
Summary: A tool to build a rpm file from the rpm database Summary: A tool to build a rpm file from the rpm database
License: GPLv2+ License: GPLv2+
URL: http://rpmrebuild.sourceforge.net URL: http://rpmrebuild.sourceforge.net
@ -9,14 +9,10 @@ Source0: https://downloads.sourceforge.net/rpmrebuild/%{name}-%{version}.
Patch6000: backport-Set-the-directory-mode-to-instead-of-omit.patch Patch6000: backport-Set-the-directory-mode-to-instead-of-omit.patch
Patch9000: Add-macros-_binaries_in_noarch_packages_terminate_bu.patch Patch9000: Add-macros-_binaries_in_noarch_packages_terminate_bu.patch
Patch9001: use-backups-of-rpmbuild-and-rpmspec-to-avoid-conflicts.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
BuildRequires: rpm-build Requires: rpm grep bash cpio textutils rpm-build
Requires: grep bash cpio textutils
%define _binaries_in_noarch_packages_terminate_build 0
%description %description
%{name} allows to build an rpm file from an installed rpm, or from %{name} allows to build an rpm file from an installed rpm, or from
@ -42,8 +38,6 @@ install -d -p $RPM_BUILD_ROOT%{_mandir}/fr/man1/
mv $RPM_BUILD_ROOT%{_mandir}/fr_FR.UTF-8/man1/* $RPM_BUILD_ROOT%{_mandir}/fr/man1/ mv $RPM_BUILD_ROOT%{_mandir}/fr_FR.UTF-8/man1/* $RPM_BUILD_ROOT%{_mandir}/fr/man1/
rm -rf $RPM_BUILD_ROOT%{_mandir}/fr_FR.UTF-8/man1/ rm -rf $RPM_BUILD_ROOT%{_mandir}/fr_FR.UTF-8/man1/
cp /usr/bin/rpmbuild $RPM_BUILD_ROOT%{_bindir}/rpmbuild-rebuild
cp /usr/bin/rpmspec $RPM_BUILD_ROOT%{_bindir}/rpmspec-rebuild
%files %files
%defattr(-,root,root) %defattr(-,root,root)
@ -57,8 +51,6 @@ cp /usr/bin/rpmspec $RPM_BUILD_ROOT%{_bindir}/rpmspec-rebuild
%{_prefix}/lib/rpmrebuild/plugins/*.plug %{_prefix}/lib/rpmrebuild/plugins/*.plug
%{_prefix}/lib/rpmrebuild/locale/* %{_prefix}/lib/rpmrebuild/locale/*
%{_prefix}/lib/rpmrebuild/optional_tags.cfg %{_prefix}/lib/rpmrebuild/optional_tags.cfg
%{_bindir}/rpmbuild-rebuild
%{_bindir}/rpmspec-rebuild
%files help %files help
%defattr(-,root,root) %defattr(-,root,root)
@ -68,6 +60,9 @@ cp /usr/bin/rpmspec $RPM_BUILD_ROOT%{_bindir}/rpmspec-rebuild
%{_mandir}/fr/man1/*.gz %{_mandir}/fr/man1/*.gz
%changelog %changelog
* Fri Jan 19 2024 dongyuzhen <dongyuzhen@h-partners.com> - 2.18-5
- revert: remove the require to rpm-build.For consistency with other community-released dependencies
* Mon Jan 15 2024 dongyuzhen <dongyuzhen@h-partners.com> - 2.18-4 * Mon Jan 15 2024 dongyuzhen <dongyuzhen@h-partners.com> - 2.18-4
- fix failure when recompiling noarch rpm and remove the require to rpm-build - fix failure when recompiling noarch rpm and remove the require to rpm-build

View File

@ -1,54 +0,0 @@
From 407ceacb5f5b987db692b48be9adc97d41f7544a Mon Sep 17 00:00:00 2001
From: lirui <lirui130@huawei.com>
Date: Mon, 26 Apr 2021 09:36:10 +0800
Subject: [PATCH] Use backups of rpmbuild and rpmspec to avoid conflicts
Because the rpmrebuild package contains the rpmbuild and rpmspec commands,
when you install the rpmrebuild and RPM -build packages at the same time,
the upgrade of one of the packages will fail due to the same name file conflict.
So rename the rpmbuild and rpmspec commands and package them.
---
rpmrebuild.sh | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/rpmrebuild.sh b/rpmrebuild.sh
index 545b348..efa6074 100755
--- a/rpmrebuild.sh
+++ b/rpmrebuild.sh
@@ -202,6 +202,9 @@ function RpmBuild
if [ -x /usr/bin/rpmbuild ]
then
BUILDCMD=/usr/bin/rpmbuild
+ elif [ -x /usr/bin/rpmbuild-rebuild ]
+ then
+ BUILDCMD=/usr/bin/rpmbuild-rebuild
else
BUILDCMD=rpm
@@ -251,11 +254,20 @@ function RpmFileName
QF_RPMFILENAME=$(eval "$change_arch" rpm "$RPMREBUILD_rpm_defines" --eval %_rpmfilename) || return
#Debug " QF_RPMFILENAME=$QF_RPMFILENAME"
# from generated specfile
- RPMFILENAME=$(eval "$change_arch" rpm "$RPMREBUILD_rpm_defines" --specfile --query --queryformat "${QF_RPMFILENAME}" "${FIC_SPEC}") || return
-
+ if [ -x /usr/bin/rpmspec ]
+ then
+ RPMFILENAME=$(eval $change_arch rpm "$RPMREBUILD_rpm_defines" --specfile --query --queryformat "${QF_RPMFILENAME}" "${FIC_SPEC}") || return
+ else
+ RPMFILENAME=$(eval $change_arch rpmspec-rebuild "$RPMREBUILD_rpm_defines" --query --queryformat "${QF_RPMFILENAME}" "${FIC_SPEC}") || return
+ fi
# workaround for redhat 6.x / rpm 3.x
local arch
- arch=$(eval "$change_arch" rpm "$RPMREBUILD_rpm_defines" --specfile --query --queryformat "%{ARCH}" "${FIC_SPEC}")
+ if [ -x /usr/bin/rpmspec ]
+ then
+ arch=$(eval $change_arch rpm "$RPMREBUILD_rpm_defines" --specfile --query --queryformat "%{ARCH}" "${FIC_SPEC}")
+ else
+ arch=$(eval $change_arch rpmspec-rebuild "$RPMREBUILD_rpm_defines" --query --queryformat "%{ARCH}" "${FIC_SPEC}")
+ fi
if [ "$arch" = "(none)" ]
then
Debug ' workaround for rpm 3.x'
--
2.33.0