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