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