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

(cherry picked from commit a7e40e58ed08e889e84deae01d4c5ea252694025)
This commit is contained in:
dongyuzhen 2024-01-19 17:14:10 +08:00 committed by openeuler-sync-bot
parent 637c0c32e5
commit ffc85ae410
2 changed files with 8 additions and 63 deletions

View File

@ -1,6 +1,6 @@
Name: rpmrebuild
Version: 2.16
Release: 11
Release: 12
Summary: A tool to build a rpm file from the rpm database
License: GPLv2+
URL: http://rpmrebuild.sourceforge.net
@ -15,14 +15,11 @@ Patch9005: fix-comment-missing-n-does-not-work.patch
Patch9006: fix-r-does-not-work.patch
Patch9007: fix-errors-found-from-shellcheck-scan.patch
Patch9008: Add-macros-_binaries_in_noarch_packages_terminate_bu.patch
Patch9009: use-backups-of-rpmbuild-and-rpmspec-to-avoid-conflicts.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: rpm-build
Requires: grep bash cpio textutils
Requires: rpm grep bash cpio textutils rpm-build
%define _binaries_in_noarch_packages_terminate_build 0
%description
%{name} allows to build an rpm file from an installed rpm, or from
@ -48,9 +45,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/
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
%defattr(-,root,root)
%doc AUTHORS
@ -63,8 +57,6 @@ cp /usr/bin/rpmspec $RPM_BUILD_ROOT%{_bindir}/rpmspec-rebuild
%{_prefix}/lib/rpmrebuild/plugins/*.plug
%{_prefix}/lib/rpmrebuild/locale/*
%{_prefix}/lib/rpmrebuild/optional_tags.cfg
%{_bindir}/rpmbuild-rebuild
%{_bindir}/rpmspec-rebuild
%files help
%defattr(-,root,root)
@ -74,6 +66,12 @@ cp /usr/bin/rpmspec $RPM_BUILD_ROOT%{_bindir}/rpmspec-rebuild
%{_mandir}/fr/man1/*.gz
%changelog
* Fri Jan 19 2024 dongyuzhen <dongyuzhen@h-partners.com> - 2.16-12
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:revert: remove the require to rpm-build.For consistency with other community-released dependencies
* Mon Jan 15 2024 dongyuzhen <dongyuzhen@h-partners.com> - 2.16-11
- Type:bugfix
- CVE:NA

View File

@ -1,53 +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 2da043e..5800cca 100755
--- a/rpmrebuild.sh
+++ b/rpmrebuild.sh
@@ -192,6 +192,9 @@ function RpmBuild
if [ -x /usr/bin/rpmbuild ]
then
local BUILDCMD=/usr/bin/rpmbuild
+ elif [ -x /usr/bin/rpmbuild-rebuild ]
+ then
+ local BUILDCMD=/usr/bin/rpmbuild-rebuild
else
local BUILDCMD=rpm
@@ -231,10 +234,19 @@ function RpmFileName
local QF_RPMFILENAME=$(eval $change_arch rpm $rpm_defines --eval %_rpmfilename) || return
#Debug " QF_RPMFILENAME=$QF_RPMFILENAME"
# from generated specfile
- RPMFILENAME=$(eval $change_arch rpm $rpm_defines --specfile --query --queryformat "${QF_RPMFILENAME}" ${FIC_SPEC}) || return
-
+ if [ -x /usr/bin/rpmspec ]
+ then
+ RPMFILENAME=$(eval $change_arch rpm $rpm_defines --specfile --query --queryformat "${QF_RPMFILENAME}" ${FIC_SPEC}) || return
+ else
+ RPMFILENAME=$(eval $change_arch rpmspec-rebuild $rpm_defines --query --queryformat "${QF_RPMFILENAME}" ${FIC_SPEC}) || return
+ fi
# workaround for redhat 6.x / rpm 3.x
- local arch=$(eval $change_arch rpm $rpm_defines --specfile --query --queryformat "%{ARCH}" ${FIC_SPEC})
+ if [ -x /usr/bin/rpmspec ]
+ then
+ local arch=$(eval $change_arch rpm $rpm_defines --specfile --query --queryformat "%{ARCH}" ${FIC_SPEC})
+ else
+ local arch=$(eval $change_arch rpmspec-rebuild $rpm_defines --query --queryformat "%{ARCH}" ${FIC_SPEC})
+ fi
if [ "$arch" = "(none)" ]
then
Debug ' workaround for rpm 3.x'
--
2.33.0