/[packages]/updates/6/grub2/current/SPECS/grub2.spec
ViewVC logotype

Contents of /updates/6/grub2/current/SPECS/grub2.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 926491 - (show annotations) (download)
Fri Jan 22 07:41:15 2016 UTC (8 years, 3 months ago) by neoclust
Original Path: cauldron/grub2/current/SPECS/grub2.spec
File size: 13945 byte(s)
SILENT: Fix stupid typo error
1 %define Werror_cflags %nil
2 # Modules always contain just 32-bit code
3 %define _libdir %{_exec_prefix}/lib
4 %ifarch x86_64
5 # 64bit intel machines use 32bit boot loader
6 # (We cannot just redefine _target_cpu, as we'd get i386.rpm packages)
7 %global _target_platform i386-%{_vendor}-%{_target_os}%{?_gnu}
8 %global efi_arch x86_64-efi
9 %endif
10
11 %ifarch %arm
12 %global efi_arch arm-uboot
13 %else
14 %global efi_arch i386-efi
15 %endif
16
17 %define tarver 2.02~beta2
18 %global pc_arch i386-pc
19 %define git 10101
20 %define rel 8
21
22 Name: grub2
23 Version: 2.02
24 Release: %mkrel -c git%{git} %{rel}
25 Summary: Boot-loader with support for Linux, Multiboot and more
26 Group: System/Boot and Init
27 License: GPLv3+ and GPLv2
28 # unicode font is GPLv2
29 URL: http://www.gnu.org/software/grub/
30 Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{tarver}.tar.xz
31 Source1: 90_persistent
32 Source2: grub.default
33 Source3: README.Mageia
34 Source4: README.efi
35 Source7: theme.txt
36 # pf2 fonts may be regenerated in SOURCES using ./mkfonts
37 Source8: mkfonts
38 Source9: unicode.pf2
39 Source10: MageiaLogo-Bold-16.pf2
40 Source11: MageiaLogo-Bold-20.pf2
41 Source12: MageiaLogo-Bold-28.pf2
42 Source13: MageiaLogo-Regular-20.pf2
43 Source14: Mageia5-grub2-1024x768.png
44 Source15: MageiaLogoFonts-bdf.tar.xz
45 Source16: gitignore
46
47 # Upstream git snapshot
48 Patch1: grub2-grub-2.02-beta2-mga-git-%{git}.patch
49 # fix CVE-2014-4607 in bundled minilzo
50 Patch2: grub-2.00-minilzo.patch
51 Patch3: grub2-2.00-mga-add_failsafe-10_linux.in.patch
52
53 # Fedora patches not upstream
54 Patch0101: 0443-Migrate-PPC-from-Yaboot-to-Grub2.patch
55 Patch0102: 0450-Pass-x-hex-hex-straight-through-unmolested.patch
56 Patch0103: 0451-Fix-crash-on-http.patch
57 Patch0104: 0460-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch
58 Patch0105: 0462-for-ppc-reset-console-display-attr-when-clear-screen.patch
59 Patch0106: 0476-Use-the-correct-indentation-for-the-term-help-text.patch
60 Patch0107: 0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch
61 Patch0108: 0039-Don-t-require-a-password-to-boot-entries-generated-b.patch
62 Patch0109: 0040-Don-t-emit-Booting-.-message.patch
63 Patch0110: 0041-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch
64 Patch0111: 0042-May-as-well-try-it.patch
65 Patch0114: 0045-trim-arp-packets-with-abnormal-size.patch
66 Patch0115: 0046-Fix-convert-function-to-support-NVMe-devices.patch
67 Patch0116: 0047-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch
68 Patch0119: 0050-reopen-SNP-protocol-for-exclusive-use-by-grub.patch
69 Patch0120: 0051-Reduce-timer-event-frequency-by-10.patch
70 Patch0121: 0052-always-return-error-to-UEFI.patch
71 Patch0122: 0053-Suport-for-bi-endianess-in-elf-file.patch
72 Patch0123: 0054-Add-grub_util_readlink.patch
73 Patch0124: 0055-Make-editenv-chase-symlinks-including-those-across-d.patch
74 Patch0126: 0057-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch
75 Patch0127: 0058-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch
76 Patch0128: 0059-Add-GRUB_DISABLE_UUID.patch
77 Patch0129: 0060-Allow-fallback-to-include-entries-by-title-not-just-.patch
78 Patch0132: 0063-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch
79 Patch0134: 0065-Make-grub2-mkconfig-construct-titles-that-look-like-.patch
80 Patch0135: 0066-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch
81 Patch0136: 0067-Make-.gitignore-suck-way-less.patch
82 Patch0137: 0068-Update-info-with-grub.cfg-netboot-selection-order-11.patch
83 Patch0138: 0069-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch
84 Patch0139: 0070-Add-friendly-grub2-password-config-tool-985962.patch
85 Patch0140: 0071-Make-exit-take-a-return-code.patch
86 Patch0143: 0074-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch
87 Patch0144: 10001-Put-the-correct-.file-directives-in-our-.S-files.patch
88 Patch0145: 10002-Make-efi-machines-load-an-env-block-from-a-variable.patch
89 Patch0146: 10003-Make-it-possible-to-enabled-build-id-sha1.patch
90 Patch0147: 10005-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch
91 Patch0148: 10006-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch
92 Patch0149: 0075-Fix-security-issue-when-reading-username-and-passwor.patch
93 Patch0150: 0076-01_users-Handle-GRUB_PASSWORD-better.patch
94
95 Patch0151: grub2-2.02-mga-fix_halt_at_grub_prompt.patch
96
97 BuildRequires: flex
98 BuildRequires: bison
99 BuildRequires: ruby
100 BuildRequires: binutils
101 BuildRequires: glibc-static-devel
102 BuildRequires: ncurses-devel
103 BuildRequires: liblzo-devel
104 BuildRequires: pkgconfig(freetype2)
105 BuildRequires: pkgconfig(libusb)
106 BuildRequires: help2man
107 BuildRequires: texinfo
108 BuildRequires: libdevmapper-devel
109 BuildRequires: fuse-devel
110 BuildRequires: autogen
111 BuildRequires: pkgconfig(liblzma)
112 BuildRequires: pkgconfig(rpm)
113
114 Conflicts: %{name}-efi
115 Provides: bootloader
116 Provides: grub2bootloader = %{version}-%{release}
117 Requires: %{name}-common = %{version}-%{release}
118
119 %description
120 This is the second version of the GRUB (Grand Unified Boot-loader), a highly
121 configurable and customizable boot-loader with modular architecture.
122 It supports a wide range of kernel formats, file systems, computer
123 architectures and hardware devices.
124 Refer to the README.Mageia file that is part of this package's documentation
125 for more information.
126
127 %ifnarch %arm
128 %package efi
129 Summary: Boot-loader with support for EFI
130 Group: System/Boot and Init
131
132 Conflicts: %{name}
133 Requires(post): efibootmgr
134 Provides: bootloader
135 Provides: grub2bootloader = %{version}-%{release}
136 Requires: %{name}-common = %{version}-%{release}
137
138 %description efi
139 This is the second version of the GRUB (Grand Unified Boot-loader), a highly
140 configurable and customizable boot-loader with modular architecture.
141 It supports a wide range of kernel formats, file systems, computer
142 architectures and hardware devices.
143 ************************** WARNING ************************
144 Do not attempt to install this package on a system which is not
145 already using UEFI mode to boot. You cannot switch to UEFI mode by installing
146 this package, the system must be installed in UEFI mode to use it, when it
147 will be installed by default.
148 %endif
149
150 %ifarch %arm
151 %package uboot
152 Summary: Boot-loader with support for UBOOT
153 Group: System/Boot and Init
154
155 Provides: bootloader
156 Provides: grub2bootloader = %{version}-%{release}
157 Requires: %{name}-common = %{version}-%{release}
158
159 %description uboot
160 configurable and customizable boot-loader with modular architecture.
161 It supports a wide range of kernel formats, file systems, computer
162 architectures and hardware devices.
163 %endif
164
165 %package common
166 Summary: Provides files common to both grub2 and grub2-efi
167 Group: System/Boot and Init
168 Conflicts: memtest86+ < 5.01-7
169 Conflicts: %{name} < 2.02-0.git9752.19.mga5
170 Conflicts: %{name}-efi < 2.02-0.git9752.19.mga5
171 Recommends: %{name}-mageia-theme = %{version}-%{release}
172 Recommends: os-prober >= 1.53
173 Recommends: xorriso
174 Recommends: memtest86+ >= 5.01-7
175 Requires: grub2bootloader = %{version}-%{release}
176
177 %description common
178 Common files used by both grub2 and grub2-efi.
179
180 %package mageia-theme
181 Summary: Provides a graphical theme with a custom Mageia background for grub2
182 Group: System/Boot and Init
183
184 Requires: grub2bootloader = %{version}-%{release}
185 Conflicts: grub2-mageia3-theme-dejavu
186 BuildArch: noarch
187
188 %description mageia-theme
189 This package provides a custom Mageia graphical theme.
190 It is provided as a separate package so it may be easily excluded from
191 minimal installations where a graphical theme is not required.
192
193 %prep
194 %setup -q -n grub-%{tarver}
195
196 cp %{SOURCE16} .gitignore
197 %autopatch -p1
198 find . -name "*.0???" -delete
199
200 # README.Mageia
201 cp %{SOURCE3} .
202
203 %ifnarch %arm
204 # README.efi
205 cp %{SOURCE4} .
206
207 cd ..
208 rm -rf grub-efi-%{tarver}
209 mv grub-%{tarver} grub-efi-%{tarver}
210 %endif
211
212 %setup -q -n grub-%{tarver}
213
214 cp %{SOURCE16} .gitignore
215 %autopatch -p1
216 find . -name "*.0???" -delete
217
218 # README.Mageia
219 cp %{SOURCE3} .
220 # README.efi
221 cp %{SOURCE4} .
222
223 %build
224 cd ..
225 pushd grub-%{tarver}
226 ./autogen.sh
227 %configure2_5x TARGET_LDFLAGS=-static \
228 %ifarch %arm
229 --with-platform=uboot \
230 %else
231 --with-platform=pc \
232 %endif
233 --enable-grub-emu-usb \
234 --disable-werror \
235 --enable-grub-mkfont \
236 --program-transform-name=s,grub,%{name}, \
237 --with-bootdir=/boot \
238 --with-grubdir=/%{name} \
239 CFLAGS=""
240 %make
241 popd
242
243 %ifnarch %arm
244 pushd grub-efi-%{tarver}
245 ./autogen.sh
246 %configure2_5x TARGET_LDFLAGS=-static \
247 --with-platform=efi \
248 %ifarch x86_64
249 --target=x86_64 \
250 %endif
251 --enable-grub-emu-usb \
252 --disable-werror \
253 --enable-grub-mkfont \
254 --program-transform-name=s,grub,%{name}, \
255 --with-bootdir=/boot \
256 --with-grubdir=/%{name} \
257 CFLAGS=""
258 %make
259 popd
260 %endif
261
262 %install
263 cd ..
264 %ifnarch %arm
265 pushd grub-efi-%{tarver}
266 %makeinstall_std
267 popd
268 %endif
269
270 pushd grub-%{tarver}
271 %makeinstall_std
272
273 # (bor) grub.info is harcoded in sources
274 mv %{buildroot}%{_infodir}/grub.info %{buildroot}%{_infodir}/%{name}.info
275
276 # Script that makes part of grub.cfg persist across updates
277 install -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/grub.d
278
279 # Font
280 install -d %{buildroot}/boot/%{name}/fonts
281 install -D %{SOURCE9} %{buildroot}/boot/%{name}/fonts
282
283 # Theme
284 install -d %{buildroot}/boot/%{name}/themes/maggy
285 install -D %{SOURCE7} %{buildroot}/boot/%{name}/themes/maggy
286 install -D %{SOURCE10} %{buildroot}/boot/%{name}/themes/maggy
287 install -D %{SOURCE11} %{buildroot}/boot/%{name}/themes/maggy
288 install -D %{SOURCE12} %{buildroot}/boot/%{name}/themes/maggy
289 install -D %{SOURCE13} %{buildroot}/boot/%{name}/themes/maggy
290 install -D %{SOURCE14} %{buildroot}/boot/%{name}/themes/maggy
291
292 # Ghost config files
293 install -d %{buildroot}/boot/%{name}
294
295 # Workaround for RHL Bug 817187
296 install -d %{buildroot}%{_datadir}/locale/en/LC_MESSAGES
297 ln -s %{_datadir}/locale/en@quot/LC_MESSAGES/grub.mo %{buildroot}%{_datadir}/locale/en/LC_MESSAGES/grub.mo
298
299 cat > %{buildroot}/boot/%{name}/custom.cfg <<EOF
300 # Set non-graphical text/background colours
301 set menu_color_normal=cyan/blue
302 set menu_color_highlight=white/blue
303
304 # Add any extra custom menu entries in here:
305
306 EOF
307
308 # Provide 'update-grub' and update-grub2 symlink for *buntu exiles ;)
309 cat > %{buildroot}%{_bindir}/update-grub <<EOF
310 #!/bin/sh
311 su --login root -c "/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg"
312
313 EOF
314 chmod +x %{buildroot}%{_bindir}/update-grub
315 ln -s %{_bindir}/update-grub %{buildroot}%{_bindir}/update-grub2
316
317 # Defaults
318 install -m 644 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/default/grub
319
320 # Remove "GNU/Linux" in menu selections
321 sed -i 's/ GNU\/Linux//' %{buildroot}%{_sysconfdir}/grub.d/10_linux
322
323 %find_lang grub
324
325 popd
326
327 %post
328 # On update re-install grub2 to where it was installed by drakboot if possible,
329 # otherwise next boot may fail due to mismatched boot code.
330
331 if [ $1 -eq 2 ]; then
332 if [ -f /boot/grub2/install.sh -a -x /usr/sbin/detectloader ]; then
333 LOADER=$(/usr/sbin/detectloader)
334 [ "$LOADER" = "GRUB2" ] && /boot/grub2/install.sh ||:
335 fi
336 rm -f /etc/default/grub.rpm*
337 fi
338
339 %ifnarch %arm
340 %post efi
341 # On update re-install grub2 to where it was installed by drakboot if possible,
342 # otherwise next boot may fail due to mismatched boot code.
343
344 if [ $1 -eq 2 ]; then
345 if [ -f /boot/grub2/install.sh -a -x /usr/sbin/detectloader ]; then
346 LOADER=$(/usr/sbin/detectloader)
347 [ "$LOADER" = "GRUB2" ] && /boot/grub2/install.sh ||:
348 fi
349 rm -f /etc/default/grub.rpm*
350 fi
351 %endif
352
353 %post mageia-theme
354 # Don't install if updating
355 if [ $1 -eq 1 ] ; then
356 # Remove trailing blank lines from /etc/default/grub
357 sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' %{_sysconfdir}/default/grub
358 # Check that /etc/default/grub ends in a linefeed
359 [ "$(tail -n 1 %{_sysconfdir}/default/grub | wc --lines)" = "1" ] || echo >> %{_sysconfdir}/default/grub
360 # Add theme
361 echo "GRUB_THEME=/boot/grub2/themes/maggy/theme.txt" >> %{_sysconfdir}/default/grub
362 fi
363
364 # If updating from below 2.02-0.git10101.4 then re-make grub.cfg once.
365 # grub2 dropped ownership of grub.cfg to avoid rpmnew being created.
366 # Remove rpmnew and after new grub.cfg is created remove rpmsave.
367 %triggerpostun common -- %{name} < 2.02-0.git10101.4, %{name}-efi < 2.02-0.git10101.4
368 rm -f /boot/%{name}/grub.cfg.rpmnew
369 %{name}-mkconfig -o /boot/%{name}/grub.cfg && rm -f /boot/%{name}/grub.cfg.rpmsave
370 # Take this opportunity to remove some unwanted logs
371 rm -f /var/log/%{name}_preun.log
372 rm -f /var/log/%{name}_post.log
373 rm -f /var/log/%{name}_theme_postun.log
374
375 %preun
376 # Only if uninstalling
377 if [ $1 -eq 0 ]; then
378 rm -rf /boot/%{name}/%{pc_arch}
379 rm -rf /boot/%{name}/locale
380 fi
381
382 %ifnarch %arm
383 %preun efi
384 # Only if uninstalling
385 if [ $1 -eq 0 ]; then
386 rm -rf /boot/%{name}/%{efi_arch}
387 rm -rf /boot/%{name}/locale
388 fi
389 %endif
390
391 %postun mageia-theme
392 # Only if uninstalling theme
393 if [ $1 -eq 0 ]; then
394 # Remove theme from config
395 sed -i '/GRUB_THEME=\/boot\/grub2\/themes\/maggy\/theme.txt/d' %{_sysconfdir}/default/grub
396 fi
397
398 %files
399 %dir %{_libdir}/grub
400 %ifnarch %arm
401 %dir %{_libdir}/grub/i386-pc
402 %{_libdir}/grub/i386-pc/*
403 %endif
404
405 %ifnarch %arm
406 %files efi
407 %doc README.efi
408 %dir %{_libdir}/grub
409 %dir %{_libdir}/grub/%{efi_arch}
410 %{_libdir}/grub/%{efi_arch}/*
411 %endif
412
413 %ifarch %arm
414 %files uboot
415 %dir %{_libdir}/grub
416 %dir %{_libdir}/grub/%{efi_arch}
417 %{_libdir}/grub/%{efi_arch}/*
418 %endif
419
420 %files common -f grub.lang
421 %doc COPYING NEWS README THANKS TODO README.Mageia
422 %dir /boot/%{name}
423 %dir /boot/%{name}/fonts
424 %dir /boot/%{name}/themes
425 %{_infodir}/*
426 %{_bindir}/%{name}-*
427 %{_bindir}/update-grub
428 %{_bindir}/update-grub2
429 %{_sbindir}/%{name}-*
430 %{_sysconfdir}/bash_completion.d/grub
431 %{_sysconfdir}/grub.d/README
432 %{_sysconfdir}/grub.d/00_header
433 %{_sysconfdir}/grub.d/01_users
434 %{_sysconfdir}/grub.d/10_linux
435 %{_sysconfdir}/grub.d/20_linux_xen
436 %{_sysconfdir}/grub.d/20_ppc_terminfo
437 %{_sysconfdir}/grub.d/30_os-prober
438 %{_sysconfdir}/grub.d/90_persistent
439 %config(noreplace) %{_sysconfdir}/grub.d/40_custom
440 %config(noreplace) %{_sysconfdir}/grub.d/41_custom
441 %config(noreplace) %{_sysconfdir}/default/grub
442 %{_datadir}/grub
443 %config(noreplace) /boot/%{name}/custom.cfg
444 %{_mandir}/man1/%{name}-*.1*
445 %{_mandir}/man8/%{name}-*.8*
446
447 %files mageia-theme
448 /boot/%{name}/fonts/unicode.pf2
449 %dir /boot/%{name}/themes/maggy
450 /boot/%{name}/themes/maggy/*

  ViewVC Help
Powered by ViewVC 1.1.30