From 2a69d056176edd4ef0b1f4e59eb0548a483bc6e5 Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Mon, 28 Nov 2022 19:12:44 +0100 Subject: [PATCH] Spec file: use %autosetup instead of %setup This change fixes rpminspect issues reported when building for RHEL, like the following one: Patch number 1001 (1001-Change-branding-to-IPA-and-Identity-Management.patch) is missing a corresponding %patch1001 macro, usually in %prep. Waiver Authorization: Anyone Suggested Remedy: The named patch is defined in the source RPM header (this means it has a PatchN: definition in the spec file) but is not applied anywhere in the spec file. It is missing a corresponding %patch macro and the spec file lacks the %autosetup or %autopatch macros. You can fix this by adding the appropriate %patch macro in the spec file (usually in the %prep section). The number specified with the %patch macro corresponds to the number used to define the patch at the top of the spec file. So Patch47 is applied with a %patch47 macro. Signed-off-by: Florence Blanc-Renaud Reviewed-By: Francisco Trivino --- freeipa.spec.in | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/freeipa.spec.in b/freeipa.spec.in index 1886f48d7..d49f215ad 100755 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -252,9 +252,6 @@ Patch1001: 1001-Change-branding-to-IPA-and-Identity-Management.patch %endif # RHEL spec file only: END -# For the timestamp trick in patch application -BuildRequires: diffstat - BuildRequires: openldap-devel # For KDB DAL version, make explicit dependency so that increase of version # will cause the build to fail due to unsatisfied dependencies. @@ -978,22 +975,7 @@ Custom SELinux policy module for FreeIPA %prep -# Update timestamps on the files touched by a patch, to avoid non-equal -# .pyc/.pyo files across the multilib peers within a build, where "Level" -# is the patch prefix option (e.g. -p1) -# Taken from specfile for sssd and python-simplejson -UpdateTimestamps() { - Level=$1 - PatchFile=$2 - - # Locate the affected files: - for f in $(diffstat $Level -l $PatchFile); do - # Set the files to have the same timestamp as that of the patch: - touch -c -r $PatchFile $f - done -} - -%setup -n freeipa-%{version}%{?rc_version} -q +%autosetup -n freeipa-%{version}%{?rc_version} -N -p1 # To allow proper application patches to the stripped po files, strip originals pushd po @@ -1003,10 +985,7 @@ for i in *.po ; do done popd -for p in %patches ; do - %__patch -p1 -i $p - UpdateTimestamps -p1 $p -done +%autopatch -p1 %build # PATH is workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1005235