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

  ViewVC Help
Powered by ViewVC 1.1.30