]>
Commit | Line | Data |
---|---|---|
6ffb8678 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with pesign # sign EFI binary (pesign is NFY) | |
4 | ||
5 | Summary: Firmware update EFI binaries | |
6 | Summary(pl.UTF-8): Binaria EFI do uaktualniania firmware'u | |
7 | Name: fwupd-efi | |
4307609e | 8 | Version: 1.4 |
6bcf3768 | 9 | Release: 1 |
6ffb8678 JB |
10 | License: LGPL v2+ |
11 | Group: Base | |
12 | Source0: https://people.freedesktop.org/~hughsient/releases/%{name}-%{version}.tar.xz | |
4307609e | 13 | # Source0-md5: 40e4767a0684d614cc4e02ea24ec1fde |
6ffb8678 JB |
14 | URL: https://github.com/fwupd/fwupd-efi |
15 | BuildRequires: gnu-efi | |
16 | BuildRequires: meson >= 0.53.0 | |
17 | BuildRequires: ninja >= 1.5 | |
18 | %{?with_pesign:BuildRequires: pesign} | |
4307609e JB |
19 | BuildRequires: python3 >= 1:3.6 |
20 | BuildRequires: python3-pefile | |
6ffb8678 JB |
21 | BuildRequires: tar >= 1:1.22 |
22 | BuildRequires: xz | |
23 | Requires: fwupd >= 1.6.0 | |
6bcf3768 | 24 | ExclusiveArch: %{ix86} %{x8664} x32 %{arm} aarch64 |
6ffb8678 JB |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
26 | ||
90a7ae19 JB |
27 | %define efi_arch %(echo %{_target_base_arch} | sed -e 's/i386/ia32/;s/x86_64/x64/') |
28 | ||
29 | %define _enable_debug_packages 0 | |
6ffb8678 JB |
30 | |
31 | %description | |
32 | fwupd is a project to allow updating device firmware, and this package | |
33 | provides the EFI binary that is used for updating using UpdateCapsule. | |
34 | ||
35 | %description -l pl.UTF-8 | |
36 | fwupd to projekt pozwalający uaktualniać firmware urządzeń. Ten pakiet | |
37 | dostarcza program binarny EFI służący do uaktualniania przy użyciu | |
38 | UpdateCapsule. | |
39 | ||
40 | %package devel | |
41 | Summary: Development file for fwupd-efi | |
42 | Summary(pl.UTF-8): Plik programistyczny pakietu fwupd-efi | |
43 | Group: Development/Libraries | |
44 | ||
45 | %description devel | |
46 | Development file for fwupd-efi. | |
47 | ||
48 | Plik programistyczny pakietu fwupd-efi. | |
49 | ||
50 | %prep | |
51 | %setup -q | |
52 | ||
b039779f JB |
53 | %ifarch x32 |
54 | # -m64 is needed to build x64 EFI | |
55 | %{__sed} -i -e "/^if host_cpu == 'x86_64'/,/^elif/ s/'-mno-red-zone',/& '-m64',/" efi/meson.build | |
56 | %{__sed} -i -e 's/args\.cc, /&"-m64", /' efi/generate_sbat.py | |
57 | %endif | |
58 | ||
6ffb8678 JB |
59 | %build |
60 | %meson build \ | |
61 | -Defi_sbat_distro_id="pld" \ | |
62 | -Defi_sbat_distro_summary="PLD Linux" \ | |
63 | -Defi_sbat_distro_pkgname="%{name}" \ | |
64 | -Defi_sbat_distro_version="%{version}" \ | |
65 | -Defi_sbat_distro_url="https://pld-linux.org/" \ | |
66 | ||
67 | %ninja_build -C build | |
68 | ||
69 | %install | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
72 | %ninja_install -C build | |
73 | ||
74 | %if %{with pesign} | |
75 | %pesign -s -i $RPM_BUILD_ROOT%{_libexecdir}/fwupd/efi/fwupd%{efi_arch}.efi \ | |
76 | -o $RPM_BUILD_ROOT%{_libexecdir}/fwupd/efi/fwupd%{efi_arch}.efi.tmp | |
77 | %pesign -s -i $RPM_BUILD_ROOT%{_libexecdir}/fwupd/efi/fwupd%{efi_arch}.efi.tmp \ | |
78 | -o $RPM_BUILD_ROOT%{_libexecdir}/fwupd/efi/fwupd%{efi_arch}.efi.signed | |
79 | %{__rm} $RPM_BUILD_ROOT%{_libexecdir}/fwupd/efi/fwupd%{efi_arch}.efi.tmp | |
80 | %endif | |
81 | ||
82 | %clean | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %files | |
86 | %defattr(644,root,root,755) | |
4307609e | 87 | %doc AUTHORS COMMITMENT MAINTAINERS README.md SECURITY.md |
5a14db0c JR |
88 | %dir %{_libexecdir}/fwupd |
89 | %dir %{_libexecdir}/fwupd/efi | |
6ffb8678 JB |
90 | %{_libexecdir}/fwupd/efi/fwupd%{efi_arch}.efi |
91 | %if %{with pesign} | |
92 | %{_libexecdir}/fwupd/efi/fwupd%{efi_arch}.efi.signed | |
93 | %endif | |
94 | ||
95 | %files devel | |
96 | %defattr(644,root,root,755) | |
97 | %{_pkgconfigdir}/fwupd-efi.pc |