]> git.pld-linux.org Git - packages/grub2.git/blame - grub2.spec
- filterout -Wl,--no-copy-dt-needed-entries hack
[packages/grub2.git] / grub2.spec
CommitLineData
f97cafb4 1# TODO
dc6928bc 2# - reap out which in probe scripts and drop R: which
f97cafb4 3# - subpackages? e.g. modules and utils
eef2ef67 4# - subpackage for /sbin/grub-mkfont (pulls freetype lib dep)
bcd6a47e 5# - check where is that locale path: /boot/grub/locale and fix it or change it
8fcee4aa
ER
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
659f8cfc
ER
10# - warning: Installed (but unpackaged) file(s) found:
11# /boot/grub/config.h
12# /etc/bash_completion.d/grub
f97cafb4 13#
90feddde 14# Conditional build:
f6e0d133 15%bcond_with static # build static binaries
8fcee4aa 16%bcond_with grubemu # build grub-emu debugging utility
b06c130d
ER
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
2d8da575
AM
25%ifnarch %{x8664}
26# non-x86_64 arch doesn't support this
27%undefine with_efiemu
28%endif
29
afe8504a 30Summary: GRand Unified Bootloader
c8155f7f 31Summary(de.UTF-8): GRUB2 - ein Bootloader für x86 und ppc
f97cafb4 32Summary(hu.UTF-8): GRUB2 - rendszerbetöltő x86 és ppc gépekhez
c8155f7f
ER
33Summary(pl.UTF-8): GRUB2 - bootloader dla x86 i ppc
34Summary(pt_BR.UTF-8): Gerenciador de inicialização GRUB2
afe8504a 35Name: grub2
e9d73181 36Version: 1.99
659f8cfc 37Release: 3
2e4bec6f 38License: GPL v2
afe8504a 39Group: Base
f951fcbe
AM
40Source0: http://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz
41# Source0-md5: 27e360b951f006c464299d06bbd63442
22909ca1
ER
42Source1: update-grub
43Source2: update-grub.8
b46589aa 44Source3: grub.sysconfig
e2964b87 45Source4: grub-custom.cfg
695ab3a5 46URL: http://www.gnu.org/software/grub/
5028d8c9 47Patch0: pld-initrd.patch
b46589aa 48Patch1: pld-sysconfdir.patch
872700b0 49Patch2: grub-garbage.patch
78785d3a 50Patch3: grub-shelllib.patch
aec70abd 51Patch4: grub-install.in.patch
f7ae30d0 52Patch5: grub-lvmdevice.patch
e2964b87 53Patch6: pld-mkconfigdir.patch
449dde54 54Patch7: grub-mkconfig-diagnostics.patch
61d105fa 55Patch8: ppc.patch
27550907
ER
56BuildRequires: autoconf >= 2.53
57BuildRequires: automake >= 1:1.11.1-1
8b781299 58BuildRequires: bison
013b927c 59BuildRequires: freetype-devel
12fd19f5 60BuildRequires: gawk
63e45785 61BuildRequires: gettext-devel
1349ebb8 62BuildRequires: help2man
afe8504a 63BuildRequires: libtool
81a7e0ba 64BuildRequires: texinfo
403e7b01 65%ifarch %{ix86} %{x8664}
afe8504a 66BuildRequires: lzo-devel >= 1.0.2
67873cc1 67%endif
c668211a
ER
68%ifarch %{x8664}
69BuildRequires: /usr/lib/libc.so
8905dae4
ER
70%if "%{pld_release}" == "ac"
71BuildRequires: libgcc32
72%else
797addca 73BuildRequires: gcc-multilib
c668211a 74%endif
8905dae4 75%endif
afe8504a 76BuildRequires: ncurses-devel
67873cc1 77BuildRequires: sed >= 4.0
6b675158 78%if %{with static}
79BuildRequires: glibc-static
403e7b01 80%ifarch %{ix86} %{x8664}
6b675158 81BuildRequires: lzo-static
ec6cec95 82%endif
6b675158 83BuildRequires: ncurses-static
84%endif
8905dae4 85BuildRequires: rpm >= 4.4.9-56
403e7b01 86BuildRequires: rpmbuild(macros) >= 1.213
dc6928bc 87Requires: which
190cc685 88Suggests: cdrkit-mkisofs
97ee543c 89Suggests: os-prober
afe8504a 90Provides: bootloader
fc835b5e 91Conflicts: grub
58a823d7 92ExclusiveArch: %{ix86} %{x8664} ppc sparc64
afe8504a
SP
93BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
94
95%define _sbindir /sbin
4a00f3b7 96%define _bindir %{_sbindir}
afe8504a 97%define _libdir /boot
26e757db 98%define _libexecdir %{_libdir}/grub
9d44d75e 99
659f8cfc
ER
100# needs real fix
101#%%define filterout_ld -Wl,--no-copy-dt-needed-entries
102
afe8504a
SP
103%description
104GRUB is a GPLed bootloader intended to unify bootloading across x86
105operating systems. In addition to loading the Linux and *BSD kernels,
106it implements the Multiboot standard, which allows for flexible
107loading of multiple boot images (needed for modular kernels such as
108the GNU Hurd).
109
211df1ed
ER
110GRUB 2 is derived from PUPA which was a research project to
111investigate the next generation of GRUB. GRUB 2 has been rewritten
112from scratch to clean up everything for modularity and portability.
113
114GRUB 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
6b0aefbf 134%description -l de.UTF-8
afe8504a
SP
135GRUB (GRand Unified Boot-loader) ist ein Bootloader, der oft auf
136Rechnern eingesetzt wird, auf denen das freie Betriebssystem Linux
6b0aefbf 137läuft. GRUB löst den betagten LILO (Linux-Loader) ab.
afe8504a
SP
138
139GRUB wurde innerhalb des GNU Hurd-Projektes als Boot-Loader entwickelt
6b0aefbf
JR
140und wird unter der GPL vertrieben. Aufgrund seiner höheren
141Flexibilität verdrängt GRUB in vielen Linux-Distributionen den
afe8504a
SP
142traditionellen Boot-Loader LILO.
143
f97cafb4
ZU
144%description -l hu.UTF-8
145GRUB egy GPL liszenszű rendszerbetöltő. Linux és *BSD kernelek
146betöltése mellett támogatja a Multiboot standard-ot, amely lehetővé
147teszi boot képek betöltését (moduláris kerneleknek kell, mint pl. a
148GNU Hurd).
149
150GRUB2 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
6b0aefbf
JR
163%description -l es.UTF-8
164Éste es GRUB - Grand Unified Boot Loader - un administrador de
165inicialización capaz de entrar en la mayoría de los sistemas
afe8504a 166operacionales libres - Linux, FreeBSD, NetBSD, GNU Mach, etc. como
6b0aefbf 167también en la mayoría de los sistemas operacionales comerciales para
afe8504a
SP
168PC.
169
170El administrador GRUB puede ser una buena alternativa a LILO, para
6b0aefbf
JR
171usuarios conmás experiencia y que deseen obtener más recursos de su
172cargador de inicialización (boot loader).
afe8504a 173
6b0aefbf
JR
174%description -l pl.UTF-8
175GRUB jest bootloaderem na licencji GNU, mającym na celu unifikację
176procesu bootowania na systemach x86. Potrafi nie tylko ładować jądra
177Linuksa i *BSD: posiada również implementacje standardu Multiboot,
178który pozwala na elastyczne ładowanie wielu obrazów bootowalnych
179(czego wymagają modułowe jądra, takie jak GNU Hurd).
afe8504a 180
6b0aefbf
JR
181%description -l pt_BR.UTF-8
182Esse é o GRUB - Grand Unified Boot Loader - um gerenciador de boot
afe8504a
SP
183capaz de entrar na maioria dos sistemas operacionais livres - Linux,
184FreeBSD, NetBSD, GNU Mach, etc. assim como na maioria dos sistemas
185operacionais comerciais para PC.
186
6b0aefbf
JR
187O GRUB pode ser uma boa alternativa ao LILO, para usuários mais
188avançados e que querem mais recursos de seu boot loader.
afe8504a 189
afe8504a 190%prep
f951fcbe 191%setup -q -n grub-%{version}
5028d8c9 192%patch0 -p1
b46589aa 193%patch1 -p1
872700b0 194%patch2 -p1
f951fcbe 195%patch3 -p1
aec70abd 196%patch4 -p1
f7ae30d0 197%patch5 -p1
e2964b87 198%patch6 -p1
449dde54 199%patch7 -p1
61d105fa 200%patch8 -p1
afe8504a 201
71c933c0
ER
202%if "%{cc_version}" < "3.4"
203grep -rl -- -Wno-missing-field-initializers . | xargs sed -i -e 's,-Wno-missing-field-initializers,,'
204sed -i -e '/video_mod_CFLAGS/s/$/ -Wno-error/' conf/common.rmk
205%endif
206
afe8504a 207%build
3ff87e8a 208cp -f /usr/share/automake/config.sub .
afe8504a 209%{__libtoolize}
e9d73181 210%{__aclocal} -I m4
afe8504a 211%{__autoheader}
b1a4846d 212echo timestamp > stamp-h.in
afe8504a 213%{__autoconf}
12fd19f5
ER
214export CFLAGS="-Os %{?debug:-g}"
215
216# mawk stalls at ./genmoddep.awk, so force gawk
217AWK=gawk \
afe8504a 218%configure \
761afd95 219 --disable-werror \
8d0dce10 220%if %{with grubemu}
221 --enable-grub-emu-usb \
222 --enable-grub-emu-sdl \
223 --enable-grub-emu-pci \
224%endif
b06c130d 225 --%{!?with_efiemu:dis}%{?with_efiemu:en}able-efiemu \
0fb8b1a5 226 BUILD_CFLAGS="$CFLAGS"
12fd19f5 227%{__make} -j1 \
2e4bec6f 228 BUILD_CFLAGS="$CFLAGS" \
dfbeab3a 229%if %{with static}
403e7b01 230%ifarch %{ix86} %{x8664}
dfbeab3a 231 grub_setup_LDFLAGS="-s -static" \
232 grub_mkimage_LDFLAGS="-s -static -llzo" \
ec6cec95 233%else
234 grub_mkimage_LDFLAGS="-s -static" \
235%endif
236 grub_emu_LDFLAGS="-s -static -lncurses -ltinfo" \
dfbeab3a 237%endif
aec70abd
ER
238 pkgdatadir=%{_libexecdir} \
239 pkglibdir=%{_libexecdir}
0fb8b1a5 240
afe8504a
SP
241%install
242rm -rf $RPM_BUILD_ROOT
e2964b87 243install -d $RPM_BUILD_ROOT{/etc/sysconfig,%{_sysconfdir}/grub.d}
afe8504a
SP
244
245%{__make} install \
26e757db 246 pkgdatadir=%{_libexecdir} \
aec70abd 247 pkglibdir=%{_libexecdir} \
b46589aa 248 DESTDIR=$RPM_BUILD_ROOT
afe8504a 249
f951fcbe
AM
250%find_lang grub
251
bcd6a47e
ER
252# this must be after 'make install'
253install -d $RPM_BUILD_ROOT%{_libexecdir}/locale
254
26e757db 255cp -a docs/grub.cfg $RPM_BUILD_ROOT%{_libexecdir}
22909ca1
ER
256install -p %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/update-grub
257cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8/update-grub.8
b46589aa 258cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/grub
e2964b87 259cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/custom.cfg
47069130 260rm -f $RPM_BUILD_ROOT%{_infodir}/dir
e2964b87 261
26e757db 262# deprecated. we don't need it
e9d73181 263rm $RPM_BUILD_ROOT/boot/grub/update-grub_lib
fa0a01c7 264
cbd79801
ER
265# core.img - bootable image generated by grub-mkimage(1) via grub-install(1)
266touch $RPM_BUILD_ROOT%{_libexecdir}/core.img
267touch $RPM_BUILD_ROOT%{_libexecdir}/device.map
268
8b5c394b
ER
269# needs to be exactly 1KiB
270# but we're ghosting it. so whom are we kidding here? :P (maybe %config it in future?)
271dd bs=1024 if=/dev/zero count=1 of=$RPM_BUILD_ROOT%{_libexecdir}/grubenv
272
afe8504a
SP
273%clean
274rm -rf $RPM_BUILD_ROOT
275
5028d8c9 276%post -p %{_sbindir}/postshell
fc58858a 277-/usr/sbin/fix-info-dir -c %{_infodir}
f4604ef8 278
5028d8c9 279%postun -p %{_sbindir}/postshell
fc58858a 280-/usr/sbin/fix-info-dir -c %{_infodir}
f4604ef8 281
92904505
ER
282# Note this on version upgrade
283%triggerpostun -- %{name} < %{version}-0
284# don't do anything on --downgrade
285if [ $1 -le 1 ]; then
286 exit 0
287fi
288echo "Grub was upgraded, trying to setup it to boot sector"
289/sbin/grub-install '(hd0)' || :
290
f951fcbe 291%files -f grub.lang
afe8504a 292%defattr(644,root,root,755)
2e4bec6f 293%doc AUTHORS ChangeLog NEWS README THANKS TODO
aec70abd 294%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/grub
71c933c0
ER
295%attr(755,root,root) %{_sbindir}/grub-bin2h
296%attr(755,root,root) %{_sbindir}/grub-editenv
3ea0c40e 297%attr(755,root,root) %{_sbindir}/grub-fstest
e9d73181 298%attr(755,root,root) %{_sbindir}/grub-kbdcomp
fc835b5e 299%attr(755,root,root) %{_sbindir}/grub-install
e9d73181 300%attr(755,root,root) %{_sbindir}/grub-menulst2cfg
fc835b5e 301%attr(755,root,root) %{_sbindir}/grub-mkconfig
71c933c0 302%attr(755,root,root) %{_sbindir}/grub-mkfont
e9d73181
AM
303%attr(755,root,root) %{_sbindir}/grub-mklayout
304%attr(755,root,root) %{_sbindir}/grub-mknetdir
71c933c0
ER
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
22909ca1 311%attr(755,root,root) %{_sbindir}/update-grub
76be4c4a
AM
312%ifarch %{ix86} %{x8664}
313%attr(755,root,root) %{_sbindir}/grub-mkimage
fc835b5e 314%{_mandir}/man1/grub-mkimage.1*
76be4c4a
AM
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
71c933c0
ER
321%{_mandir}/man1/grub-bin2h.1*
322%{_mandir}/man1/grub-editenv.1*
3ea0c40e 323%{_mandir}/man1/grub-fstest.1*
e9d73181 324%{_mandir}/man1/grub-menulst2cfg.1*
3ea0c40e 325%{_mandir}/man1/grub-mkfont.1*
e9d73181 326%{_mandir}/man1/grub-mklayout.1*
71c933c0 327%{_mandir}/man1/grub-mkpasswd-pbkdf2.1*
03b9d04b 328%{_mandir}/man1/grub-mkrelpath.1*
71c933c0
ER
329%{_mandir}/man1/grub-mkrescue.1*
330%{_mandir}/man1/grub-script-check.1*
331%{_mandir}/man8/grub-install.8*
fc835b5e 332%{_mandir}/man8/grub-mkconfig.8*
e9d73181 333%{_mandir}/man8/grub-mknetdir.8*
71c933c0
ER
334%{_mandir}/man8/grub-reboot.8*
335%{_mandir}/man8/grub-set-default.8*
22909ca1 336%{_mandir}/man8/update-grub.8*
797addca 337%if %{with grubemu}
8fcee4aa
ER
338%attr(755,root,root) %{_sbindir}/grub-emu
339%{_mandir}/man8/grub-emu.8*
797addca 340%endif
bc6e6053 341/lib/grub-mkconfig_lib
aec70abd 342
26e757db 343%dir %{_libexecdir}
bcd6a47e
ER
344# XXX: check this locale dir location and if it is neccesaary to exist on /boot
345%dir %{_libexecdir}/locale
aec70abd
ER
346%config(noreplace) %verify(not md5 mtime size) %{_libexecdir}/grub.cfg
347%{_libexecdir}/*.lst
348%{_libexecdir}/*.mod
b06c130d 349%if %{with efiemu}
e214a350
ER
350%ifarch %{x8664}
351%{_libexecdir}/efiemu*.o
76be4c4a 352%endif
b06c130d 353%endif
61d105fa 354%{_libexecdir}/kernel.img
aec70abd 355%ifarch %{ix86} %{x8664} sparc sparc64
cbd79801
ER
356%{_libexecdir}/boot.img
357%{_libexecdir}/cdboot.img
358%{_libexecdir}/diskboot.img
cbd79801
ER
359%{_libexecdir}/lnxboot.img
360%{_libexecdir}/pxeboot.img
76be4c4a 361%endif
aec70abd 362
cbd79801
ER
363# generated by grub at runtime
364%ghost %{_libexecdir}/device.map
365%ghost %{_libexecdir}/core.img
8b5c394b 366%ghost %{_libexecdir}/grubenv
cbd79801 367
e2964b87
ER
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
e9d73181 372%attr(755,root,root) /lib/grub.d/20_linux_xen
e2964b87
ER
373%attr(755,root,root) /lib/grub.d/30_os-prober
374%attr(755,root,root) /lib/grub.d/40_custom
e9d73181 375%attr(755,root,root) /lib/grub.d/41_custom
e2964b87 376
71c933c0 377%dir %attr(750,root,root) %{_sysconfdir}/grub.d
e2964b87 378%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/grub.d/custom.cfg
aec70abd 379
1e58ef6c 380%ifarch %{ix86} %{x8664}
1ffaf1f6
ER
381%attr(755,root,root) %{_sbindir}/grub-mkdevicemap
382%attr(755,root,root) %{_sbindir}/grub-probe
383%attr(755,root,root) %{_sbindir}/grub-setup
fc835b5e
AM
384%{_mandir}/man8/grub-mkdevicemap.8*
385%{_mandir}/man8/grub-probe.8*
386%{_mandir}/man8/grub-setup.8*
4a00f3b7 387%endif
aec70abd 388
f4604ef8 389%{_infodir}/grub*.info*
This page took 0.169962 seconds and 4 git commands to generate.