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