1 |
%define Werror_cflags %nil |
2 |
# Modules always contain just 32-bit code |
3 |
%define _libdir %{_exec_prefix}/lib |
4 |
|
5 |
# 64bit intel machines use 32bit boot loader |
6 |
# (We cannot just redefine _target_cpu, as we'd get i386.rpm packages then) |
7 |
%ifarch x86_64 |
8 |
%define _target_platform i386-%{_vendor}-%{_target_os}%{?_gnu} |
9 |
%global efi_arch x86_64-efi |
10 |
%endif |
11 |
|
12 |
%ifarch %arm |
13 |
%global efi_arch arm-uboot |
14 |
%endif |
15 |
|
16 |
%ifarch %ix86 |
17 |
%global efi_arch i386-efi |
18 |
%endif |
19 |
|
20 |
%global tarversion 2.02~beta2 |
21 |
%global pc_arch i386-pc |
22 |
%define git 10270 |
23 |
%define rel 3 |
24 |
|
25 |
Name: grub2 |
26 |
Version: 2.02 |
27 |
Release: %mkrel -c git%{git} %{rel} |
28 |
Summary: Bootloader with support for Linux, Multiboot and more |
29 |
Group: System/Boot and Init |
30 |
License: GPLv3+ and GPLv2 |
31 |
# unicode font is GPLv2 |
32 |
URL: http://www.gnu.org/software/grub/ |
33 |
Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz |
34 |
#Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz |
35 |
Source1: 90_persistent |
36 |
Source2: grub.default |
37 |
Source3: README.Mageia |
38 |
Source4: README.efi |
39 |
Source6: gitignore |
40 |
Source7: theme.txt |
41 |
# pf2 fonts may be regenerated in SOURCES using ./mkfonts |
42 |
Source8: mkfonts |
43 |
Source9: unicode.pf2 |
44 |
Source10: MageiaLogo-Bold-16.pf2 |
45 |
Source11: MageiaLogo-Bold-20.pf2 |
46 |
Source12: MageiaLogo-Bold-28.pf2 |
47 |
Source13: MageiaLogo-Regular-20.pf2 |
48 |
Source14: Mageia5-grub2-1024x768.png |
49 |
Source15: MageiaLogoFonts-bdf.tar.xz |
50 |
|
51 |
# |
52 |
# Fedora patches: |
53 |
# |
54 |
|
55 |
# generate with: |
56 |
# git diff grub-2.02-beta2..origin/master |
57 |
Patch0000: grub-2.02-beta2-to-origin-master.patch |
58 |
|
59 |
# generate all the patches after this with: |
60 |
# git format-patch fedora-diff-from-here..fedora-23 |
61 |
Patch0001: 0001-Migrate-PPC-from-Yaboot-to-Grub2.patch |
62 |
Patch0002: 0002-Add-fw_path-variable-revised.patch |
63 |
Patch0003: 0003-Add-support-for-linuxefi.patch |
64 |
Patch0004: 0004-Use-linuxefi-and-initrdefi-where-appropriate.patch |
65 |
Patch0005: 0005-Don-t-allow-insmod-when-secure-boot-is-enabled.patch |
66 |
Patch0006: 0006-Pass-x-hex-hex-straight-through-unmolested.patch |
67 |
Patch0007: 0007-Fix-crash-on-http.patch |
68 |
Patch0008: 0008-IBM-client-architecture-CAS-reboot-support.patch |
69 |
Patch0009: 0009-Add-vlan-tag-support.patch |
70 |
Patch0010: 0010-Add-X-option-to-printf-functions.patch |
71 |
Patch0011: 0011-DHCP-client-ID-and-UUID-options-added.patch |
72 |
Patch0012: 0012-Search-for-specific-config-file-for-netboot.patch |
73 |
Patch0013: 0013-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch |
74 |
Patch0014: 0014-Move-bash-completion-script-922997.patch |
75 |
Patch0015: 0015-for-ppc-reset-console-display-attr-when-clear-screen.patch |
76 |
Patch0016: 0016-Don-t-write-messages-to-the-screen.patch |
77 |
Patch0017: 0017-Don-t-print-GNU-GRUB-header.patch |
78 |
Patch0018: 0018-Don-t-add-to-highlighted-row.patch |
79 |
Patch0019: 0019-Message-string-cleanups.patch |
80 |
Patch0020: 0020-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch |
81 |
Patch0021: 0021-Use-the-correct-indentation-for-the-term-help-text.patch |
82 |
Patch0022: 0022-Indent-menu-entries.patch |
83 |
Patch0023: 0023-Fix-margins.patch |
84 |
Patch0024: 0024-Add-support-for-UEFI-operating-systems-returned-by-o.patch |
85 |
Patch0025: 0025-Disable-GRUB-video-support-for-IBM-power-machines.patch |
86 |
Patch0026: 0026-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch |
87 |
Patch0027: 0027-Use-linux16-when-appropriate-880840.patch |
88 |
Patch0028: 0028-Enable-pager-by-default.-985860.patch |
89 |
Patch0029: 0029-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch |
90 |
Patch0030: 0030-Don-t-say-GNU-Linux-in-generated-menus.patch |
91 |
Patch0031: 0031-Don-t-draw-a-border-around-the-menu.patch |
92 |
Patch0032: 0032-Use-the-standard-margin-for-the-timeout-string.patch |
93 |
Patch0033: 0033-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch |
94 |
Patch0034: 0034-Add-.eh_frame-to-list-of-relocations-stripped.patch |
95 |
Patch0035: 0035-Make-10_linux-work-with-our-changes-for-linux16-and-.patch |
96 |
Patch0036: 0036-Don-t-print-during-fdt-loading-method.patch |
97 |
Patch0037: 0037-Honor-a-symlink-when-generating-configuration-by-gru.patch |
98 |
Patch0038: 0038-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch |
99 |
Patch0039: 0039-Don-t-require-a-password-to-boot-entries-generated-b.patch |
100 |
Patch0040: 0040-Don-t-emit-Booting-.-message.patch |
101 |
Patch0041: 0041-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch |
102 |
Patch0042: 0042-May-as-well-try-it.patch |
103 |
Patch0043: 0043-use-fw_path-prefix-when-fallback-searching-for-grub-.patch |
104 |
Patch0044: 0044-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch |
105 |
Patch0045: 0045-trim-arp-packets-with-abnormal-size.patch |
106 |
Patch0046: 0046-Fix-convert-function-to-support-NVMe-devices.patch |
107 |
Patch0047: 0047-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch |
108 |
Patch0048: 0048-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch |
109 |
Patch0049: 0049-Use-the-default-device-tree-from-the-grub-default-fi.patch |
110 |
Patch0050: 0050-reopen-SNP-protocol-for-exclusive-use-by-grub.patch |
111 |
Patch0051: 0051-Reduce-timer-event-frequency-by-10.patch |
112 |
Patch0052: 0052-always-return-error-to-UEFI.patch |
113 |
Patch0053: 0053-Suport-for-bi-endianess-in-elf-file.patch |
114 |
Patch0054: 0054-Add-grub_util_readlink.patch |
115 |
Patch0055: 0055-Make-editenv-chase-symlinks-including-those-across-d.patch |
116 |
Patch0056: 0056-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch |
117 |
Patch0057: 0057-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch |
118 |
Patch0058: 0058-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch |
119 |
Patch0059: 0059-Add-GRUB_DISABLE_UUID.patch |
120 |
Patch0060: 0060-Allow-fallback-to-include-entries-by-title-not-just-.patch |
121 |
Patch0061: 0061-Load-arm-with-SB-enabled.patch |
122 |
Patch0062: 0062-Try-prefix-if-fw_path-doesn-t-work.patch |
123 |
Patch0063: 0063-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch |
124 |
Patch0064: 0064-Update-to-minilzo-2.08.patch |
125 |
Patch0065: 0065-Make-grub2-mkconfig-construct-titles-that-look-like-.patch |
126 |
Patch0066: 0066-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch |
127 |
Patch0067: 0067-Make-.gitignore-suck-way-less.patch |
128 |
Patch0068: 0068-Update-info-with-grub.cfg-netboot-selection-order-11.patch |
129 |
Patch0069: 0069-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch |
130 |
Patch0070: 0070-Add-friendly-grub2-password-config-tool-985962.patch |
131 |
Patch0071: 0071-Make-exit-take-a-return-code.patch |
132 |
Patch0072: 0072-Add-some-__unused__-where-gcc-5.x-is-more-picky-abou.patch |
133 |
Patch0073: 0073-Fix-race-in-EFI-validation.patch |
134 |
Patch0074: 0074-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch |
135 |
Patch0075: 0075-Fix-security-issue-when-reading-username-and-passwor.patch |
136 |
Patch0076: 0076-01_users-Handle-GRUB_PASSWORD-better.patch |
137 |
|
138 |
|
139 |
|
140 |
|
141 |
# And these are: |
142 |
# git checkout debuginfo |
143 |
# git format-patch fedora-23.. |
144 |
Patch10001: 10001-Put-the-correct-.file-directives-in-our-.S-files.patch |
145 |
Patch10002: 10002-Make-efi-machines-load-an-env-block-from-a-variable.patch |
146 |
Patch10003: 10003-Make-it-possible-to-enabled-build-id-sha1.patch |
147 |
#Patch10004: 10004-Don-t-tell-the-compiler-to-do-annoying-things-with-f.patch |
148 |
Patch10005: 10005-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch |
149 |
Patch10006: 10006-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch |
150 |
|
151 |
# |
152 |
# Mga patches: |
153 |
# |
154 |
#Patch0151: grub2-2.02-mga-fix_halt_at_grub_prompt.patch |
155 |
Patch20001: grub2-2.00-mga-add_failsafe-10_linux.in.patch |
156 |
|
157 |
BuildRequires: flex |
158 |
BuildRequires: bison |
159 |
BuildRequires: ruby |
160 |
BuildRequires: binutils |
161 |
BuildRequires: glibc-static-devel |
162 |
BuildRequires: ncurses-devel |
163 |
BuildRequires: liblzo-devel |
164 |
BuildRequires: pkgconfig(freetype2) |
165 |
BuildRequires: pkgconfig(libusb) |
166 |
BuildRequires: help2man |
167 |
BuildRequires: texinfo |
168 |
BuildRequires: libdevmapper-devel |
169 |
BuildRequires: fuse-devel |
170 |
BuildRequires: autogen |
171 |
BuildRequires: pkgconfig(liblzma) |
172 |
BuildRequires: pkgconfig(rpm) |
173 |
|
174 |
Conflicts: %{name}-efi |
175 |
Provides: bootloader |
176 |
Provides: grub2bootloader = %{version}-%{release} |
177 |
Requires: %{name}-common = %{version}-%{release} |
178 |
|
179 |
%description |
180 |
This is the second version of the GRUB (Grand Unified Boot-loader), a highly |
181 |
configurable and customizable boot-loader with modular architecture. |
182 |
It supports a wide range of kernel formats, file systems, computer |
183 |
architectures and hardware devices. |
184 |
Refer to the README.Mageia file that is part of this package's documentation |
185 |
for more information. |
186 |
|
187 |
%ifnarch %arm |
188 |
%package efi |
189 |
Summary: Boot-loader with support for EFI |
190 |
Group: System/Boot and Init |
191 |
|
192 |
Conflicts: %{name} |
193 |
Requires(post): efibootmgr |
194 |
Provides: bootloader |
195 |
Provides: grub2bootloader = %{version}-%{release} |
196 |
Requires: %{name}-common = %{version}-%{release} |
197 |
|
198 |
%description efi |
199 |
This is the second version of the GRUB (Grand Unified Boot-loader), a highly |
200 |
configurable and customizable boot-loader with modular architecture. |
201 |
It supports a wide range of kernel formats, file systems, computer |
202 |
architectures and hardware devices. |
203 |
************************** WARNING ************************ |
204 |
Do not attempt to install this package on a system which is not |
205 |
already using UEFI mode to boot. You cannot switch to UEFI mode by installing |
206 |
this package, the system must be installed in UEFI mode to use it, when it |
207 |
will be installed by default. |
208 |
%endif |
209 |
|
210 |
%ifarch %arm |
211 |
%package uboot |
212 |
Summary: Boot-loader with support for UBOOT |
213 |
Group: System/Boot and Init |
214 |
|
215 |
Provides: bootloader |
216 |
Provides: grub2bootloader = %{version}-%{release} |
217 |
Requires: %{name}-common = %{version}-%{release} |
218 |
|
219 |
%description uboot |
220 |
configurable and customizable boot-loader with modular architecture. |
221 |
It supports a wide range of kernel formats, file systems, computer |
222 |
architectures and hardware devices. |
223 |
%endif |
224 |
|
225 |
%package common |
226 |
Summary: Provides files common to both grub2 and grub2-efi |
227 |
Group: System/Boot and Init |
228 |
Conflicts: memtest86+ < 5.01-7 |
229 |
Conflicts: %{name} < 2.02-0.git9752.19.mga5 |
230 |
Conflicts: %{name}-efi < 2.02-0.git9752.19.mga5 |
231 |
#Recommends: %{name}-mageia-theme = %{version}-%{release} |
232 |
Recommends: os-prober >= 1.53 |
233 |
Recommends: xorriso |
234 |
Recommends: memtest86+ >= 5.01-7 |
235 |
Requires: grub2bootloader = %{version}-%{release} |
236 |
|
237 |
%description common |
238 |
Common files used by both grub2 and grub2-efi. |
239 |
|
240 |
%package mageia-theme |
241 |
Summary: Provides a graphical theme with a custom Mageia background for grub2 |
242 |
Group: System/Boot and Init |
243 |
|
244 |
Requires: grub2bootloader = %{version}-%{release} |
245 |
Conflicts: grub2-mageia3-theme-dejavu |
246 |
BuildArch: noarch |
247 |
|
248 |
%description mageia-theme |
249 |
This package provides a custom Mageia graphical theme. |
250 |
It is provided as a separate package so it may be easily excluded from |
251 |
minimal installations where a graphical theme is not required. |
252 |
|
253 |
%prep |
254 |
%setup -q -n grub-%{tarversion} |
255 |
|
256 |
cp %{SOURCE6} .gitignore |
257 |
git init |
258 |
echo '![[:digit:]][[:digit:]]_*.in' > util/grub.d/.gitignore |
259 |
echo '!*.[[:digit:]]' > util/.gitignore |
260 |
git config user.email "%{name}-owner@fedoraproject.org" |
261 |
git config user.name "Fedora Ninjas" |
262 |
git config gc.auto 0 |
263 |
git add . |
264 |
git commit -a -q -m "%{tarversion} baseline." |
265 |
git am %{patches} </dev/null |
266 |
git config --unset user.email |
267 |
git config --unset user.name |
268 |
find . -name "*.0???" -delete |
269 |
|
270 |
# README.Mageia |
271 |
cp %{SOURCE3} . |
272 |
|
273 |
%ifnarch %arm |
274 |
# README.efi |
275 |
cp %{SOURCE4} . |
276 |
|
277 |
cd .. |
278 |
rm -rf grub-efi-%{tarversion} |
279 |
mv grub-%{tarversion} grub-efi-%{tarversion} |
280 |
%endif |
281 |
|
282 |
%setup -q -n grub-%{tarversion} |
283 |
|
284 |
cp %{SOURCE6} .gitignore |
285 |
git init |
286 |
echo '![[:digit:]][[:digit:]]_*.in' > util/grub.d/.gitignore |
287 |
echo '!*.[[:digit:]]' > util/.gitignore |
288 |
git config user.email "%{name}-owner@fedoraproject.org" |
289 |
git config user.name "Fedora Ninjas" |
290 |
git config gc.auto 0 |
291 |
git add . |
292 |
git commit -a -q -m "%{tarversion} baseline." |
293 |
git am %{patches} </dev/null |
294 |
git config --unset user.email |
295 |
git config --unset user.name |
296 |
find . -name "*.0???" -delete |
297 |
|
298 |
# README.Mageia |
299 |
cp %{SOURCE3} . |
300 |
# README.efi |
301 |
cp %{SOURCE4} . |
302 |
|
303 |
%build |
304 |
cd .. |
305 |
pushd grub-%{tarversion} |
306 |
./autogen.sh |
307 |
%configure2_5x TARGET_LDFLAGS=-static \ |
308 |
%ifarch %arm |
309 |
--with-platform=uboot \ |
310 |
%else |
311 |
--with-platform=pc \ |
312 |
%endif |
313 |
--enable-grub-emu-usb \ |
314 |
--disable-werror \ |
315 |
--enable-grub-mkfont \ |
316 |
--program-transform-name=s,grub,%{name}, \ |
317 |
--with-bootdir=/boot \ |
318 |
--with-grubdir=/%{name} \ |
319 |
CFLAGS="" |
320 |
%make |
321 |
popd |
322 |
|
323 |
%ifnarch %arm |
324 |
pushd grub-efi-%{tarversion} |
325 |
./autogen.sh |
326 |
%configure2_5x TARGET_LDFLAGS=-static \ |
327 |
--with-platform=efi \ |
328 |
%ifarch x86_64 |
329 |
--target=x86_64 \ |
330 |
%endif |
331 |
--enable-grub-emu-usb \ |
332 |
--disable-werror \ |
333 |
--enable-grub-mkfont \ |
334 |
--program-transform-name=s,grub,%{name}, \ |
335 |
--with-bootdir=/boot \ |
336 |
--with-grubdir=/%{name} \ |
337 |
CFLAGS="" |
338 |
%make |
339 |
popd |
340 |
%endif |
341 |
|
342 |
%install |
343 |
cd .. |
344 |
%ifnarch %arm |
345 |
pushd grub-efi-%{tarversion} |
346 |
%makeinstall_std |
347 |
popd |
348 |
%endif |
349 |
|
350 |
pushd grub-%{tarversion} |
351 |
%makeinstall_std |
352 |
|
353 |
# (bor) grub.info is harcoded in sources |
354 |
mv %{buildroot}%{_infodir}/grub.info %{buildroot}%{_infodir}/%{name}.info |
355 |
|
356 |
# Script that makes part of grub.cfg persist across updates |
357 |
install -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/grub.d |
358 |
|
359 |
# Font |
360 |
install -d %{buildroot}/boot/%{name}/fonts |
361 |
install -D %{SOURCE9} %{buildroot}/boot/%{name}/fonts |
362 |
|
363 |
# Theme |
364 |
install -d %{buildroot}/boot/%{name}/themes/maggy |
365 |
install -D %{SOURCE7} %{buildroot}/boot/%{name}/themes/maggy |
366 |
install -D %{SOURCE10} %{buildroot}/boot/%{name}/themes/maggy |
367 |
install -D %{SOURCE11} %{buildroot}/boot/%{name}/themes/maggy |
368 |
install -D %{SOURCE12} %{buildroot}/boot/%{name}/themes/maggy |
369 |
install -D %{SOURCE13} %{buildroot}/boot/%{name}/themes/maggy |
370 |
install -D %{SOURCE14} %{buildroot}/boot/%{name}/themes/maggy |
371 |
|
372 |
# Ghost config files |
373 |
install -d %{buildroot}/boot/%{name} |
374 |
|
375 |
# Workaround for RHL Bug 817187 |
376 |
install -d %{buildroot}%{_datadir}/locale/en/LC_MESSAGES |
377 |
ln -s %{_datadir}/locale/en@quot/LC_MESSAGES/grub.mo %{buildroot}%{_datadir}/locale/en/LC_MESSAGES/grub.mo |
378 |
|
379 |
cat > %{buildroot}/boot/%{name}/custom.cfg <<EOF |
380 |
# Set non-graphical text/background colours |
381 |
set menu_color_normal=cyan/blue |
382 |
set menu_color_highlight=white/blue |
383 |
|
384 |
# Add any extra custom menu entries in here: |
385 |
|
386 |
EOF |
387 |
|
388 |
# Provide 'update-grub' and update-grub2 symlink for *buntu exiles ;) |
389 |
cat > %{buildroot}%{_bindir}/update-grub <<EOF |
390 |
#!/bin/sh |
391 |
su --login root -c "/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg" |
392 |
|
393 |
EOF |
394 |
chmod +x %{buildroot}%{_bindir}/update-grub |
395 |
ln -s %{_bindir}/update-grub %{buildroot}%{_bindir}/update-grub2 |
396 |
|
397 |
# Defaults |
398 |
install -m 644 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/default/grub |
399 |
|
400 |
# Remove "GNU/Linux" in menu selections |
401 |
sed -i 's/ GNU\/Linux//' %{buildroot}%{_sysconfdir}/grub.d/10_linux |
402 |
|
403 |
%find_lang grub |
404 |
|
405 |
popd |
406 |
|
407 |
%post |
408 |
# On update re-install grub2 to where it was installed by drakboot if possible, |
409 |
# otherwise next boot may fail due to mismatched boot code. |
410 |
|
411 |
if [ $1 -eq 2 ]; then |
412 |
if [ -f /boot/grub2/install.sh -a -x /usr/sbin/detectloader ]; then |
413 |
LOADER=$(/usr/sbin/detectloader) |
414 |
[ "$LOADER" = "GRUB2" ] && /boot/grub2/install.sh ||: |
415 |
fi |
416 |
rm -f /etc/default/grub.rpm* |
417 |
fi |
418 |
|
419 |
%ifnarch %arm |
420 |
%post efi |
421 |
# On update re-install grub2 to where it was installed by drakboot if possible, |
422 |
# otherwise next boot may fail due to mismatched boot code. |
423 |
|
424 |
if [ $1 -eq 2 ]; then |
425 |
if [ -f /boot/grub2/install.sh -a -x /usr/sbin/detectloader ]; then |
426 |
LOADER=$(/usr/sbin/detectloader) |
427 |
[ "$LOADER" = "GRUB2" ] && /boot/grub2/install.sh ||: |
428 |
fi |
429 |
rm -f /etc/default/grub.rpm* |
430 |
fi |
431 |
%endif |
432 |
|
433 |
%post mageia-theme |
434 |
# Don't install if updating |
435 |
if [ $1 -eq 1 ] ; then |
436 |
# Remove trailing blank lines from /etc/default/grub |
437 |
sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' %{_sysconfdir}/default/grub |
438 |
# Check that /etc/default/grub ends in a linefeed |
439 |
[ "$(tail -n 1 %{_sysconfdir}/default/grub | wc --lines)" = "1" ] || echo >> %{_sysconfdir}/default/grub |
440 |
# Add theme |
441 |
echo "GRUB_THEME=/boot/grub2/themes/maggy/theme.txt" >> %{_sysconfdir}/default/grub |
442 |
fi |
443 |
|
444 |
# If updating from below 2.02-0.git10101.4 then re-make grub.cfg once. |
445 |
# grub2 dropped ownership of grub.cfg to avoid rpmnew being created. |
446 |
# Remove rpmnew and after new grub.cfg is created remove rpmsave. |
447 |
%triggerpostun common -- %{name} < 2.02-0.git10101.4, %{name}-efi < 2.02-0.git10101.4 |
448 |
rm -f /boot/%{name}/grub.cfg.rpmnew |
449 |
%{name}-mkconfig -o /boot/%{name}/grub.cfg && rm -f /boot/%{name}/grub.cfg.rpmsave |
450 |
# Take this opportunity to remove some unwanted logs |
451 |
rm -f /var/log/%{name}_preun.log |
452 |
rm -f /var/log/%{name}_post.log |
453 |
rm -f /var/log/%{name}_theme_postun.log |
454 |
|
455 |
%preun |
456 |
# Only if uninstalling |
457 |
if [ $1 -eq 0 ]; then |
458 |
rm -rf /boot/%{name}/%{pc_arch} |
459 |
rm -rf /boot/%{name}/locale |
460 |
fi |
461 |
|
462 |
%ifnarch %arm |
463 |
%preun efi |
464 |
# Only if uninstalling |
465 |
if [ $1 -eq 0 ]; then |
466 |
rm -rf /boot/%{name}/%{efi_arch} |
467 |
rm -rf /boot/%{name}/locale |
468 |
fi |
469 |
%endif |
470 |
|
471 |
%postun mageia-theme |
472 |
# Only if uninstalling theme |
473 |
if [ $1 -eq 0 ]; then |
474 |
# Remove theme from config |
475 |
sed -i '/GRUB_THEME=\/boot\/grub2\/themes\/maggy\/theme.txt/d' %{_sysconfdir}/default/grub |
476 |
fi |
477 |
|
478 |
%ifnarch %arm |
479 |
%files |
480 |
%dir %{_libdir}/grub |
481 |
%dir %{_libdir}/grub/i386-pc |
482 |
%{_libdir}/grub/i386-pc/* |
483 |
%endif |
484 |
|
485 |
%ifnarch %arm |
486 |
%files efi |
487 |
%doc README.efi |
488 |
%dir %{_libdir}/grub |
489 |
%dir %{_libdir}/grub/%{efi_arch} |
490 |
%{_libdir}/grub/%{efi_arch}/* |
491 |
%endif |
492 |
|
493 |
%ifarch %arm |
494 |
%files uboot |
495 |
%dir %{_libdir}/grub |
496 |
%dir %{_libdir}/grub/%{efi_arch} |
497 |
%{_libdir}/grub/%{efi_arch}/* |
498 |
%endif |
499 |
|
500 |
%files common -f grub.lang |
501 |
%doc COPYING NEWS README THANKS TODO README.Mageia |
502 |
%dir /boot/%{name} |
503 |
%dir /boot/%{name}/fonts |
504 |
%dir /boot/%{name}/themes |
505 |
%{_infodir}/* |
506 |
%{_bindir}/%{name}-* |
507 |
%{_bindir}/update-grub |
508 |
%{_bindir}/update-grub2 |
509 |
%{_sbindir}/%{name}-* |
510 |
%{_datarootdir}/bash-completion/completions/grub |
511 |
%{_sysconfdir}/grub.d/README |
512 |
%{_sysconfdir}/grub.d/00_header |
513 |
%{_sysconfdir}/grub.d/01_users |
514 |
%{_sysconfdir}/grub.d/10_linux |
515 |
%{_sysconfdir}/grub.d/20_linux_xen |
516 |
%{_sysconfdir}/grub.d/20_ppc_terminfo |
517 |
%{_sysconfdir}/grub.d/30_os-prober |
518 |
%{_sysconfdir}/grub.d/90_persistent |
519 |
%config(noreplace) %{_sysconfdir}/grub.d/40_custom |
520 |
%config(noreplace) %{_sysconfdir}/grub.d/41_custom |
521 |
%config(noreplace) %{_sysconfdir}/default/grub |
522 |
%{_datadir}/grub |
523 |
%config(noreplace) /boot/%{name}/custom.cfg |
524 |
%{_mandir}/man1/%{name}-*.1* |
525 |
%{_mandir}/man8/%{name}-*.8* |
526 |
|
527 |
%files mageia-theme |
528 |
/boot/%{name}/fonts/unicode.pf2 |
529 |
%dir /boot/%{name}/themes/maggy |
530 |
/boot/%{name}/themes/maggy/* |