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