2 %bcond_with static # build static binaries
3 %bcond_without grubemu # build grub-emu binary
5 Summary: GRand Unified Bootloader
6 Summary(de.UTF-8): GRUB2 - ein Bootloader für x86 und ppc
7 Summary(pl.UTF-8): GRUB2 - bootloader dla x86 i ppc
8 Summary(pt_BR.UTF-8): Gerenciador de inicialização GRUB2
14 # svn export svn://svn.sv.gnu.org/grub/trunk/grub2
15 #Source0: %{name}-%{snap}.tar.bz2
16 Source0: http://alpha.gnu.org/gnu/grub/grub-%{version}.tar.gz
17 # Source0-md5: 66fe18cd9318e3d67a34d7b7a8e7b1f6
19 Source2: update-grub.8
20 Source3: grub.sysconfig
21 URL: http://www.gnu.org/software/grub/grub-2.en.html
22 BuildRequires: autoconf >= 2.53
23 Patch0: pld-initrd.patch
24 Patch1: pld-sysconfdir.patch
25 Patch2: grub-garbage.patch
26 Patch3: grub-shelllib.patch
27 Patch4: grub-install.in.patch
28 Patch5: grub-lvmdevice.patch
29 BuildRequires: automake
32 BuildRequires: libtool
33 BuildRequires: texinfo
34 %ifarch %{ix86} %{x8664}
35 BuildRequires: lzo-devel >= 1.0.2
38 BuildRequires: /usr/lib/libc.so
39 BuildRequires: gcc-multilib
41 BuildRequires: ncurses-devel
42 BuildRequires: sed >= 4.0
44 BuildRequires: glibc-static
45 %ifarch %{ix86} %{x8664}
46 BuildRequires: lzo-static
48 BuildRequires: ncurses-static
50 BuildRequires: rpmbuild(macros) >= 1.213
53 ExclusiveArch: %{ix86} %{x8664} ppc sparc64
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 %define _sbindir /sbin
57 %define _bindir %{_sbindir}
59 %define _libexecdir %{_libdir}/grub
62 GRUB is a GPLed bootloader intended to unify bootloading across x86
63 operating systems. In addition to loading the Linux and *BSD kernels,
64 it implements the Multiboot standard, which allows for flexible
65 loading of multiple boot images (needed for modular kernels such as
68 GRUB 2 is derived from PUPA which was a research project to
69 investigate the next generation of GRUB. GRUB 2 has been rewritten
70 from scratch to clean up everything for modularity and portability.
72 GRUB 2 targets at the following goals:
73 - Scripting support, such as conditionals, loops, variables and
75 - Graphical interface.
76 - Dynamic loading of modules in order to extend itself at the run time
77 rather than at the build time.
78 - Portability for various architectures.
79 - Internationalization. This includes support for non-ASCII character
80 code, message catalogs like gettext, fonts, graphics console, and so
82 - Real memory management, to make GNU GRUB more extensible.
83 - Modular, hierarchical, object-oriented framework for file systems,
84 files, devices, drives, terminals, commands, partition tables and OS
86 - Cross-platform installation which allows for installing GRUB from a
87 different architecture.
88 - Rescue mode saves unbootable cases. Stage 1.5 was eliminated.
89 - Fix design mistakes in GRUB Legacy, which could not be solved for
90 backward-compatibility, such as the way of numbering partitions.
92 %description -l de.UTF-8
93 GRUB (GRand Unified Boot-loader) ist ein Bootloader, der oft auf
94 Rechnern eingesetzt wird, auf denen das freie Betriebssystem Linux
95 läuft. GRUB löst den betagten LILO (Linux-Loader) ab.
97 GRUB wurde innerhalb des GNU Hurd-Projektes als Boot-Loader entwickelt
98 und wird unter der GPL vertrieben. Aufgrund seiner höheren
99 Flexibilität verdrängt GRUB in vielen Linux-Distributionen den
100 traditionellen Boot-Loader LILO.
102 %description -l es.UTF-8
103 Éste es GRUB - Grand Unified Boot Loader - un administrador de
104 inicialización capaz de entrar en la mayoría de los sistemas
105 operacionales libres - Linux, FreeBSD, NetBSD, GNU Mach, etc. como
106 también en la mayoría de los sistemas operacionales comerciales para
109 El administrador GRUB puede ser una buena alternativa a LILO, para
110 usuarios conmás experiencia y que deseen obtener más recursos de su
111 cargador de inicialización (boot loader).
113 %description -l pl.UTF-8
114 GRUB jest bootloaderem na licencji GNU, mającym na celu unifikację
115 procesu bootowania na systemach x86. Potrafi nie tylko ładować jądra
116 Linuksa i *BSD: posiada również implementacje standardu Multiboot,
117 który pozwala na elastyczne ładowanie wielu obrazów bootowalnych
118 (czego wymagają modułowe jądra, takie jak GNU Hurd).
120 %description -l pt_BR.UTF-8
121 Esse é o GRUB - Grand Unified Boot Loader - um gerenciador de boot
122 capaz de entrar na maioria dos sistemas operacionais livres - Linux,
123 FreeBSD, NetBSD, GNU Mach, etc. assim como na maioria dos sistemas
124 operacionais comerciais para PC.
126 O GRUB pode ser uma boa alternativa ao LILO, para usuários mais
127 avançados e que querem mais recursos de seu boot loader.
130 %setup -q -n grub-%{version}
139 cp -f /usr/share/automake/config.sub .
143 echo timestamp > stamp-h.in
145 export CFLAGS="-Os %{?debug:-g}"
147 # mawk stalls at ./genmoddep.awk, so force gawk
150 %{!?without_grubemu:--enable-grub-emu} \
151 BUILD_CFLAGS="$CFLAGS"
153 BUILD_CFLAGS="$CFLAGS" \
155 %ifarch %{ix86} %{x8664}
156 grub_setup_LDFLAGS="-s -static" \
157 grub_mkimage_LDFLAGS="-s -static -llzo" \
159 grub_mkimage_LDFLAGS="-s -static" \
161 grub_emu_LDFLAGS="-s -static -lncurses -ltinfo" \
163 pkgdatadir=%{_libexecdir} \
164 pkglibdir=%{_libexecdir}
167 rm -rf $RPM_BUILD_ROOT
168 install -d $RPM_BUILD_ROOT/etc/sysconfig
171 pkgdatadir=%{_libexecdir} \
172 pkglibdir=%{_libexecdir} \
173 DESTDIR=$RPM_BUILD_ROOT
175 cp -a docs/grub.cfg $RPM_BUILD_ROOT%{_libexecdir}
176 install -p %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/update-grub
177 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8/update-grub.8
178 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/grub
179 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
180 # deprecated. we don't need it
181 rm $RPM_BUILD_ROOT/lib/update-grub_lib
183 # no junk to /boot/grub (put to -devel?)
184 rm $RPM_BUILD_ROOT%{_libexecdir}/*.h
185 rm $RPM_BUILD_ROOT%{_libexecdir}/*.mk
187 # core.img - bootable image generated by grub-mkimage(1) via grub-install(1)
188 touch $RPM_BUILD_ROOT%{_libexecdir}/core.img
189 touch $RPM_BUILD_ROOT%{_libexecdir}/device.map
192 rm -rf $RPM_BUILD_ROOT
194 %post -p %{_sbindir}/postshell
195 -/usr/sbin/fix-info-dir -c %{_infodir}
197 %postun -p %{_sbindir}/postshell
198 -/usr/sbin/fix-info-dir -c %{_infodir}
201 %defattr(644,root,root,755)
202 %doc AUTHORS ChangeLog NEWS README THANKS TODO
203 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/grub
204 %attr(755,root,root) %{_sbindir}/grub-fstest
205 %attr(755,root,root) %{_sbindir}/grub-install
206 %attr(755,root,root) %{_sbindir}/grub-mkfont
207 %attr(755,root,root) %{_sbindir}/grub-mkrescue
208 %attr(755,root,root) %{_sbindir}/grub-editenv
209 %attr(755,root,root) %{_sbindir}/grub-mkconfig
210 %attr(755,root,root) %{_sbindir}/grub-mkelfimage
211 %attr(755,root,root) %{_sbindir}/update-grub
212 %ifarch %{ix86} %{x8664}
213 %attr(755,root,root) %{_sbindir}/grub-mkimage
214 %{_mandir}/man1/grub-mkimage.1*
216 %attr(755,root,root) %{_sbindir}/grub-probe
217 %attr(755,root,root) %{_sbindir}/grub-mkdevicemap
218 %{_mandir}/man8/grub-probe.8*
219 %{_mandir}/man8/grub-mkdevicemap.8*
221 %{_mandir}/man1/grub-fstest.1*
222 %{_mandir}/man1/grub-mkfont.1*
223 %{_mandir}/man1/grub-mkrescue.1*
224 %{_mandir}/man1/grub-editenv.1*
225 %{_mandir}/man8/grub-mkconfig.8*
226 %{_mandir}/man1/grub-mkelfimage.1*
227 %{_mandir}/man8/update-grub.8*
229 %attr(755,root,root) %{_sbindir}/grub-emu
230 %{_mandir}/man8/grub-emu.8*
232 /lib/grub-mkconfig_lib
235 %config(noreplace) %verify(not md5 mtime size) %{_libexecdir}/grub.cfg
239 %{_libexecdir}/efiemu*.o
241 %ifarch %{ix86} %{x8664} sparc sparc64
242 %{_libexecdir}/boot.img
243 %{_libexecdir}/cdboot.img
244 %{_libexecdir}/diskboot.img
245 %{_libexecdir}/kernel.img
246 %{_libexecdir}/lnxboot.img
247 %{_libexecdir}/pxeboot.img
250 # generated by grub at runtime
251 %ghost %{_libexecdir}/device.map
252 %ghost %{_libexecdir}/core.img
254 %dir %{_sysconfdir}/grub.d
255 %doc %{_sysconfdir}/grub.d/README
256 %attr(755,root,root) %{_sysconfdir}/grub.d/00_header
257 %attr(755,root,root) %{_sysconfdir}/grub.d/10_linux
258 %attr(755,root,root) %{_sysconfdir}/grub.d/30_os-prober
259 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/grub.d/40_custom
261 %ifarch %{ix86} %{x8664}
262 %attr(755,root,root) %{_sbindir}/grub-mkdevicemap
263 %attr(755,root,root) %{_sbindir}/grub-probe
264 %attr(755,root,root) %{_sbindir}/grub-setup
265 %{_mandir}/man8/grub-mkdevicemap.8*
266 %{_mandir}/man8/grub-probe.8*
267 %{_mandir}/man8/grub-setup.8*
270 %{_infodir}/grub*.info*