Update to version 3 to try and un-break rawhide composes due to

ExclusiveArch constraints.

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2018-05-04 13:53:51 -04:00
parent ce43d30f37
commit 0f7f353dae
13 changed files with 8 additions and 793 deletions

View File

@ -1,47 +0,0 @@
From 8c4a55209bcb054b610c613ac2f1b2ad25253a20 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 1 May 2018 12:54:05 -0400
Subject: [PATCH 01/11] Simplify %efi_arch_upper
Signed-off-by: Peter Jones <pjones@redhat.com>
---
macros.efi.in | 25 ++-----------------------
1 file changed, 2 insertions(+), 23 deletions(-)
diff --git a/macros.efi.in b/macros.efi.in
index 953dcfb1200..d935fd23da1 100644
--- a/macros.efi.in
+++ b/macros.efi.in
@@ -53,27 +53,6 @@ end
}
%efi_arch_upper %{lua:
--- test if our arch matches
-local function ifarch(archmacro)
- local target = rpm.expand(" %{_target_cpu} ")
- local arches = rpm.expand(" " .. archmacro .. " ")
- local match = string.match(arches, target)
- if not (match == nil) then
- return true
- end
-end
--- Do the work
-if ifarch("x86_64") then
- print("X64")
-elseif ifarch("%{ix86}") then
- print("IA32")
-elseif ifarch("aarch64") then
- print("AA64")
-elseif ifarch("%{arm}") then
- print("ARM")
-elseif ifarch("ia64") then
- print("IA64")
-else
- print("")
-end
+ local arch = rpm.expand("%{efi_arch}")
+ print(string.upper(arch))
}
--
2.14.3

View File

@ -1,26 +0,0 @@
From 4f7a7e6084bfbc28f194ab63a76239a622c7baad Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 1 May 2018 12:55:44 -0400
Subject: [PATCH 02/11] Add a changelog entry to the .spec for version 2.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
efi-rpm-macros.spec.in | 3 +++
1 file changed, 3 insertions(+)
diff --git a/efi-rpm-macros.spec.in b/efi-rpm-macros.spec.in
index 882f679aca9..c89fb6caf5e 100644
--- a/efi-rpm-macros.spec.in
+++ b/efi-rpm-macros.spec.in
@@ -43,5 +43,8 @@ Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-
%{_rpmmacrodir}/*
%changelog
+* Tue May 01 2018 Peter Jones <pjones@redhat.com> - 2-1
+- Lots of rpmlint fixups and the like.
+
* Mon Apr 30 2018 Peter Jones <pjones@redhat.com> - 1-1
- First shot at building it.
--
2.14.3

View File

@ -1,44 +0,0 @@
From 341b613d7b920292129ae689e9f7588073a08431 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 1 May 2018 13:26:18 -0400
Subject: [PATCH 03/11] efi-rpm-macros.spec.in: use autosetup
Signed-off-by: Peter Jones <pjones@redhat.com>
---
efi-rpm-macros.spec.in | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/efi-rpm-macros.spec.in b/efi-rpm-macros.spec.in
index c89fb6caf5e..fa68b1dd7b1 100644
--- a/efi-rpm-macros.spec.in
+++ b/efi-rpm-macros.spec.in
@@ -6,8 +6,7 @@ Group: Development/System
License: GPLv3+
URL: https://github.com/rhboot/%{name}/
ExclusiveArch: @@EFI_ARCHES@@
-#BuildRequires: git
-BuildRequires: sed
+BuildRequires: git sed
Requires: rpm
BuildArch: noarch
@@ -20,15 +19,7 @@ Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-
%{name} provides a set of RPM macros for use in EFI-related packages.
%prep
-%setup -q
-#git init
-#git config user.email "example@example.com"
-#git config user.name "RPM Ninjas"
-#git add .
-#git commit -a -q -m "%%{version} baseline."
-#git am %%{patches} </dev/null
-#git config --unset user.email
-#git config --unset user.name
+%autosetup -S git
%build
%make_build EFI_VENDOR=%{_efi_vendor_} clean all
--
2.14.3

View File

@ -1,71 +0,0 @@
From d50b6eb13b00579e89747baa6a6be142930f3f94 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 1 May 2018 13:39:47 -0400
Subject: [PATCH 04/11] Add %efi_alt_arch and %efi_alt_arch_upper
Signed-off-by: Peter Jones <pjones@redhat.com>
---
README | 18 ++++++++++--------
macros.efi.in | 23 +++++++++++++++++++++++
2 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/README b/README
index 23601c763b0..c3474a1d863 100644
--- a/README
+++ b/README
@@ -8,11 +8,13 @@ EFI_VENDOR the vendor name for your EFI System Partition directory
The following rpm macros are set:
-%efi the arches that EFI packages should be built on, suitable for use with %ifarch
-%efi_vendor the vendor name for your EFI System Partition directory
-%efi_esp_root the directory where the EFI system Partition is mounted
-%efi_esp_efi the full path to \EFI on the EFI System Partition
-%efi_esp_boot the full path to \EFI\BOOT on the EFI System Partition
-%efi_esp_dir the full path to your vendor directory on the EFI System Partition
-%efi_arch the EFI architecture name, e.g. x64
-%efi_arch_upper the EFI architecture name in upper case, e.g. X64
+%efi the arches that EFI packages should be built on, suitable for use with %ifarch
+%efi_vendor the vendor name for your EFI System Partition directory
+%efi_esp_root the directory where the EFI system Partition is mounted
+%efi_esp_efi the full path to \EFI on the EFI System Partition
+%efi_esp_boot the full path to \EFI\BOOT on the EFI System Partition
+%efi_esp_dir the full path to your vendor directory on the EFI System Partition
+%efi_arch the EFI architecture name, e.g. x64
+%efi_arch_upper the EFI architecture name in upper case, e.g. X64
+%efi_alt_arch the EFI architecture name for other arches that build on this one (i.e. ia32 on x64)
+%efi_alt_arch_upper the upper case version of %efi_alt_arch
diff --git a/macros.efi.in b/macros.efi.in
index d935fd23da1..e03b9011e9d 100644
--- a/macros.efi.in
+++ b/macros.efi.in
@@ -56,3 +56,26 @@ end
local arch = rpm.expand("%{efi_arch}")
print(string.upper(arch))
}
+
+%efi_alt_arch %{lua:
+-- test if our arch matches
+local function ifarch(archmacro)
+ local target = rpm.expand(" %{_target_cpu} ")
+ local arches = rpm.expand(" " .. archmacro .. " ")
+ local match = string.match(arches, target)
+ if not (match == nil) then
+ return true
+ end
+end
+-- Do the work
+if ifarch("x86_64") then
+ print("ia32")
+else
+ print("")
+end
+}
+
+%efi_alt_arch_upper %{lua:
+ local arch = rpm.expand("%{efi_alt_arch}")
+ print(string.upper(arch))
+}
--
2.14.3

View File

@ -1,55 +0,0 @@
From 1103d2ae35a3702b79b5dc32fc72b7b21711829e Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 1 May 2018 13:45:29 -0400
Subject: [PATCH 05/11] Return %{nil} instead of "" on unsupported arches
Signed-off-by: Peter Jones <pjones@redhat.com>
---
macros.efi.in | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/macros.efi.in b/macros.efi.in
index e03b9011e9d..a0bd67d9b69 100644
--- a/macros.efi.in
+++ b/macros.efi.in
@@ -48,13 +48,17 @@ elseif ifarch("%{arm}") then
elseif ifarch("ia64") then
print("ia64")
else
- print("")
+ print("%{nil}")
end
}
%efi_arch_upper %{lua:
local arch = rpm.expand("%{efi_arch}")
- print(string.upper(arch))
+ if arch == '%{nil}'
+ print(arch)
+ else
+ print(string.upper(arch))
+ end
}
%efi_alt_arch %{lua:
@@ -71,11 +75,15 @@ end
if ifarch("x86_64") then
print("ia32")
else
- print("")
+ print("%{nil}")
end
}
%efi_alt_arch_upper %{lua:
local arch = rpm.expand("%{efi_alt_arch}")
- print(string.upper(arch))
+ if arch == '%{nil}'
+ print(arch)
+ else
+ print(string.upper(arch))
+ end
}
--
2.14.3

View File

@ -1,57 +0,0 @@
From 3f4b280e8578d4de3d03b4af205106813a2fdbd1 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 1 May 2018 14:44:17 -0400
Subject: [PATCH 06/11] %efi_arch: turns out %{nil} is definitely not what we
want.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
macros.efi.in | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/macros.efi.in b/macros.efi.in
index a0bd67d9b69..f4c70617ae7 100644
--- a/macros.efi.in
+++ b/macros.efi.in
@@ -48,17 +48,14 @@ elseif ifarch("%{arm}") then
elseif ifarch("ia64") then
print("ia64")
else
- print("%{nil}")
+ rpm.expand("%%{error:Not an EFI architecture}")
+ print("")
end
}
%efi_arch_upper %{lua:
local arch = rpm.expand("%{efi_arch}")
- if arch == '%{nil}'
- print(arch)
- else
- print(string.upper(arch))
- end
+ print(string.upper(arch))
}
%efi_alt_arch %{lua:
@@ -75,15 +72,11 @@ end
if ifarch("x86_64") then
print("ia32")
else
- print("%{nil}")
+ print("")
end
}
%efi_alt_arch_upper %{lua:
local arch = rpm.expand("%{efi_alt_arch}")
- if arch == '%{nil}'
- print(arch)
- else
- print(string.upper(arch))
- end
+ print(string.upper(arch))
}
--
2.14.3

View File

@ -1,123 +0,0 @@
From 09efa919eb4a85bd77fe8d482f4c369e1fc29ed7 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 1 May 2018 15:42:01 -0400
Subject: [PATCH 07/11] Make a macros.efi-srpm that defines %{efi}
Signed-off-by: Peter Jones <pjones@redhat.com>
---
Makefile | 3 ++-
.gitignore | 1 +
efi-rpm-macros.spec.in | 17 ++++++++++++++++-
macros.efi-srpm.in | 20 ++++++++++++++++++++
macros.efi.in | 2 +-
5 files changed, 40 insertions(+), 3 deletions(-)
create mode 100644 macros.efi-srpm.in
diff --git a/Makefile b/Makefile
index 53f10c5a9eb..b9a04dddb5d 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ EFI_ESP_ROOT ?= /boot/efi
EFI_ARCHES ?= x86_64 aarch64 %{arm} %{ix86}
EFI_VENDOR ?=
-TARGETS = macros.efi efi-rpm-macros.spec
+TARGETS = macros.efi macros.efi-srpm efi-rpm-macros.spec
check_efi_vendor :
ifeq ($(EFI_VENDOR),)
@@ -35,6 +35,7 @@ install : | check_efi_vendor
install : $(TARGETS)
install -d -m 0755 $(DESTDIR)/$(MACRODIR)
install -m 0644 macros.efi $(DESTDIR)/$(MACRODIR)/
+ install -m 0644 macros.efi-srpm $(DESTDIR)/$(MACRODIR)/
$(TARGETS) :
% : %.in
diff --git a/.gitignore b/.gitignore
index 6c98e5354ab..8365ee70797 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
*~
.*.sw?
macros.efi
+macros.efi-srpm
efi-rpm-macros.spec
*.tar.*
usr/
diff --git a/efi-rpm-macros.spec.in b/efi-rpm-macros.spec.in
index fa68b1dd7b1..5aa11d4c903 100644
--- a/efi-rpm-macros.spec.in
+++ b/efi-rpm-macros.spec.in
@@ -18,6 +18,15 @@ Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-
%description
%{name} provides a set of RPM macros for use in EFI-related packages.
+%package -n efi-srpm-macros
+Summary: Common SRPM Macros for building EFI-related packages
+Group: Development/System
+BuildArch: noarch
+Requires: rpm
+
+%description -n efi-srpm-macros
+efi-srpm-macros provides a set of SRPM macros for use in EFI-related packages.
+
%prep
%autosetup -S git
@@ -31,7 +40,13 @@ Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
-%{_rpmmacrodir}/*
+%{_rpmmacrodir}/macros.efi
+
+%files -n efi-srpm-macros
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc README
+%{_rpmmacrodir}/macros.efi-srpm
%changelog
* Tue May 01 2018 Peter Jones <pjones@redhat.com> - 2-1
diff --git a/macros.efi-srpm.in b/macros.efi-srpm.in
new file mode 100644
index 00000000000..7192b07ba6c
--- /dev/null
+++ b/macros.efi-srpm.in
@@ -0,0 +1,20 @@
+#
+# EFI specific SRPM macro definitions
+#
+# Copyright 2018 Peter M Jones <pjones@redhat.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+
+%efi @@EFI_ARCHES@@
diff --git a/macros.efi.in b/macros.efi.in
index f4c70617ae7..c61b3972f2d 100644
--- a/macros.efi.in
+++ b/macros.efi.in
@@ -1,5 +1,5 @@
#
-# EFI specific macro definitions
+# EFI specific RPM macro definitions
#
# Copyright 2018 Peter M Jones <pjones@redhat.com>
#
--
2.14.3

View File

@ -1,30 +0,0 @@
From a4358f78316160cf29e177daedf9562e6a0505f2 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 2 May 2018 10:09:19 -0400
Subject: [PATCH 08/11] Add %{efi_has_alt_arch} ("0" or "1")
Signed-off-by: Peter Jones <pjones@redhat.com>
---
macros.efi.in | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/macros.efi.in b/macros.efi.in
index c61b3972f2d..66139a257d5 100644
--- a/macros.efi.in
+++ b/macros.efi.in
@@ -80,3 +80,12 @@ end
local arch = rpm.expand("%{efi_alt_arch}")
print(string.upper(arch))
}
+
+%efi_has_alt_arch %{lua:
+ local arch = rpm.expand("%{efi_alt_arch}")
+ if arch == "" then
+ print("0")
+ else
+ print("1")
+ end
+}
--
2.14.3

View File

@ -1,81 +0,0 @@
From 309396c167bcd9ae6219e70e7e2b93ec5b773939 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 2 May 2018 10:48:28 -0400
Subject: [PATCH 09/11] Add efi-filesystem subpackage
Signed-off-by: Peter Jones <pjones@redhat.com>
---
Makefile | 6 ++++++
efi-rpm-macros.spec.in | 21 +++++++++++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index b9a04dddb5d..cf7cf956e8a 100644
--- a/Makefile
+++ b/Makefile
@@ -36,6 +36,12 @@ install : $(TARGETS)
install -d -m 0755 $(DESTDIR)/$(MACRODIR)
install -m 0644 macros.efi $(DESTDIR)/$(MACRODIR)/
install -m 0644 macros.efi-srpm $(DESTDIR)/$(MACRODIR)/
+ if [[ "$(EFI_ESP_ROOT)" != /boot ]] ; then \
+ install -d -m 0755 $(DESTDIR)/boot ; \
+ fi
+ install -d -m 0700 $(DESTDIR)/$(EFI_ESP_ROOT)
+ install -d -m 0700 $(DESTDIR)/$(EFI_ESP_ROOT)/EFI/BOOT
+ install -d -m 0700 $(DESTDIR)/$(EFI_ESP_ROOT)/EFI/$(EFI_VENDOR)
$(TARGETS) :
% : %.in
diff --git a/efi-rpm-macros.spec.in b/efi-rpm-macros.spec.in
index 5aa11d4c903..fce2f5ff296 100644
--- a/efi-rpm-macros.spec.in
+++ b/efi-rpm-macros.spec.in
@@ -7,7 +7,7 @@ License: GPLv3+
URL: https://github.com/rhboot/%{name}/
ExclusiveArch: @@EFI_ARCHES@@
BuildRequires: git sed
-Requires: rpm
+Requires: efi-filesystem rpm
BuildArch: noarch
Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2
@@ -22,11 +22,21 @@ Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-
Summary: Common SRPM Macros for building EFI-related packages
Group: Development/System
BuildArch: noarch
-Requires: rpm
+Requires: efi-filesystem rpm
%description -n efi-srpm-macros
efi-srpm-macros provides a set of SRPM macros for use in EFI-related packages.
+%package -n efi-filesystem
+Summary: The basic directory layout for EFI machines
+Group: System Environment/Base
+BuildArch: noarch
+Requires: filesystem
+
+%description -n efi-filesystem
+The efi-filesystem package contains the basic directory layout for EFI
+machine bootloaders and tools.
+
%prep
%autosetup -S git
@@ -48,6 +58,13 @@ efi-srpm-macros provides a set of SRPM macros for use in EFI-related packages.
%doc README
%{_rpmmacrodir}/macros.efi-srpm
+%files -n efi-filesystem
+%defattr(0700,root,root,-)
+%dir %{efi_esp_root}
+%dir %{efi_esp_efi}
+%dir %{efi_esp_dir}
+%dir %{efi_esp_boot}
+
%changelog
* Tue May 01 2018 Peter Jones <pjones@redhat.com> - 2-1
- Lots of rpmlint fixups and the like.
--
2.14.3

View File

@ -1,33 +0,0 @@
From 625cc7b2fdba3e489865c42fddc48b72b3bfecd4 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 2 May 2018 11:26:04 -0400
Subject: [PATCH 10/11] efi-rpm-macros.spec: don't use efi-rpm-macros
definitions for paths
Signed-off-by: Peter Jones <pjones@redhat.com>
---
efi-rpm-macros.spec.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/efi-rpm-macros.spec.in b/efi-rpm-macros.spec.in
index fce2f5ff296..1835d20e08f 100644
--- a/efi-rpm-macros.spec.in
+++ b/efi-rpm-macros.spec.in
@@ -60,10 +60,10 @@ machine bootloaders and tools.
%files -n efi-filesystem
%defattr(0700,root,root,-)
-%dir %{efi_esp_root}
-%dir %{efi_esp_efi}
-%dir %{efi_esp_dir}
-%dir %{efi_esp_boot}
+%dir /boot/efi
+%dir /boot/efi/EFI
+%dir /boot/efi/EFI/BOOT
+%dir /boot/efi/EFI/%{_efi_vendor_}
%changelog
* Tue May 01 2018 Peter Jones <pjones@redhat.com> - 2-1
--
2.14.3

View File

@ -1,209 +0,0 @@
From 4031861b2964d24079827dea48a8e667cf96fd33 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 3 May 2018 09:38:48 -0400
Subject: [PATCH 11/11] Do it differently.
---
Makefile | 5 ++--
efi-rpm-macros.spec.in | 10 +++----
macros.efi-srpm.in | 61 ++++++++++++++++++++++++++++++++++++++++-
macros.efi.in | 73 --------------------------------------------------
4 files changed, 68 insertions(+), 81 deletions(-)
diff --git a/Makefile b/Makefile
index cf7cf956e8a..a3e20ec0bea 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,8 @@ EFI_ESP_ROOT ?= /boot/efi
EFI_ARCHES ?= x86_64 aarch64 %{arm} %{ix86}
EFI_VENDOR ?=
-TARGETS = macros.efi macros.efi-srpm efi-rpm-macros.spec
+# TARGETS = macros.efi macros.efi-srpm efi-rpm-macros.spec
+TARGETS = macros.efi-srpm efi-rpm-macros.spec
check_efi_vendor :
ifeq ($(EFI_VENDOR),)
@@ -34,7 +35,7 @@ clean :
install : | check_efi_vendor
install : $(TARGETS)
install -d -m 0755 $(DESTDIR)/$(MACRODIR)
- install -m 0644 macros.efi $(DESTDIR)/$(MACRODIR)/
+ # install -m 0644 macros.efi $(DESTDIR)/$(MACRODIR)/
install -m 0644 macros.efi-srpm $(DESTDIR)/$(MACRODIR)/
if [[ "$(EFI_ESP_ROOT)" != /boot ]] ; then \
install -d -m 0755 $(DESTDIR)/boot ; \
diff --git a/efi-rpm-macros.spec.in b/efi-rpm-macros.spec.in
index 1835d20e08f..0ab82ca295d 100644
--- a/efi-rpm-macros.spec.in
+++ b/efi-rpm-macros.spec.in
@@ -46,11 +46,11 @@ machine bootloaders and tools.
%install
%make_install EFI_VENDOR=%{_efi_vendor_}
-%files
-%{!?_licensedir:%global license %%doc}
-%license LICENSE
-%doc README
-%{_rpmmacrodir}/macros.efi
+#%%files
+#%%{!?_licensedir:%%global license %%%%doc}
+#%%license LICENSE
+#%%doc README
+#%%{_rpmmacrodir}/macros.efi
%files -n efi-srpm-macros
%{!?_licensedir:%global license %%doc}
diff --git a/macros.efi-srpm.in b/macros.efi-srpm.in
index 7192b07ba6c..2630f28e72e 100644
--- a/macros.efi-srpm.in
+++ b/macros.efi-srpm.in
@@ -17,4 +17,63 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
-%efi @@EFI_ARCHES@@
+%_efi_rpm_macros_setup() %{expand:%{lua:
+ -- test if our arch matches
+ local function ifarch(archmacro)
+ local target = rpm.expand(" %{_target_cpu} ")
+ local arches = rpm.expand(" " .. archmacro .. " ")
+ local match = string.match(arches, target)
+ if not (match == nil) then
+ return true
+ end
+ end
+ -- give us the arch...
+ local function getarch()
+ if ifarch("ia64") then
+ return("ia64")
+ elseif ifarch("x86_64") then
+ return("x64")
+ elseif ifarch("%{ix86}") then
+ return("ia32")
+ elseif ifarch("aarch64") then
+ return("aa64")
+ elseif ifarch("%{arm}") then
+ return("arm")
+ end
+ end
+ -- alt arch
+ local function getaltarch()
+ if ifarch("x86_64") then
+ return("ia32")
+ else
+ return(nil)
+ end
+ end
+ -- make some macros
+ local done = rpm.expand("%{?_efi}")
+ if done == nil or done == "" then
+ local alt = getaltarch()
+ print("%global _efi @@EFI_ARCHES@@\\n")
+ print("%global _efi_vendor @@EFI_VENDOR@@\\n")
+ print("%global _efi_arch " .. getarch() .. "\\n")
+ print("%global _efi_arch_upper " .. string.upper(getarch()) .. "\\n")
+ if not (alt == nil or alt == "") then
+ print("%global _efi_alt_arch " .. alt .. "\\n")
+ print("%global _efi_alt_arch_upper " .. string.upper(alt) .. "\\n")
+ end
+ end
+}}%{expand:%{?_efi_alt_arch:%global efi_alt_arch %%{_efi_alt_arch}%global efi_alt_arch_upper %%{_efi_alt_arch_upper}}}
+
+%efi_rpm_macros_version %{expand:%{_efi_rpm_macros_setup}}@@EFI_RPM_MACROS_VERSION@@
+
+%efi %{expand:%{_efi_rpm_macros_setup}}%{expand:%{_efi}}
+%efi_vendor %{expand:%{_efi_rpm_macros_setup}}%{expand:%{_efi_vendor}}
+
+%efi_esp_root @@EFI_ESP_ROOT@@
+%efi_esp_efi %{efi_esp_root}/EFI
+%efi_esp_boot %{efi_esp_efi}/BOOT
+%efi_esp_dir %{expand:%{_efi_rpm_macros_setup}}%{efi_esp_efi}/%{efi_vendor}
+
+%efi_arch %{expand:%{_efi_rpm_macros_setup}}%{_efi_arch}
+%efi_arch_upper %{expand:%{_efi_rpm_macros_setup}}%{_efi_arch_upper}
+%efi_has_alt_arch %{expand:%{_efi_rpm_macros_setup}}0%{?_efi_alt_arch:1}
diff --git a/macros.efi.in b/macros.efi.in
index 66139a257d5..56c9ea0138a 100644
--- a/macros.efi.in
+++ b/macros.efi.in
@@ -16,76 +16,3 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
-
-%efi @@EFI_ARCHES@@
-
-%efi_vendor @@EFI_VENDOR@@
-
-%efi_esp_root @@EFI_ESP_ROOT@@
-%efi_esp_efi %{efi_esp_root}/EFI
-%efi_esp_boot %{efi_esp_efi}/BOOT
-%efi_esp_dir %{efi_esp_efi}/%{efi_vendor}
-
-%efi_arch %{lua:
--- test if our arch matches
-local function ifarch(archmacro)
- local target = rpm.expand(" %{_target_cpu} ")
- local arches = rpm.expand(" " .. archmacro .. " ")
- local match = string.match(arches, target)
- if not (match == nil) then
- return true
- end
-end
--- Do the work
-if ifarch("x86_64") then
- print("x64")
-elseif ifarch("%{ix86}") then
- print("ia32")
-elseif ifarch("aarch64") then
- print("aa64")
-elseif ifarch("%{arm}") then
- print("arm")
-elseif ifarch("ia64") then
- print("ia64")
-else
- rpm.expand("%%{error:Not an EFI architecture}")
- print("")
-end
-}
-
-%efi_arch_upper %{lua:
- local arch = rpm.expand("%{efi_arch}")
- print(string.upper(arch))
-}
-
-%efi_alt_arch %{lua:
--- test if our arch matches
-local function ifarch(archmacro)
- local target = rpm.expand(" %{_target_cpu} ")
- local arches = rpm.expand(" " .. archmacro .. " ")
- local match = string.match(arches, target)
- if not (match == nil) then
- return true
- end
-end
--- Do the work
-if ifarch("x86_64") then
- print("ia32")
-else
- print("")
-end
-}
-
-%efi_alt_arch_upper %{lua:
- local arch = rpm.expand("%{efi_alt_arch}")
- print(string.upper(arch))
-}
-
-%efi_has_alt_arch %{lua:
- local arch = rpm.expand("%{efi_alt_arch}")
- if arch == "" then
- print("0")
- else
- print("1")
- end
-}
--
2.14.3

View File

@ -1,27 +1,14 @@
Summary: Common RPM Macros for building EFI-related packages
Name: efi-rpm-macros
Version: 2
Release: 6%{?dist}
Version: 3
Release: 1%{?dist}
Group: Development/System
License: GPLv3+
URL: https://github.com/rhboot/%{name}/
ExclusiveArch: x86_64 aarch64 %{arm} %{ix86}
BuildRequires: git sed
Requires: efi-filesystem rpm
BuildArch: noarch
Source0: https://github.com/rhboot/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2
Patch0001: 0001-Simplify-efi_arch_upper.patch
Patch0002: 0002-Add-a-changelog-entry-to-the-.spec-for-version-2.patch
Patch0003: 0003-efi-rpm-macros.spec.in-use-autosetup.patch
Patch0004: 0004-Add-efi_alt_arch-and-efi_alt_arch_upper.patch
Patch0005: 0005-Return-nil-instead-of-on-unsupported-arches.patch
Patch0006: 0006-efi_arch-turns-out-nil-is-definitely-not-what-we-wan.patch
Patch0007: 0007-Make-a-macros.efi-srpm-that-defines-efi.patch
Patch0008: 0008-Add-efi_has_alt_arch-0-or-1.patch
Patch0009: 0009-Add-efi-filesystem-subpackage.patch
Patch0010: 0010-efi-rpm-macros.spec-don-t-use-efi-rpm-macros-definit.patch
Patch0011: 0011-Do-it-differently.patch
%global debug_package %{nil}
%global _efi_vendor_ %(eval sed -n -e 's/rhel/redhat/' -e 's/^ID=//p' /etc/os-release)
@ -33,7 +20,7 @@ Patch0011: 0011-Do-it-differently.patch
Summary: Common SRPM Macros for building EFI-related packages
Group: Development/System
BuildArch: noarch
Requires: efi-filesystem rpm
Requires: rpm
%description -n efi-srpm-macros
efi-srpm-macros provides a set of SRPM macros for use in EFI-related packages.
@ -77,6 +64,10 @@ machine bootloaders and tools.
%dir /boot/efi/EFI/%{_efi_vendor_}
%changelog
* Fri May 04 2018 Peter Jones <pjones@redhat.com> - 3-1
- Update to version 3 to try and un-break rawhide composes due to
ExclusiveArch constraints.
* Thu May 03 2018 Peter Jones <pjones@redhat.com> - 2-6
- Rework the macros for better srpm use.

View File

@ -1 +1 @@
SHA512 (efi-rpm-macros-2.tar.bz2) = d232aedc3ed9e833d4d60a63360a6f68bb4696947204045c95ef938e135744d64caa0c17bed35b1f8d9d74a86ed198f89eb52b5c7d4ebaa4c4cf66a88d2bc418
SHA512 (efi-rpm-macros-3.tar.bz2) = 0fba0b2e9d08f4da28eb3305f82a02e5d1787800c9e5dee8e78add3572935f80bf823318495763b126e8d79c927913ae4e9087533011032cd13175ed09955ac6