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