Make macros.pesign even better (and make it work right for i686 packages)

This commit is contained in:
Peter Jones 2012-08-15 11:42:25 -04:00
parent cc70e8687e
commit 56b5348eee
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From 3b8ca0d0068e452e7c97e761a69a34757cbd135c Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 15 Aug 2012 11:32:40 -0400
Subject: [PATCH] Simplify macros.pesign some more.
---
src/macros.pesign | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/macros.pesign b/src/macros.pesign
index 7932629..703edbb 100644
--- a/src/macros.pesign
+++ b/src/macros.pesign
@@ -6,9 +6,17 @@
# %pesign -s -i shim.orig -o shim.efi
# And magically get the right thing.
-%__pesign_token %{expand: %%{nil} %%{?pe_signing_token:-t "%%{pe_signing_token}"}}
-%__pesign_cert %{expand: %%{!?pe_signing_cert:-c "Red Hat Test Certificate"} %%{?pe_signing_cert:-c "%%{pe_signing_cert}"}}
+%__pesign_token %{nil}%{?pe_signing_token:-t "%{pe_signing_token}"}
+%__pesign_cert %{!?pe_signing_cert:-c "Red Hat Test Certificate"}%{?pe_signing_cert:-c "%{pe_signing_cert}"}
-%_pesign %{expand:%%([ %%{_arch} == x86_64 ] && echo /usr/bin/pesign || echo /usr/bin/true)}
+%_pesign /usr/bin/pesign
+
+%pesign(i:o:C:s) \
+ if [ -x %{_pesign} -a "%{_target_cpu}" == "x86_64" ]; then \
+ %{_pesign} %{__pesign_token} %{__pesign_cert} %{-i} %{-o} %{-s} \
+ else \
+ if [ -n "%{-i*}" -a -n "%{-o*}" ]; then \
+ mv %{-i*} %{-o*} \
+ fi \
+ fi ;
-%pesign %{_pesign} %{__pesign_token} %{__pesign_cert}
--
1.7.11.2

View File

@ -1,7 +1,7 @@
Summary: Signing utility for UEFI binaries
Name: pesign
Version: 0.10
Release: 3%{?dist}
Release: 4%{?dist}
Group: Development/System
License: GPLv2
URL: https://github.com/vathpela/pesign
@ -18,6 +18,7 @@ Source1: rh-test-certs.tar.bz2
Patch0: pesign-0.10-better-macros.patch
Patch1: pesign-0.10-only-sign-on-x86-64.patch
Patch2: pesign-0.10-even-better-macros.patch
%description
This package contains the pesign utility for signing UEFI binaries as
@ -58,6 +59,9 @@ rm -rf %{buildroot}
%attr(0644,root,root) /etc/pki/pesign/*
%changelog
* Wed Aug 15 2012 Peter Jones <pjones@redhat.com> - 0.10-4
- Make macros.pesign even better (and make it work right for i686 packages)
* Tue Aug 14 2012 Peter Jones <pjones@redhat.com> - 0.10-3
- Only sign things on x86_64; all else ignore gracefully.