]>
Commit | Line | Data |
---|---|---|
3b56ddd5 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with pesign # EFI apps signing with pesign | |
4 | # | |
5 | Summary: Tools to manage UEFI firmware updates | |
6 | Summary(pl.UTF-8): Narzędzia do zarządzania aktualizacjami firmware'u przez UEFI | |
7 | Name: fwupdate | |
4015a93f | 8 | Version: 9 |
dfca3020 | 9 | Release: 2 |
3b56ddd5 JB |
10 | License: GPL v2 |
11 | Group: Libraries | |
a3b339a3 | 12 | Source0: https://github.com/rhinstaller/fwupdate/archive/%{version}/%{name}-%{version}.tar.gz |
4015a93f | 13 | # Source0-md5: 0ce656b18a60256a7cf9fa42fd5d99de |
66bfa4f8 | 14 | Patch0: %{name}-overflow.patch |
4015a93f | 15 | Patch1: %{name}-undefined.patch |
3b56ddd5 | 16 | URL: https://github.com/rhinstaller/fwupdate |
4015a93f | 17 | BuildRequires: efivar-devel >= 0.30 |
3b56ddd5 | 18 | BuildRequires: gnu-efi |
dfca3020 | 19 | BuildRequires: libsmbios-devel |
3b56ddd5 JB |
20 | %{?with_pesign:BuildRequires: pesign} |
21 | BuildRequires: popt-devel | |
22 | BuildRequires: sed >= 4.0 | |
23 | Requires: %{name}-libs = %{version}-%{release} | |
a3b339a3 | 24 | #Requires(post): efibootmgr >= 0.12 |
dfca3020 | 25 | ExclusiveArch: %{ix86} %{x8664} x32 %{arm} aarch64 ia64 |
3b56ddd5 JB |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
27 | ||
28 | %define efidir pld | |
29 | ||
30 | %description | |
31 | fwupdate provides a simple command line interface to the UEFI firmware | |
32 | updates. | |
33 | ||
34 | %description -l pl.UTF-8 | |
35 | fwupdate zapewnia prosty interfejs linii poleceń do aktualizacji | |
36 | firmware'u przez UEFI. | |
37 | ||
38 | %package libs | |
39 | Summary: Library to manage UEFI firmware updates | |
40 | Summary(pl.UTF-8): Biblioteka do zarządzania aktualizacjami firmware'u przez UEFI | |
41 | Group: Libraries | |
4015a93f | 42 | Requires: efivar-libs >= 0.30 |
3b56ddd5 JB |
43 | |
44 | %description libs | |
45 | Library to manage UEFI firmware updates. | |
46 | ||
47 | %description libs -l pl.UTF-8 | |
48 | Biblioteka do zarządzania aktualizacjami firmware'u przez UEFI. | |
49 | ||
50 | %package devel | |
51 | Summary: Header files for libfwup library | |
52 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libfwup | |
53 | Group: Development/Libraries | |
54 | Requires: %{name}-libs = %{version}-%{release} | |
4015a93f | 55 | Requires: efivar-devel >= 0.30 |
3b56ddd5 JB |
56 | |
57 | %description devel | |
58 | Header files for libfwup library. | |
59 | ||
60 | %description devel -l pl.UTF-8 | |
61 | Pliki nagłówkowe biblioteki libfwup. | |
62 | ||
7e7be65e JB |
63 | %package -n bash-completion-fwupdate |
64 | Summary: Bash completion for fwupdate command | |
65 | Summary(pl.UTF-8): Bashowe uzupełnianie parametrów polecenia fwupdate | |
66 | Group: Applications/Shells | |
67 | Requires: %{name} = %{version}-%{release} | |
68 | Requires: bash-completion >= 2.0 | |
69 | ||
70 | %description -n bash-completion-fwupdate | |
71 | Bash completion for fwupdate command. | |
72 | ||
73 | %description -n bash-completion-fwupdate -l pl.UTF-8 | |
74 | Bashowe uzupełnianie parametrów polecenia fwupdate. | |
75 | ||
3b56ddd5 | 76 | %prep |
a3b339a3 | 77 | %setup -q |
66bfa4f8 | 78 | %patch0 -p1 |
4015a93f | 79 | %patch1 -p1 |
3b56ddd5 | 80 | |
3b56ddd5 JB |
81 | %if %{without pesign} |
82 | %{__sed} -i -e 's/pesign/cp $< $@ \&\& : &/' efi/Makefile | |
83 | %endif | |
84 | ||
dfca3020 JB |
85 | %ifarch x32 |
86 | %{__sed} -i -e '/^BUILDFLAGS\s*:= /s/:= /:= -m64 /' efi/Makefile | |
87 | %endif | |
88 | ||
3b56ddd5 JB |
89 | %build |
90 | %{__make} \ | |
91 | %ifarch x32 | |
92 | ARCH=x86_64 \ | |
93 | %endif | |
94 | CC="%{__cc}" \ | |
95 | CFLAGS="%{rpmcflags}" \ | |
96 | EFIDIR=%{efidir} \ | |
a3b339a3 | 97 | GNUEFIDIR=%{_libdir} \ |
7e7be65e JB |
98 | libdir=%{_libdir} \ |
99 | libexecdir=%{_libexecdir} | |
3b56ddd5 JB |
100 | |
101 | %install | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
104 | %{__make} install \ | |
105 | %ifarch x32 | |
106 | ARCH=x86_64 \ | |
107 | %endif | |
108 | DESTDIR=$RPM_BUILD_ROOT \ | |
109 | EFIDIR=%{efidir} \ | |
7e7be65e JB |
110 | libdir=%{_libdir} \ |
111 | libexecdir=%{_libexecdir} | |
112 | ||
113 | # fix location | |
114 | install -d $RPM_BUILD_ROOT%{systemdunitdir} | |
115 | %{__mv} $RPM_BUILD_ROOT%{_prefix}/lib/systemd/system/*.service $RPM_BUILD_ROOT%{systemdunitdir} | |
3b56ddd5 JB |
116 | |
117 | # empty | |
118 | %{__rm} $RPM_BUILD_ROOT%{_localedir}/en/*.po | |
119 | ||
7e7be65e JB |
120 | # debuginfo installed by make install? |
121 | %{__rm} -r $RPM_BUILD_ROOT{%{_prefix}/lib/debug,%{_prefix}/src/debug} | |
122 | ||
3b56ddd5 JB |
123 | %clean |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
126 | %if 0 | |
127 | # Fedora script below - but we don't want to hardcode /dev/sda | |
128 | %post | |
129 | efibootmgr -b 1337 -B >/dev/null || : | |
130 | efibootmgr -C -b 1337 -d /dev/sda -p 1 -l /EFI/%{efidir}/fwupdate.efi -L "Firmware Update" >/dev/null || : | |
131 | %endif | |
132 | ||
133 | %post libs -p /sbin/ldconfig | |
134 | %postun libs -p /sbin/ldconfig | |
135 | ||
136 | %files | |
137 | %defattr(644,root,root,755) | |
a3b339a3 | 138 | %doc TODO |
3b56ddd5 | 139 | %attr(755,root,root) %{_bindir}/fwupdate |
7e7be65e JB |
140 | %dir %{_libexecdir}/fwupdate |
141 | %attr(755,root,root) %{_libexecdir}/fwupdate/cleanup | |
142 | %{_datadir}/fwupdate | |
143 | %{systemdunitdir}/fwupdate-cleanup.service | |
a3b339a3 | 144 | %{_mandir}/man1/fwupdate.1* |
3b56ddd5 | 145 | %dir /boot/efi/EFI/%{efidir} |
7e7be65e JB |
146 | %ifarch %{ix86} |
147 | /boot/efi/EFI/%{efidir}/fwupia32.efi | |
148 | %endif | |
149 | %ifarch %{x8664} x32 | |
150 | /boot/efi/EFI/%{efidir}/fwupx64.efi | |
151 | %endif | |
dfca3020 | 152 | %ifarch %{arm} |
7e7be65e JB |
153 | /boot/efi/EFI/%{efidir}/fwuparm.efi |
154 | %endif | |
155 | %ifarch aarch64 | |
156 | /boot/efi/EFI/%{efidir}/fwupaa64.efi | |
157 | %endif | |
dfca3020 | 158 | %ifnarch %{ix86} %{x8664} x32 %{arm} aarch64 |
3b56ddd5 | 159 | /boot/efi/EFI/%{efidir}/fwupdate.efi |
7e7be65e | 160 | %endif |
3b56ddd5 JB |
161 | %dir /boot/efi/EFI/%{efidir}/fw |
162 | ||
163 | %files libs | |
164 | %defattr(644,root,root,755) | |
7e7be65e | 165 | %attr(755,root,root) %{_libdir}/libfwup.so.*.* |
006c21b0 | 166 | %attr(755,root,root) %ghost %{_libdir}/libfwup.so.1 |
3b56ddd5 JB |
167 | |
168 | %files devel | |
169 | %defattr(644,root,root,755) | |
170 | %attr(755,root,root) %{_libdir}/libfwup.so | |
171 | %{_includedir}/fwup.h | |
006c21b0 | 172 | %{_includedir}/fwup-version.h |
3b56ddd5 | 173 | %{_pkgconfigdir}/fwup.pc |
a3b339a3 JB |
174 | %{_mandir}/man3/fwup_*.3* |
175 | %{_mandir}/man3/libfwup.3* | |
176 | %{_mandir}/man3/libfwup.h.3* | |
7e7be65e JB |
177 | |
178 | %files -n bash-completion-fwupdate | |
179 | %defattr(644,root,root,755) | |
180 | %{_datadir}/bash-completion/completions/fwupdate |