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