]> git.pld-linux.org Git - packages/grub2.git/blob - grub2.spec
platform-efi: S: efibootmgr
[packages/grub2.git] / grub2.spec
1 # TODO
2 # - reap out which in probe scripts and drop R: which
3 # - subpackages? e.g. modules and utils
4 # - check where is that locale path: /boot/grub/locale and fix it or change it
5 # - grubemu notes
6 #   --enable-grub-emu-usb conflicts with --enable-grub-emu-pci, emu-pci seems experimental
7 #   - to build and install the `grub-emu' debugging utility we need to re-run build with --target=emu
8 #   - put grub-emu to subpackage if it is fixed
9 # - warning: Installed (but unpackaged) file(s) found:
10 #   /sbin/grub-sparc64-setup
11 #   /usr/share/man/man8/grub-sparc64-setup.8.gz
12
13 #   /boot/grub/config.h
14 #   /etc/bash_completion.d/grub
15 #   /sbin/grub-sparc64-setup
16 #   /boot/grub/gdb_grub
17 #   /boot/grub/gmodule.pl
18 #   /sbin/grub-sparc64-setup
19 #
20 # Conditional build:
21 %bcond_with     grubemu # build grub-emu debugging utility
22 %bcond_without  efiemu  # build efiemu runtimes
23 %bcond_without  pc      # do not build for PC BIOS platform
24 %bcond_without  efi     # do not build for EFI platform
25
26 %if "%{cc_version}" < "3.4"
27 # cc does not support:
28 # cc1: sorry, unimplemented: code model `large' not supported yet
29 %undefine       with_efiemu
30 %endif
31
32 %ifnarch %{x8664}
33 # non-x86_64 arch doesn't support this
34 %undefine       with_efiemu
35 %endif
36
37 # the 'most natural' platform should go last
38 %define         platforms %{?with_efi:efi} %{?with_pc:pc}
39
40 Summary:        GRand Unified Bootloader
41 Summary(de.UTF-8):      GRUB2 - ein Bootloader für x86 und ppc
42 Summary(hu.UTF-8):      GRUB2 - rendszerbetöltő x86 és ppc gépekhez
43 Summary(pl.UTF-8):      GRUB2 - bootloader dla x86 i ppc
44 Summary(pt_BR.UTF-8):   Gerenciador de inicialização GRUB2
45 Name:           grub2
46 Version:        2.00
47 Release:        0.3
48 License:        GPL v2
49 Group:          Base
50 Source0:        http://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz
51 # Source0-md5:  a1043102fbc7bcedbf53e7ee3d17ab91
52 Source1:        update-grub
53 Source2:        update-grub.8
54 Source3:        grub.sysconfig
55 Source4:        grub-custom.cfg
56 URL:            http://www.gnu.org/software/grub/
57 Patch0:         pld-initrd.patch
58 Patch1:         pld-sysconfdir.patch
59 Patch2:         grub-garbage.patch
60 Patch3:         grub-lvmdevice.patch
61 Patch4:         pld-mkconfigdir.patch
62 Patch5:         grub-mkconfig-diagnostics.patch
63 Patch6:         ppc.patch
64 Patch7:         %{name}-awk.patch
65 Patch8:         posix.patch
66 Patch9:         %{name}-gets.patch
67 Patch10:        %{name}-fonts_path.patch
68 Patch11:        %{name}-tftp_fix.patch
69 BuildRequires:  autoconf >= 2.53
70 BuildRequires:  automake >= 1:1.11.1-1
71 BuildRequires:  bison
72 BuildRequires:  device-mapper-devel
73 BuildRequires:  fonts-TTF-DejaVu
74 BuildRequires:  freetype-devel
75 BuildRequires:  gawk
76 BuildRequires:  gettext-devel
77 BuildRequires:  help2man
78 BuildRequires:  libfuse-devel
79 BuildRequires:  libtool
80 BuildRequires:  texinfo
81 %ifarch %{x8664}
82 BuildRequires:  /usr/lib/libc.so
83 %if "%{pld_release}" == "ac"
84 BuildRequires:  libgcc32
85 %else
86 BuildRequires:  gcc-multilib
87 %endif
88 %endif
89 BuildRequires:  glibc-static
90 BuildRequires:  ncurses-devel
91 BuildRequires:  rpm >= 4.4.9-56
92 BuildRequires:  rpmbuild(macros) >= 1.213
93 BuildRequires:  sed >= 4.0
94 Requires:       which
95 Suggests:       cdrkit-mkisofs
96 Suggests:       os-prober
97 Provides:       bootloader
98 Conflicts:      grub
99 Requires:       %{name}-platform = %{version}-%{release}
100 Suggests:       %{name}-platform-pc
101 ExclusiveArch:  %{ix86} %{x8664} ppc sparc64
102 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
103
104 %define         _sbindir        /sbin
105 %define         _bindir         %{_sbindir}
106 %define         _libdir         /lib
107 %define         _datadir        %{_libdir}
108 %define         _libexecdir     %{_libdir}/grub
109 %define         _grubdir        /boot/grub
110 %define         _localedir      /usr/share/locale
111
112 # part of grub code is not relocable (these are not Linux libs)
113 # stack protector also breaks non-Linux binaries
114 %define         filterout_c     -fPIC
115 %undefine       _ssp_cflags
116
117 %description
118 GRUB is a GPLed bootloader intended to unify bootloading across x86
119 operating systems. In addition to loading the Linux and *BSD kernels,
120 it implements the Multiboot standard, which allows for flexible
121 loading of multiple boot images (needed for modular kernels such as
122 the GNU Hurd).
123
124 GRUB 2 is derived from PUPA which was a research project to
125 investigate the next generation of GRUB. GRUB 2 has been rewritten
126 from scratch to clean up everything for modularity and portability.
127
128 GRUB 2 targets at the following goals:
129 - Scripting support, such as conditionals, loops, variables and
130   functions.
131 - Graphical interface.
132 - Dynamic loading of modules in order to extend itself at the run time
133   rather than at the build time.
134 - Portability for various architectures.
135 - Internationalization. This includes support for non-ASCII character
136   code, message catalogs like gettext, fonts, graphics console, and so
137   on.
138 - Real memory management, to make GNU GRUB more extensible.
139 - Modular, hierarchical, object-oriented framework for file systems,
140   files, devices, drives, terminals, commands, partition tables and OS
141   loaders.
142 - Cross-platform installation which allows for installing GRUB from a
143   different architecture.
144 - Rescue mode saves unbootable cases. Stage 1.5 was eliminated.
145 - Fix design mistakes in GRUB Legacy, which could not be solved for
146   backward-compatibility, such as the way of numbering partitions.
147
148 %description -l de.UTF-8
149 GRUB (GRand Unified Boot-loader) ist ein Bootloader, der oft auf
150 Rechnern eingesetzt wird, auf denen das freie Betriebssystem Linux
151 läuft. GRUB löst den betagten LILO (Linux-Loader) ab.
152
153 GRUB wurde innerhalb des GNU Hurd-Projektes als Boot-Loader entwickelt
154 und wird unter der GPL vertrieben. Aufgrund seiner höheren
155 Flexibilität verdrängt GRUB in vielen Linux-Distributionen den
156 traditionellen Boot-Loader LILO.
157
158 %description -l hu.UTF-8
159 GRUB egy GPL liszenszű rendszerbetöltő. Linux és *BSD kernelek
160 betöltése mellett támogatja a Multiboot standard-ot, amely lehetővé
161 teszi boot képek betöltését (moduláris kerneleknek kell, mint pl. a
162 GNU Hurd).
163
164 GRUB2 céljai a következők:
165 - szkriptelés támogatása, úgymint feltételek, ciklusok, változók,
166   függvények.
167 - grafikus felület
168 - modulok dinamikus betöltése futási időben
169 - hordozhatóság több architektúrára
170 - többnyelvűség: nem-ASCII karakterek támogatása, üzenetkatalógusok,
171   mint gettext, betűtípusok, grafikus konzolon, és így tovább
172 - valós memória kezelés, amellyel még bővíthetőbbé tehetjük
173 - moduláris, hierarchikus, objektum-orientált keretrendszer
174   fájlrendszerekhez, fájlokhoz, eszközökhöz, meghajtókhoz,
175   terminálokhoz, parancsokhoz, partíciós táblákhoz és OS betöltőkhöz
176
177 %description -l es.UTF-8
178 Éste es GRUB - Grand Unified Boot Loader - un administrador de
179 inicialización capaz de entrar en la mayoría de los sistemas
180 operacionales libres - Linux, FreeBSD, NetBSD, GNU Mach, etc. como
181 también en la mayoría de los sistemas operacionales comerciales para
182 PC.
183
184 El administrador GRUB puede ser una buena alternativa a LILO, para
185 usuarios conmás experiencia y que deseen obtener más recursos de su
186 cargador de inicialización (boot loader).
187
188 %description -l pl.UTF-8
189 GRUB jest bootloaderem na licencji GNU, mającym na celu unifikację
190 procesu bootowania na systemach x86. Potrafi nie tylko ładować jądra
191 Linuksa i *BSD: posiada również implementacje standardu Multiboot,
192 który pozwala na elastyczne ładowanie wielu obrazów bootowalnych
193 (czego wymagają modułowe jądra, takie jak GNU Hurd).
194
195 %description -l pt_BR.UTF-8
196 Esse é o GRUB - Grand Unified Boot Loader - um gerenciador de boot
197 capaz de entrar na maioria dos sistemas operacionais livres - Linux,
198 FreeBSD, NetBSD, GNU Mach, etc. assim como na maioria dos sistemas
199 operacionais comerciais para PC.
200
201 O GRUB pode ser uma boa alternativa ao LILO, para usuários mais
202 avançados e que querem mais recursos de seu boot loader.
203
204 %package -n bash-completion-%{name}
205 Summary:        bash-completion for GRUB
206 Summary(pl.UTF-8):      bashowe uzupełnianie nazw dla GRUB
207 Group:          Applications/Shells
208 Requires:       bash-completion
209
210 %description -n bash-completion-%{name}
211 This package provides bash-completion for GRUB.
212
213 %description -n bash-completion-%{name} -l pl.UTF-8
214 Pakiet ten dostarcza bashowe uzupełnianie nazw dla GRUB.
215
216 %package platform-pc
217 Summary:        PC BIOS platform support for GRUB
218 Group:          Base
219 Provides:       %{name}-platform = %{version}-%{release}
220
221 %description platform-pc
222 PC BIOS platform support for GRUB.
223
224 %package platform-efi
225 Summary:        (U)EFI platform support for GRUB
226 Group:          Base
227 Suggests:       efibootmgr
228 Provides:       %{name}-platform = %{version}-%{release}
229
230 %description platform-efi
231 (U)EFI platform support for GRUB.
232
233 %package mkfont
234 Summary:        GRUB font files converter
235 Group:          Base
236
237 %description mkfont
238 Converts common font file formats into PF2.
239
240 %package theme-starfield
241 Summary:        starfield theme for GRUB
242 Group:          Base
243
244 %description theme-starfield
245 starfield theme for GRUB.
246
247 %prep
248 %setup -q -n grub-%{version}
249 %patch0 -p1
250 %patch1 -p1
251 %patch2 -p1
252 %patch3 -p1
253 %patch4 -p1
254 %patch5 -p1
255 %patch6 -p1
256 %patch7 -p1
257 %patch8 -p1
258 %patch9 -p1
259 %patch10 -p1
260 %patch11 -p1
261
262 %if "%{cc_version}" < "3.4"
263 grep -rl -- -Wno-missing-field-initializers . | xargs %{__sed} -i -e 's,-Wno-missing-field-initializers,,'
264 %{__sed} -i -e '/video_mod_CFLAGS/s/$/ -Wno-error/' conf/common.rmk
265 %endif
266
267 %build
268 # if gold is used then grub doesn't even boot
269 install -d our-ld
270 ln -s /usr/bin/ld.bfd our-ld/ld
271 export PATH=$(pwd)/our-ld:$PATH
272
273 cp -f /usr/share/automake/config.sub .
274 %{__libtoolize}
275 %{__aclocal} -I m4
276 %{__autoheader}
277 echo timestamp > stamp-h.in
278 %{__autoconf}
279 export CFLAGS="%{rpmcflags} -Os %{?debug:-g}"
280
281 for platform in %{platforms} ; do
282         install -d build-${platform}
283         cd build-${platform}
284
285         if [ "$platform" != "efi" ] ; then
286                 platform_opts="--%{!?with_efiemu:dis}%{?with_efiemu:en}able-efiemu"
287         else
288                 platform_opts=""
289         fi
290
291         ln -s ../configure .
292         # mawk stalls at ./genmoddep.awk, so force gawk
293         AWK=gawk \
294         %configure \
295                 --with-platform=${platform} \
296                 --disable-werror \
297         %if %{with grubemu}
298                 --enable-grub-emu-usb \
299                 --enable-grub-emu-sdl \
300                 --enable-grub-emu-pci \
301         %endif
302                 $platform_opts \
303                 TARGET_LDFLAGS=-static
304
305         %{__make}
306         cd ..
307 done
308
309 %install
310 rm -rf $RPM_BUILD_ROOT
311
312 for platform in %{platforms} ; do
313         cd build-${platform}
314         %{__make} install \
315                 pkgdatadir=%{_libexecdir} \
316                 pkglibdir=%{_libexecdir} \
317                 DESTDIR=$RPM_BUILD_ROOT
318         cd ..
319 done
320
321 # not in Th (?)
322 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/de@hebrew
323 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/en@{arabic,cyrillic,greek,hebrew,piglatin}
324
325 %find_lang grub
326
327 # this must be after 'make install'
328 install -d $RPM_BUILD_ROOT%{_libexecdir}/locale
329
330 install -d $RPM_BUILD_ROOT%{_grubdir}
331 cp -p docs/grub.cfg $RPM_BUILD_ROOT%{_grubdir}
332
333 # grub.d/41_custom
334 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_grubdir}/custom.cfg
335 %{__rm} $RPM_BUILD_ROOT/lib/grub.d/40_custom
336
337 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/update-grub
338 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8/update-grub.8
339
340 install -d $RPM_BUILD_ROOT/etc/sysconfig
341 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/grub
342
343 # rm -f, because it sometimes exists, sometimes not, depending which texlive you have installed
344 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
345
346 # core.img - bootable image generated by grub-mkimage(1) via grub-install(1)
347 touch $RPM_BUILD_ROOT%{_grubdir}/core.img
348 touch $RPM_BUILD_ROOT%{_grubdir}/device.map
349
350 # needs to be exactly 1KiB
351 # but we're ghosting it. so whom are we kidding here? :P (maybe %config it in future?)
352 dd bs=1024 if=/dev/zero count=1 of=$RPM_BUILD_ROOT%{_grubdir}/grubenv
353
354 %clean
355 rm -rf $RPM_BUILD_ROOT
356
357 %post -p %{_sbindir}/postshell
358 -/usr/sbin/fix-info-dir -c %{_infodir}
359
360 %postun -p %{_sbindir}/postshell
361 -/usr/sbin/fix-info-dir -c %{_infodir}
362
363 %triggerpostun -- %{name} < 2.00-0.1
364 # Note this trigger on version upgrade
365 # needed only for upgrade from old grub2 packages
366 # which contained modules in /boot/grub
367 # don't do anything on --downgrade
368 if [ $1 -le 1 ]; then
369         exit 0
370 fi
371 echo "Grub was upgraded, trying to setup it to boot sector"
372 /sbin/grub-install '(hd0)' || :
373
374 %triggerpostun -- %{name} < 1.99-7.3
375 # migrate /etc/grub.d/custom.cfg.rpmsave  -> /boot/grub/custom.cfg
376 if [ -f %{_sysconfdir}/grub.d/custom.cfg.rpmsave ]; then
377         cp -f %{_grubdir}/custom.cfg{,.rpmnew}
378         mv -f  %{_sysconfdir}/grub.d/custom.cfg.rpmsave %{_grubdir}/custom.cfg
379 fi
380
381 %files -f grub.lang
382 %defattr(644,root,root,755)
383 %doc AUTHORS ChangeLog NEWS README THANKS TODO
384 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/grub
385 %attr(755,root,root) %{_sbindir}/grub-bios-setup
386 %attr(755,root,root) %{_sbindir}/grub-editenv
387 %attr(755,root,root) %{_sbindir}/grub-fstest
388 %attr(755,root,root) %{_sbindir}/grub-kbdcomp
389 %attr(755,root,root) %{_sbindir}/grub-install
390 %attr(755,root,root) %{_sbindir}/grub-menulst2cfg
391 %attr(755,root,root) %{_sbindir}/grub-mkconfig
392 %attr(755,root,root) %{_sbindir}/grub-mklayout
393 %attr(755,root,root) %{_sbindir}/grub-mknetdir
394 %attr(755,root,root) %{_sbindir}/grub-mkpasswd-pbkdf2
395 %attr(755,root,root) %{_sbindir}/grub-mkrelpath
396 %attr(755,root,root) %{_sbindir}/grub-mkrescue
397 %attr(755,root,root) %{_sbindir}/grub-mkstandalone
398 %attr(755,root,root) %{_sbindir}/grub-mount
399 %attr(755,root,root) %{_sbindir}/grub-ofpathname
400 %attr(755,root,root) %{_sbindir}/grub-reboot
401 %attr(755,root,root) %{_sbindir}/grub-script-check
402 %attr(755,root,root) %{_sbindir}/grub-set-default
403 %attr(755,root,root) %{_sbindir}/update-grub
404 %ifarch %{ix86} %{x8664}
405 %attr(755,root,root) %{_sbindir}/grub-mkimage
406 %{_mandir}/man1/grub-mkimage.1*
407 %else
408 %attr(755,root,root) %{_sbindir}/grub-probe
409 %{_mandir}/man8/grub-probe.8*
410 %endif
411 %{_mandir}/man1/grub-editenv.1*
412 %{_mandir}/man1/grub-fstest.1*
413 %{_mandir}/man1/grub-kbdcomp.1*
414 %{_mandir}/man1/grub-menulst2cfg.1*
415 %{_mandir}/man1/grub-mklayout.1*
416 %{_mandir}/man1/grub-mkpasswd-pbkdf2.1*
417 %{_mandir}/man1/grub-mkrelpath.1*
418 %{_mandir}/man1/grub-mkrescue.1*
419 %{_mandir}/man1/grub-mkstandalone.1*
420 %{_mandir}/man1/grub-mount.1*
421 %{_mandir}/man1/grub-script-check.1*
422 %{_mandir}/man8/grub-bios-setup.8*
423 %{_mandir}/man8/grub-install.8*
424 %{_mandir}/man8/grub-mkconfig.8*
425 %{_mandir}/man8/grub-mknetdir.8*
426 %{_mandir}/man8/grub-ofpathname.8*
427 %{_mandir}/man8/grub-reboot.8*
428 %{_mandir}/man8/grub-set-default.8*
429 %{_mandir}/man8/update-grub.8*
430 %if %{with grubemu}
431 %attr(755,root,root) %{_sbindir}/grub-emu
432 %{_mandir}/man8/grub-emu.8*
433 %endif
434 %{_libexecdir}/grub-mkconfig_lib
435
436 %dir %{_grubdir}
437 %dir %{_libexecdir}
438 # XXX: check this locale dir location and if it is neccesaary to exist on /boot
439
440 %dir %{_libexecdir}/locale
441 %config(noreplace) %verify(not md5 mtime size) %{_grubdir}/grub.cfg
442 %config(noreplace) %verify(not md5 mtime size) %{_grubdir}/custom.cfg
443
444 # generated by grub at runtime
445 %ghost %{_grubdir}/device.map
446 %ghost %{_grubdir}/core.img
447 %ghost %{_grubdir}/grubenv
448
449 %dir /lib/grub.d
450 %doc /lib/grub.d/README
451 %attr(755,root,root) /lib/grub.d/00_header
452 %attr(755,root,root) /lib/grub.d/10_linux
453 %attr(755,root,root) /lib/grub.d/20_linux_xen
454 %attr(755,root,root) /lib/grub.d/30_os-prober
455 %attr(755,root,root) /lib/grub.d/41_custom
456
457 %ifarch %{ix86} %{x8664}
458 %attr(755,root,root) %{_sbindir}/grub-probe
459 %{_mandir}/man8/grub-probe.8*
460 %endif
461
462 %{_infodir}/grub*.info*
463
464 %dir %{_datadir}/grub/themes
465
466 %if %{with pc}
467 %files platform-pc
468 %defattr(644,root,root,755)
469 %dir %{_libexecdir}/*-pc
470 %{_libexecdir}/*-pc/modinfo.sh
471 %{_libexecdir}/*-pc/*.exec
472 %{_libexecdir}/*-pc/*.image
473 %{_libexecdir}/*-pc/*.lst
474 %{_libexecdir}/*-pc/*.mod
475 %{_libexecdir}/*-pc/*.module
476 %{_libexecdir}/*-pc/lzma_decompress.img
477 %{_libexecdir}/*-pc/config.h
478 %{_libexecdir}/*-pc/gdb_grub
479 %{_libexecdir}/*-pc/gmodule.pl
480 %if %{with efiemu}
481 %ifarch %{x8664}
482 %{_libexecdir}/*-pc/efiemu*.o
483 %endif
484 %endif
485 %{_libexecdir}/*-pc/kernel.img
486 %ifarch %{ix86} %{x8664} sparc sparc64
487 %{_libexecdir}/*-pc/boot.img
488 %{_libexecdir}/*-pc/cdboot.img
489 %{_libexecdir}/*-pc/diskboot.img
490 %{_libexecdir}/*-pc/lnxboot.img
491 %{_libexecdir}/*-pc/pxeboot.img
492 %endif
493 %endif
494
495 %if %{with efi}
496 %files platform-efi
497 %defattr(644,root,root,755)
498 %dir %{_libexecdir}/*-efi
499 %{_libexecdir}/*-efi/modinfo.sh
500 %{_libexecdir}/*-efi/*.exec
501 %{_libexecdir}/*-efi/*.lst
502 %{_libexecdir}/*-efi/*.mod
503 %{_libexecdir}/*-efi/*.module
504 %{_libexecdir}/*-efi/config.h
505 %{_libexecdir}/*-efi/gdb_grub
506 %{_libexecdir}/*-efi/gmodule.pl
507 %{_libexecdir}/*-efi/kernel.img
508 %endif
509
510 %files mkfont
511 %defattr(644,root,root,755)
512 %{_mandir}/man1/grub-mkfont.1*
513 %attr(755,root,root) %{_sbindir}/grub-mkfont
514
515 %files theme-starfield
516 %defattr(644,root,root,755)
517 %{_datadir}/grub/themes/starfield
518
519 %files -n bash-completion-%{name}
520 %defattr(644,root,root,755)
521 /etc/bash_completion.d/grub
This page took 0.75873 seconds and 4 git commands to generate.