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