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