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