/[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 1107808 - (show annotations) (download)
Fri Jun 16 10:24:27 2017 UTC (6 years, 10 months ago) by barjac
Original Path: cauldron/grub2/current/SPECS/grub2.spec
File size: 13789 byte(s)
Change menu title to Mageia Boot Menu
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~beta3
21 %global pc_arch i386-pc
22 %define git 10463
23 %define rel 8
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 Source2: grub.default
36 Source3: README.Mageia
37 Source4: README.efi
38 Source6: gitignore
39 Source7: grub.patches
40 # pf2 fonts may be regenerated in SOURCES using ./mkfonts
41 Source8: mkfonts
42 Source9: unicode.pf2
43 Source10: MageiaLogo-Bold-16.pf2
44 Source11: MageiaLogo-Bold-20.pf2
45 Source12: MageiaLogo-Bold-28.pf2
46 Source13: MageiaLogo-Regular-20.pf2
47 Source14: grub2-mageia-default.png
48 Source15: MageiaLogoFonts-bdf.tar.gz
49 Source20: theme.txt
50
51 #
52 # Fedora patches:
53 #
54 # generate with do-rebase
55 # Include Fedora patches in Source7
56 %{expand:%(while read line; do echo $line; done < %{SOURCE7})}
57
58 # And these are:
59 # git checkout debuginfo
60 # git format-patch fedora-23..
61 Patch10001: 10001-Put-the-correct-.file-directives-in-our-.S-files.patch
62 Patch10002: 10002-Make-it-possible-to-enabled-build-id-sha1.patch
63 Patch10004: 10004-Add-grub_qdprintf-grub_dprintf-without-the-file-lin.patch
64 Patch10005: 10005-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch
65
66 #
67 # Mga patches:
68 #
69 Patch20001: grub2-2.00-mga-add_failsafe-10_linux.in.patch
70 Patch20002: grub2-2.00-mga-dont_write_sparse_file_error_to_screen.patch
71 Patch20003: grub2-2.00-mga-dont_write_diskfilter_error_to_screen.patch
72 Patch20004: grub2-2.00-mga-dont_check_uuid_in_installer.patch
73 Patch20005: grub2-2.00-mga-remove-unrestricted_when_password_set.patch
74 #
75 # SuSE Patch:
76 #
77 # Fixes Mga#15846 - Grub2 doesn't install the bootloader on btrfs if we
78 # have a dualboot with windows starting at sector 63
79 Patch30001: grub2-setup-try-fs-embed-if-mbr-gap-too-small.patch
80
81
82 BuildRequires: autoconf
83 BuildRequires: autogen
84 BuildRequires: automake
85 BuildRequires: binutils
86 BuildRequires: bison
87 BuildRequires: bzip2-devel
88 BuildRequires: device-mapper-devel
89 BuildRequires: flex
90 BuildRequires: freetype2-devel
91 BuildRequires: freetype-devel
92 BuildRequires: freetype-devel
93 BuildRequires: fuse-devel
94 BuildRequires: gettext-devel
95 BuildRequires: git
96 BuildRequires: glibc-static-devel
97 BuildRequires: help2man
98 BuildRequires: liblzo-devel
99 BuildRequires: libusb-devel
100 BuildRequires: ncurses-devel
101 BuildRequires: python
102 BuildRequires: rpm-devel
103 BuildRequires: ruby
104 BuildRequires: texinfo
105
106 Conflicts: %{name}-efi
107 Provides: bootloader
108 Provides: grub2bootloader = %{version}-%{release}
109 Requires: %{name}-common = %{version}-%{release}
110
111 %description
112 This is the second version of the GRUB (Grand Unified Boot-loader), a highly
113 configurable and customizable boot-loader with modular architecture.
114 It supports a wide range of kernel formats, file systems, computer
115 architectures and hardware devices.
116 Refer to the README.Mageia file that is part of this package's documentation
117 for more information.
118
119 %ifnarch %arm
120 %package efi
121 Summary: Boot-loader with support for EFI
122 Group: System/Boot and Init
123
124 Conflicts: %{name}
125 Requires(post): efibootmgr
126 Provides: bootloader
127 Provides: grub2bootloader = %{version}-%{release}
128 Requires: %{name}-common = %{version}-%{release}
129
130 %description efi
131 This is the second version of the GRUB (Grand Unified Boot-loader), a highly
132 configurable and customizable boot-loader with modular architecture.
133 It supports a wide range of kernel formats, file systems, computer
134 architectures and hardware devices.
135 ************************** WARNING ************************
136 Do not attempt to install this package on a system which is not
137 already using UEFI mode to boot. You cannot switch to UEFI mode by installing
138 this package, the system must be installed in UEFI mode to use it, when it
139 will be installed by default.
140 %endif
141
142 %ifarch %arm
143 %package uboot
144 Summary: Boot-loader with support for UBOOT
145 Group: System/Boot and Init
146
147 Provides: bootloader
148 Provides: grub2bootloader = %{version}-%{release}
149 Requires: %{name}-common = %{version}-%{release}
150
151 %description uboot
152 configurable and customizable boot-loader with modular architecture.
153 It supports a wide range of kernel formats, file systems, computer
154 architectures and hardware devices.
155 %endif
156
157 %package common
158 Summary: Provides files common to both grub2 and grub2-efi
159 Group: System/Boot and Init
160 Conflicts: memtest86+ < 5.01-7
161 Conflicts: %{name} < 2.02-0.git9752.19.mga5
162 Conflicts: %{name}-efi < 2.02-0.git9752.19.mga5
163 Recommends: os-prober >= 1.53
164 Recommends: xorriso
165 Requires: grub2bootloader = %{version}-%{release}
166
167 %description common
168 Common files used by both grub2 and grub2-efi.
169
170 %package mageia-theme
171 Summary: Provides a graphical theme with a custom Mageia background for grub2
172 Group: System/Boot and Init
173
174 Requires: grub2bootloader = %{version}
175 Requires(post): sed
176 Requires(post): coreutils
177 Conflicts: grub2-mageia3-theme-dejavu
178 Conflicts: grub2-mageia4-theme-dejavu
179 Conflicts: grub2-mageia5-theme-dejavu
180 Conflicts: grub2-mageia6-theme-dejavu
181 Conflicts: grub2-mageia-theme-dejavu
182
183 BuildArch: noarch
184
185 %description mageia-theme
186 This package provides a custom Mageia graphical theme.
187 It is provided as a separate package so it may be easily excluded from
188 minimal installations where a graphical theme is not required.
189
190 %prep
191 %setup -q -n grub-%{tarversion}
192
193 cp %{SOURCE6} .gitignore
194 git init
195 echo '![[:digit:]][[:digit:]]_*.in' > util/grub.d/.gitignore
196 echo '!*.[[:digit:]]' > util/.gitignore
197 git config user.email "%{name}-owner@fedoraproject.org"
198 git config user.name "Fedora Ninjas"
199 git config gc.auto 0
200 git add .
201 git commit -a -q -m "%{tarversion} baseline."
202 git apply %{patches} </dev/null
203 git config --unset user.email
204 git config --unset user.name
205
206 # README.Mageia
207 cp %{SOURCE3} .
208
209 %ifnarch %arm
210 # README.efi
211 cp %{SOURCE4} .
212
213 cd ..
214 rm -rf grub-efi-%{tarversion}
215 mv grub-%{tarversion} grub-efi-%{tarversion}
216 %endif
217
218 %setup -q -n grub-%{tarversion}
219
220 cp %{SOURCE6} .gitignore
221 git init
222 echo '![[:digit:]][[:digit:]]_*.in' > util/grub.d/.gitignore
223 echo '!*.[[:digit:]]' > util/.gitignore
224 git config user.email "%{name}-owner@fedoraproject.org"
225 git config user.name "Fedora Ninjas"
226 git config gc.auto 0
227 git add .
228 git commit -a -q -m "%{tarversion} baseline."
229 git apply %{patches} </dev/null
230 git config --unset user.email
231 git config --unset user.name
232 find . -name "*.0???" -delete
233
234 # README.Mageia
235 cp %{SOURCE3} .
236 # README.efi
237 cp %{SOURCE4} .
238
239 %build
240 cd ..
241 pushd grub-%{tarversion}
242 ./autogen.sh
243 %configure2_5x TARGET_LDFLAGS=-static \
244 %ifarch %arm
245 --with-platform=uboot \
246 %else
247 --with-platform=pc \
248 %endif
249 --disable-werror \
250 --enable-grub-mkfont \
251 --program-transform-name=s,grub,%{name}, \
252 --with-bootdir=/boot \
253 --with-grubdir=/%{name} \
254 CFLAGS=""
255 %make_build
256 popd
257
258 %ifnarch %arm
259 pushd grub-efi-%{tarversion}
260 ./autogen.sh
261 %configure2_5x TARGET_LDFLAGS=-static \
262 --with-platform=efi \
263 %ifarch x86_64
264 --target=x86_64 \
265 %endif
266 --disable-werror \
267 --enable-grub-mkfont \
268 --program-transform-name=s,grub,%{name}, \
269 --with-bootdir=/boot \
270 --with-grubdir=/%{name} \
271 CFLAGS=""
272 %make_build
273 popd
274 %endif
275
276 %install
277 cd ..
278 %ifnarch %arm
279 pushd grub-efi-%{tarversion}
280 %make_install
281 popd
282 %endif
283
284 pushd grub-%{tarversion}
285 %make_install
286
287 # (bor) grub.info is harcoded in sources
288 mv %{buildroot}%{_infodir}/grub.info %{buildroot}%{_infodir}/%{name}.info
289
290 # Theme
291 install -d %{buildroot}/boot/%{name}/themes/maggy
292 install -D -m 644 %{SOURCE20} %{buildroot}/boot/%{name}/themes/maggy
293 install -D -m 644 %{SOURCE10} %{buildroot}/boot/%{name}/themes/maggy
294 install -D -m 644 %{SOURCE11} %{buildroot}/boot/%{name}/themes/maggy
295 install -D -m 644 %{SOURCE12} %{buildroot}/boot/%{name}/themes/maggy
296 install -D -m 644 %{SOURCE13} %{buildroot}/boot/%{name}/themes/maggy
297 # Install 4:3 default in case default.jpg is missing
298 install -D -m 644 %{SOURCE14} %{buildroot}/boot/%{name}/themes
299 ln -sf ../grub2-mageia-default.png %{buildroot}/boot/%{name}/themes/maggy/grub2-mageia-default.png
300
301 # Ghost config files
302 install -d %{buildroot}/boot/%{name}
303 install -d %{buildroot}/boot/%{name}/fonts
304
305 # Workaround for RHL Bug 817187
306 install -d %{buildroot}%{_datadir}/locale/en/LC_MESSAGES
307 ln -s %{_datadir}/locale/en@quot/LC_MESSAGES/grub.mo %{buildroot}%{_datadir}/locale/en/LC_MESSAGES/grub.mo
308
309 cat > %{buildroot}/boot/%{name}/custom.cfg <<EOF
310 # Set non-graphical text/background colours
311 set menu_color_normal=cyan/blue
312 set menu_color_highlight=white/blue
313 # Add any extra custom menu entries in here:
314
315 EOF
316
317 # Provide 'update-grub' and update-grub2 symlink for *buntu exiles ;)
318 cat > %{buildroot}%{_bindir}/update-grub <<EOF
319 #!/bin/sh
320 su --login root -c "/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg"
321
322 EOF
323 chmod +x %{buildroot}%{_bindir}/update-grub
324 ln -s %{_bindir}/update-grub %{buildroot}%{_bindir}/update-grub2
325
326 # Defaults
327 install -m 644 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/default/grub
328
329 # Remove "GNU/Linux" in menu selections
330 sed -i 's/ GNU\/Linux//' %{buildroot}%{_sysconfdir}/grub.d/10_linux
331
332 cp %{SOURCE9} %{buildroot}%{_datadir}/grub/
333
334 %find_lang grub
335
336 popd
337
338 %post
339 if [ $1 -eq 2 ]; then
340 touch /boot/grub2/updtrans
341 fi
342
343 %ifnarch %arm
344 %post efi
345 if [ $1 -eq 2 ]; then
346 touch /boot/grub2/updtrans
347 fi
348 %endif
349
350 %posttrans common
351 # On update re-install grub2 to where it was installed by drakboot if possible,
352 # otherwise next boot may fail due to mismatched boot code.
353 if [ -f /boot/grub2/updtrans ] && [ -f /boot/grub2/install.sh -a -x /usr/sbin/detectloader ] && [ "$DURING_INSTALL" != "1" ] ; then
354 LOADER=$(/usr/sbin/detectloader)
355 [ "$LOADER" = "GRUB2" ] && /boot/grub2/install.sh ||:
356 rm -f /boot/grub2/updtrans
357 fi
358
359 # Don't let rpmdrake ask users to shoot themselves in feet! Mga#17263
360 rm -f /etc/default/grub.rpm*
361
362 %post mageia-theme
363 # Don't install if updating
364 if [ $1 -eq 1 ] ; then
365 # Remove trailing blank lines from /etc/default/grub
366 sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' %{_sysconfdir}/default/grub
367 # Check that /etc/default/grub ends in a linefeed
368 [ "$(tail -n 1 %{_sysconfdir}/default/grub | wc --lines)" = "1" ] || echo >> %{_sysconfdir}/default/grub
369 # Add theme
370 echo "GRUB_THEME=/boot/grub2/themes/maggy/theme.txt" >> %{_sysconfdir}/default/grub
371
372 # If installing theme outside installer then update menu
373 if [ "x${DURING_INSTALL}" != "x1" ]; then
374 %{name}-mkconfig -o /boot/%{name}/grub.cfg && rm -f /boot/%{name}/grub.cfg.rpmsave
375 fi
376 fi
377
378 # Copy system default background at correct aspect ratio to grub2 default theme
379 if [ -h %{_datadir}/mga/backgrounds/default.png ] && [ "$DURING_INSTALL" != "1" ]; then
380 cp -f %{_datadir}/mga/backgrounds/default.png /boot/%{name}/themes/%{name}-mageia-default.png
381 fi
382
383 %triggerpostun mageia-theme -- %{name}-mageia-theme < 2.02-0.git10463.5.mga6
384 # Run install.sh to replace /boot/grub2/fonts/unicode.pf2
385 if [ -f /boot/grub2/install.sh -a -x /usr/sbin/detectloader ] && [ "$DURING_INSTALL" != "1" ]; then
386 LOADER=$(/usr/sbin/detectloader)
387 [ "$LOADER" = "GRUB2" ] && /boot/grub2/install.sh ||:
388 fi
389
390 # If updating from below 2.02-0.git10101.4 then re-make grub.cfg once.
391 # grub2 dropped ownership of grub.cfg to avoid rpmnew being created.
392 # Remove rpmnew and after new grub.cfg is created remove rpmsave. Mga#17263
393 %triggerpostun common -- %{name} < 2.02-0.git10101.4, %{name}-efi < 2.02-0.git10101.4
394 rm -f /boot/%{name}/grub.cfg.rpmnew
395 %{name}-mkconfig -o /boot/%{name}/grub.cfg && rm -f /boot/%{name}/grub.cfg.rpmsave
396 # Take this opportunity to remove some unwanted logs
397 rm -f /var/log/%{name}_preun.log
398 rm -f /var/log/%{name}_post.log
399 rm -f /var/log/%{name}_theme_postun.log
400
401 %preun
402 # Only if uninstalling
403 if [ $1 -eq 0 ]; then
404 rm -rf /boot/%{name}/%{pc_arch}
405 rm -rf /boot/%{name}/locale
406 fi
407
408 %ifnarch %arm
409 %preun efi
410 # Only if uninstalling
411 if [ $1 -eq 0 ]; then
412 rm -rf /boot/%{name}/%{efi_arch}
413 rm -rf /boot/%{name}/locale
414 fi
415 %endif
416
417 %postun mageia-theme
418 # Only if uninstalling theme
419 if [ $1 -eq 0 ]; then
420 # Remove theme from config
421 sed -i '/GRUB_THEME=\/boot\/grub2\/themes\/maggy\/theme.txt/d' %{_sysconfdir}/default/grub
422 fi
423
424 %ifnarch %arm
425 %files
426 %dir %{_libdir}/grub
427 %dir %{_libdir}/grub/i386-pc
428 %{_libdir}/grub/i386-pc/*
429 %endif
430
431 %ifnarch %arm
432 %files efi
433 %doc README.efi
434 %dir %{_libdir}/grub
435 %dir %{_libdir}/grub/%{efi_arch}
436 %{_libdir}/grub/%{efi_arch}/*
437 %endif
438
439 %ifarch %arm
440 %files uboot
441 %dir %{_libdir}/grub
442 %dir %{_libdir}/grub/%{efi_arch}
443 %{_libdir}/grub/%{efi_arch}/*
444 %endif
445
446 %files common -f grub.lang
447 %doc COPYING NEWS README THANKS TODO README.Mageia
448 %dir /boot/%{name}
449 %dir /boot/%{name}/fonts
450 %dir /boot/%{name}/themes
451 %{_infodir}/*
452 %{_bindir}/%{name}-*
453 %{_bindir}/update-grub
454 %{_bindir}/update-grub2
455 %{_sbindir}/%{name}-*
456 %{_datarootdir}/bash-completion/completions/grub
457 %{_sysconfdir}/grub.d/README
458 %{_sysconfdir}/grub.d/00_header
459 %{_sysconfdir}/grub.d/01_users
460 %{_sysconfdir}/grub.d/10_linux
461 %{_sysconfdir}/grub.d/20_linux_xen
462 %{_sysconfdir}/grub.d/20_ppc_terminfo
463 %{_sysconfdir}/grub.d/30_os-prober
464 %config(noreplace) %{_sysconfdir}/grub.d/40_custom
465 %config(noreplace) %{_sysconfdir}/grub.d/41_custom
466 %config(noreplace) %{_sysconfdir}/default/grub
467 %{_datadir}/grub
468 %{_datadir}/grub/unicode.pf2
469 %config(noreplace) /boot/%{name}/custom.cfg
470 %{_mandir}/man1/%{name}-*.1*
471 %{_mandir}/man8/%{name}-*.8*
472
473 %files mageia-theme
474 /boot/%{name}/themes/*

  ViewVC Help
Powered by ViewVC 1.1.30