[packages/rpm/rpm.org] add bcond for building with cheating (disabled by default)

atler atler at pld-linux.org
Fri Oct 30 22:00:26 CET 2020


commit de65aff60039f593b7c63381fd3349af1e45b7e3
Author: Jan Palus <atler at pld-linux.org>
Date:   Fri Oct 30 21:58:08 2020 +0100

    add bcond for building with cheating (disabled by default)
    
    don't produce broken packages in short-circuted builds

 rpm-enable_cheating.patch | 14 ++++++++++++++
 rpm.spec                  |  5 +++++
 2 files changed, 19 insertions(+)
---
diff --git a/rpm.spec b/rpm.spec
index 16f66cd..808ffeb 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -8,6 +8,7 @@
 %bcond_without	plugins		# build plugins
 %bcond_without	recommends_tags	# build without Recommends tag (bootstrapping)
 %bcond_with	imaevm		# build with IMA/EVM support (requires libimaevm from ima-evm-utils)
+%bcond_with	cheating	# do not add spurious deps to short-circuited builds
 
 %define		db_ver		5.3.28.0
 %define		popt_ver	1.15
@@ -74,6 +75,7 @@ Patch19:	pkgconfig.patch
 Patch20:	uname-deps.patch
 Patch21:	aarch64.patch
 Patch22:	ix86-platforms.patch
+Patch23:	%{name}-enable_cheating.patch
 URL:		https://rpm.org/
 BuildRequires:	acl-devel
 BuildRequires:	db-devel >= %{db_ver}
@@ -562,6 +564,9 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
 %patch20 -p1
 %patch21 -p1
 %patch22 -p1
+%if %{with cheating}
+%patch23 -p1
+%endif
 
 install %{SOURCE15} scripts/perl.prov.in
 
diff --git a/rpm-enable_cheating.patch b/rpm-enable_cheating.patch
new file mode 100644
index 0000000..bd032ed
--- /dev/null
+++ b/rpm-enable_cheating.patch
@@ -0,0 +1,14 @@
+diff --color -urN rpm-4.16.0.orig/build/pack.c rpm-4.16.0/build/pack.c
+--- rpm-4.16.0.orig/build/pack.c	2020-06-23 14:13:01.894628368 +0200
++++ rpm-4.16.0/build/pack.c	2020-10-30 21:38:40.630227852 +0100
+@@ -709,10 +709,6 @@
+ 	headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
+     }
+ 
+-    if (cheating) {
+-	(void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1");
+-    }
+-
+     if ((rc = getPkgFilename(pkg->header, filename)))
+ 	return rc;
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/de65aff60039f593b7c63381fd3349af1e45b7e3



More information about the pld-cvs-commit mailing list