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