Gentoo Archives: gentoo-commits

From: "Mike Gilbert (floppym)" <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-boot/grub: grub-2.00_beta0.ebuild metadata.xml grub-9999.ebuild ChangeLog
Date: Wed, 29 Feb 2012 01:52:42
Message-Id: 20120229015223.059332004B@flycatcher.gentoo.org
1 floppym 12/02/29 01:52:23
2
3 Modified: metadata.xml grub-9999.ebuild ChangeLog
4 Added: grub-2.00_beta0.ebuild
5 Log:
6 Updates for grub-2.00_beta0 release.
7
8 * Move binaries to /usr.
9 * If GRUB_PLATFORMS is set, install binaries as grub2-${platform}-foo.
10 * Add mount and libzfs USE flags.
11 * Drop pkg_config. Need to figure out if this is feasible with multiple
12 platforms.
13
14 (Portage version: 2.2.0_alpha89/cvs/Linux x86_64)
15
16 Revision Changes Path
17 1.12 sys-boot/grub/metadata.xml
18
19 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/metadata.xml?rev=1.12&view=markup
20 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/metadata.xml?rev=1.12&content-type=text/plain
21 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/metadata.xml?r1=1.11&r2=1.12
22
23 Index: metadata.xml
24 ===================================================================
25 RCS file: /var/cvsroot/gentoo-x86/sys-boot/grub/metadata.xml,v
26 retrieving revision 1.11
27 retrieving revision 1.12
28 diff -u -r1.11 -r1.12
29 --- metadata.xml 11 Nov 2011 11:33:10 -0000 1.11
30 +++ metadata.xml 29 Feb 2012 01:52:22 -0000 1.12
31 @@ -2,6 +2,13 @@
32 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
33 <pkgmetadata>
34 <herd>base-system</herd>
35 +<maintainer>
36 + <email>base-system@g.o</email>
37 +</maintainer>
38 +<maintainer restrict="&gt;=sys-boot/grub-2">
39 + <email>floppym@g.o</email>
40 + <name>Mike Gilbert</name>
41 +</maintainer>
42 <use>
43 <flag name='device-mapper'>
44 Enable support for <pkg>sys-fs/device-mapper</pkg>
45 @@ -9,5 +16,11 @@
46 <flag name='efiemu'>
47 Build and install the efiemu runtimes
48 </flag>
49 + <flag name='mount'>
50 + Build and install the grub-mount utility
51 + </flag>
52 + <flag name='libzfs'>
53 + Enable support for <pkg>sys-fs/zfs</pkg>
54 + </flag>
55 </use>
56 </pkgmetadata>
57
58
59
60 1.50 sys-boot/grub/grub-9999.ebuild
61
62 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/grub-9999.ebuild?rev=1.50&view=markup
63 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/grub-9999.ebuild?rev=1.50&content-type=text/plain
64 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/grub-9999.ebuild?r1=1.49&r2=1.50
65
66 Index: grub-9999.ebuild
67 ===================================================================
68 RCS file: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v
69 retrieving revision 1.49
70 retrieving revision 1.50
71 diff -u -r1.49 -r1.50
72 --- grub-9999.ebuild 30 Jan 2012 09:14:59 -0000 1.49
73 +++ grub-9999.ebuild 29 Feb 2012 01:52:22 -0000 1.50
74 @@ -1,6 +1,6 @@
75 # Copyright 1999-2012 Gentoo Foundation
76 # Distributed under the terms of the GNU General Public License v2
77 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.49 2012/01/30 09:14:59 scarabeus Exp $
78 +# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-9999.ebuild,v 1.50 2012/02/29 01:52:22 floppym Exp $
79
80 EAPI=4
81
82 @@ -11,15 +11,19 @@
83 DO_AUTORECONF="true"
84 else
85 MY_P=${P/_/\~}
86 - SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
87 + if [[ ${PV} == *_alpha* || ${PV} == *_beta* ]]; then
88 + SRC_URI="http://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz"
89 + else
90 + SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
91 mirror://gentoo/${MY_P}.tar.xz"
92 + fi
93 # Masked until documentation guys consolidate the guide and approve
94 # it for usage.
95 #KEYWORDS="~amd64 ~mips ~x86"
96 S=${WORKDIR}/${MY_P}
97 fi
98
99 -inherit mount-boot eutils flag-o-matic pax-utils toolchain-funcs ${DO_AUTORECONF:+autotools} ${LIVE_ECLASS}
100 +inherit eutils flag-o-matic pax-utils toolchain-funcs ${DO_AUTORECONF:+autotools} ${LIVE_ECLASS}
101 unset LIVE_ECLASS
102
103 DESCRIPTION="GNU GRUB boot loader"
104 @@ -27,7 +31,7 @@
105
106 LICENSE="GPL-3"
107 SLOT="2"
108 -IUSE="custom-cflags debug device-mapper efiemu nls static sdl truetype"
109 +IUSE="custom-cflags debug device-mapper efiemu mount nls static sdl truetype libzfs"
110
111 GRUB_PLATFORMS=(
112 # everywhere:
113 @@ -54,6 +58,8 @@
114 sdl? ( media-libs/libsdl )
115 )
116 device-mapper? ( >=sys-fs/lvm2-2.02.45 )
117 + libzfs? ( sys-fs/zfs )
118 + mount? ( sys-fs/fuse )
119 truetype? ( media-libs/freetype >=media-fonts/unifont-5 )"
120 DEPEND="${RDEPEND}
121 >=dev-lang/python-2.5.2
122 @@ -67,27 +73,25 @@
123 DEPEND+=" app-arch/xz-utils"
124 fi
125
126 -export STRIP_MASK="*/grub*/*/*.{mod,img}"
127 +export STRIP_MASK="*/grub/*/*.{mod,img}"
128 +
129 QA_EXECSTACK="
130 - lib64/grub2/*/setjmp.mod
131 - lib64/grub2/*/kernel.img
132 - sbin/grub2-probe
133 - sbin/grub2-setup
134 - sbin/grub2-mkdevicemap
135 - bin/grub2-script-check
136 - bin/grub2-fstest
137 - bin/grub2-mklayout
138 - bin/grub2-menulst2cfg
139 - bin/grub2-mkrelpath
140 - bin/grub2-mkpasswd-pbkdf2
141 - bin/grub2-mkfont
142 - bin/grub2-editenv
143 - bin/grub2-mkimage
144 + usr/bin/grub*
145 + usr/sbin/grub*
146 + usr/lib*/grub/*/*.mod
147 + usr/lib*/grub/*/kernel.exec
148 + usr/lib*/grub/*/kernel.img
149 + usr/lib*/grub/*/setjmp.module
150 "
151
152 QA_WX_LOAD="
153 - lib*/grub2/*/kernel.img
154 - lib*/grub2/*/setjmp.mod
155 + usr/lib*/grub/*/kernel.exec
156 + usr/lib*/grub/*/kernel.img
157 + usr/lib*/grub/*/*.image
158 +"
159 +
160 +QA_PRESTRIPPED="
161 + usr/lib.*/grub/.*/kernel.img
162 "
163
164 grub_run_phase() {
165 @@ -110,50 +114,52 @@
166 grub_src_configure() {
167 local platform=$1
168 local target
169 + local transform="grub2"
170 + local with_platform
171
172 [[ -z ${platform} ]] && die "${FUNCNAME} [platform]"
173
174 - # if we have no platform then --with-platform=guessed does not work
175 - [[ ${platform} == "guessed" ]] && platform=""
176 + if [[ ${platform} != "guessed" ]]; then
177 + transform="grub2-${platform}"
178 + fi
179
180 # check if we have to specify the target (EFI)
181 # or just append correct --with-platform
182 - if [[ -n ${platform} ]]; then
183 - if [[ ${platform} == efi* ]]; then
184 - # EFI platform hack
185 - [[ ${platform/*-} == 32 ]] && target=i386
186 - [[ ${platform/*-} == 64 ]] && target=x86_64
187 - # program-prefix is required empty because otherwise it is equal to
188 - # target variable, which we do not want at all
189 - platform="
190 - --with-platform=${platform/-*}
191 - --target=${target}
192 - --program-prefix=
193 - "
194 - else
195 - platform=" --with-platform=${platform}"
196 - fi
197 + if [[ ${platform} == efi* ]]; then
198 + # EFI platform hack
199 + [[ ${platform/*-} == 32 ]] && target=i386
200 + [[ ${platform/*-} == 64 ]] && target=x86_64
201 + # program-prefix is required empty because otherwise it is equal to
202 + # target variable, which we do not want at all
203 + with_platform="
204 + --with-platform=${platform/-*}
205 + --target=${target}
206 + --program-prefix=
207 + "
208 + elif [[ ${platform} != "guessed" ]]; then
209 + with_platform=" --with-platform=${platform}"
210 fi
211
212 - ECONF_SOURCE="${WORKDIR}/${P}/" \
213 + ECONF_SOURCE="${S}" \
214 econf \
215 --disable-werror \
216 - --sbindir=/sbin \
217 - --bindir=/bin \
218 - --libdir=/$(get_libdir) \
219 - --program-transform-name=s,grub,grub2, \
220 + --program-transform-name="s,grub,${transform}," \
221 + --with-grubdir=grub2 \
222 $(use_enable debug mm-debug) \
223 $(use_enable debug grub-emu-usb) \
224 $(use_enable device-mapper) \
225 $(use_enable efiemu) \
226 + $(use_enable mount grub-mount) \
227 $(use_enable nls) \
228 $(use_enable truetype grub-mkfont) \
229 + $(use_enable libzfs) \
230 $(use sdl && use_enable debug grub-emu-sdl) \
231 - ${platform}
232 + ${with_platform}
233 }
234
235 grub_src_compile() {
236 default_src_compile
237 + pax-mark -mpes "${grub_binaries[@]}"
238 }
239
240 grub_src_install() {
241 @@ -161,7 +167,7 @@
242 }
243
244 src_prepare() {
245 - local i j archs
246 + local i j
247
248 epatch_user
249
250 @@ -170,7 +176,7 @@
251 sed -i \
252 -e '/setfilename/s:grub.info:grub2.info:' \
253 -e 's:(grub):(grub2):' \
254 - "${S}"/docs/grub.texi
255 + docs/grub.texi
256
257 # autogen.sh does more than just run autotools
258 if [[ -n ${DO_AUTORECONF} ]] ; then
259 @@ -196,6 +202,7 @@
260 local i
261
262 use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
263 + use libzfs && addpredict /etc/dfs
264 use static && append-ldflags -static
265
266 for i in ${GRUB_ENABLED_PLATFORMS}; do
267 @@ -204,6 +211,24 @@
268 }
269
270 src_compile() {
271 + # Used for pax marking in grub_src_compile
272 + local grub_binaries=(
273 + grub-editenv
274 + grub-fstest
275 + grub-menulst2cfg
276 + grub-mkimage
277 + grub-mklayout
278 + grub-mkpasswd-pbkdf2
279 + grub-mkrelpath
280 + grub-script-check
281 + grub-bios-setup
282 + grub-ofpathname
283 + grub-probe
284 + grub-sparc64-setup
285 + )
286 + use mount && grub_binaries+=( grub-mount )
287 + use truetype && grub_binaries+=( grub-mkfont )
288 +
289 local i
290
291 for i in ${GRUB_ENABLED_PLATFORMS}; do
292 @@ -218,114 +243,16 @@
293 grub_run_phase ${FUNCNAME} ${i}
294 done
295
296 - # No need to move the info file with the live ebuild since we
297 - # already changed the generated file name during the preparation
298 - # phase.
299 - if [[ ${PV} != "9999" ]]; then
300 - # slot all collisions with grub legacy
301 - mv "${ED}"/usr/share/info/grub.info \
302 - "${ED}"/usr/share/info/grub2.info || die
303 - fi
304 -
305 - # Do pax marking
306 - local PAX=(
307 - "sbin/grub2-probe"
308 - "sbin/grub2-setup"
309 - "sbin/grub2-mkdevicemap"
310 - "bin/grub2-script-check"
311 - "bin/grub2-fstest"
312 - "bin/grub2-mklayout"
313 - "bin/grub2-menulst2cfg"
314 - "bin/grub2-mkrelpath"
315 - "bin/grub2-mkpasswd-pbkdf2"
316 - "bin/grub2-editenv"
317 - "bin/grub2-mkimage"
318 - )
319 - for e in ${PAX[@]}; do
320 - pax-mark -mpes "${ED}/${e}"
321 - done
322 + mv "${ED}"usr/share/info/grub{,2}.info || die
323
324 # can't be in docs array as we use default_src_install in different builddir
325 dodoc AUTHORS ChangeLog NEWS README THANKS TODO
326 insinto /etc/default
327 newins "${FILESDIR}"/grub.default grub
328 - cat <<EOF >> "${ED}"/lib*/grub2/grub-mkconfig_lib
329 - GRUB_DISTRIBUTOR="Gentoo"
330 -EOF
331 -
332 - elog
333 - elog "To configure GRUB 2, check the defaults in /etc/default/grub and"
334 - elog "then run 'emerge --config =${CATEGORY}/${PF}'."
335 -
336 - # display the link to guide
337 - show_doc_url
338 }
339
340 -show_doc_url() {
341 - elog
342 - elog "For informations how to configure grub-2 please refer to the guide:"
343 +pkg_postinst() {
344 + # display the link to guide
345 + elog "For information on how to configure grub-2 please refer to the guide:"
346 elog " http://dev.gentoo.org/~scarabeus/grub-2-guide.xml"
347 }
348 -
349 -setup_boot_dir() {
350 - local dir=$1
351 - local use_legacy='n'
352 -
353 - # Make sure target directory exists
354 - mkdir -p "${dir}"
355 -
356 - if [[ -e ${dir/2/}/menu.lst ]] ; then
357 - # Legacy config exists, ask user what to do
358 - einfo "Found legacy GRUB configuration. Do you want to convert it"
359 - einfo "instead of using autoconfig (y/N)?"
360 - read use_legacy
361 -
362 - use_legacy=${use_legacy,,[A-Z]}
363 - fi
364 -
365 - if [[ ${use_legacy} == y* ]] ; then
366 - grub1_cfg=${dir/2/}/menu.lst
367 - grub2_cfg=${dir}/grub.cfg
368 -
369 - # GRUB legacy configuration exists. Use it instead of doing
370 - # our normal autoconfigure.
371 - #
372 -
373 - einfo "Converting legacy config at '${grub1_cfg}' for use by GRUB2."
374 - ebegin "Running: grub2-menulst2cfg '${grub1_cfg}' '${grub2_cfg}'"
375 - grub2-menulst2cfg "${grub1_cfg}" "${grub2_cfg}" &> /dev/null
376 - eend $?
377 -
378 - ewarn
379 - ewarn "Even though the conversion above succeeded, you are STRONGLY"
380 - ewarn "URGED to upgrade to the new GRUB2 configuration format."
381 -
382 - # Remind the user about the documentation
383 - show_doc_url
384 - else
385 - # Run GRUB 2 autoconfiguration
386 - einfo "Running GRUB 2 autoconfiguration."
387 - ebegin "grub2-mkconfig -o '${dir}/grub.cfg'"
388 - grub2-mkconfig -o "${dir}/grub.cfg" &> /dev/null
389 - eend $?
390 - fi
391 -
392 - einfo
393 - einfo "Remember to run grub2-install to activate GRUB2 as your default"
394 - einfo "bootloader."
395 -}
396 -
397 -pkg_config() {
398 - local dir
399 -
400 - mount-boot_mount_boot_partition
401 -
402 - einfo "Enter the directory where you want to setup grub2 ('${ROOT}boot/grub2/'):"
403 - read dir
404 -
405 - [[ -z ${dir} ]] && dir="${ROOT}"boot/grub2
406 -
407 - setup_boot_dir "${dir}"
408 -
409 - mount-boot_pkg_postinst
410 -}
411
412
413
414 1.178 sys-boot/grub/ChangeLog
415
416 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/ChangeLog?rev=1.178&view=markup
417 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/ChangeLog?rev=1.178&content-type=text/plain
418 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/ChangeLog?r1=1.177&r2=1.178
419
420 Index: ChangeLog
421 ===================================================================
422 RCS file: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v
423 retrieving revision 1.177
424 retrieving revision 1.178
425 diff -u -r1.177 -r1.178
426 --- ChangeLog 30 Jan 2012 09:14:59 -0000 1.177
427 +++ ChangeLog 29 Feb 2012 01:52:22 -0000 1.178
428 @@ -1,6 +1,15 @@
429 # ChangeLog for sys-boot/grub
430 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
431 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.177 2012/01/30 09:14:59 scarabeus Exp $
432 +# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/ChangeLog,v 1.178 2012/02/29 01:52:22 floppym Exp $
433 +
434 +*grub-2.00_beta0 (29 Feb 2012)
435 +
436 + 29 Feb 2012; Mike Gilbert <floppym@g.o> +grub-2.00_beta0.ebuild,
437 + files/grub.default, grub-9999.ebuild, metadata.xml:
438 + Updates for grub-2.00_beta0 release. * Move binaries to /usr. * If
439 + GRUB_PLATFORMS is set, install binaries as grub2-${platform}-foo. * Add mount
440 + and libzfs USE flags. * Drop pkg_config. Need to figure out if this is
441 + feasible with multiple platforms.
442
443 30 Jan 2012; Tomáš Chvátal <scarabeus@g.o> grub-1.99-r2.ebuild,
444 grub-9999.ebuild:
445
446
447
448 1.1 sys-boot/grub/grub-2.00_beta0.ebuild
449
450 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/grub-2.00_beta0.ebuild?rev=1.1&view=markup
451 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/grub/grub-2.00_beta0.ebuild?rev=1.1&content-type=text/plain
452
453 Index: grub-2.00_beta0.ebuild
454 ===================================================================
455 # Copyright 1999-2012 Gentoo Foundation
456 # Distributed under the terms of the GNU General Public License v2
457 # $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-2.00_beta0.ebuild,v 1.1 2012/02/29 01:52:22 floppym Exp $
458
459 EAPI=4
460
461 if [[ ${PV} == "9999" ]] ; then
462 EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
463 LIVE_ECLASS="bzr"
464 SRC_URI=""
465 DO_AUTORECONF="true"
466 else
467 MY_P=${P/_/\~}
468 if [[ ${PV} == *_alpha* || ${PV} == *_beta* ]]; then
469 SRC_URI="http://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz"
470 else
471 SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
472 mirror://gentoo/${MY_P}.tar.xz"
473 fi
474 # Masked until documentation guys consolidate the guide and approve
475 # it for usage.
476 #KEYWORDS="~amd64 ~mips ~x86"
477 S=${WORKDIR}/${MY_P}
478 fi
479
480 inherit eutils flag-o-matic pax-utils toolchain-funcs ${DO_AUTORECONF:+autotools} ${LIVE_ECLASS}
481 unset LIVE_ECLASS
482
483 DESCRIPTION="GNU GRUB boot loader"
484 HOMEPAGE="http://www.gnu.org/software/grub/"
485
486 LICENSE="GPL-3"
487 SLOT="2"
488 IUSE="custom-cflags debug device-mapper efiemu mount nls static sdl truetype libzfs"
489
490 GRUB_PLATFORMS=(
491 # everywhere:
492 emu
493 # mips only:
494 qemu-mips yeeloong
495 # amd64, x86, ppc, ppc64:
496 ieee1275
497 # amd64, x86:
498 coreboot multiboot efi-32 pc qemu
499 # amd64:
500 efi-64
501 )
502 IUSE+=" ${GRUB_PLATFORMS[@]/#/grub_platforms_}"
503
504 # os-prober: Used on runtime to detect other OSes
505 # xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
506 RDEPEND="
507 dev-libs/libisoburn
508 dev-libs/lzo
509 sys-boot/os-prober
510 >=sys-libs/ncurses-5.2-r5
511 debug? (
512 sdl? ( media-libs/libsdl )
513 )
514 device-mapper? ( >=sys-fs/lvm2-2.02.45 )
515 libzfs? ( sys-fs/zfs )
516 mount? ( sys-fs/fuse )
517 truetype? ( media-libs/freetype >=media-fonts/unifont-5 )"
518 DEPEND="${RDEPEND}
519 >=dev-lang/python-2.5.2
520 sys-devel/flex
521 virtual/yacc
522 sys-apps/texinfo
523 "
524 if [[ -n ${DO_AUTORECONF} ]] ; then
525 DEPEND+=" >=sys-devel/autogen-5.10 sys-apps/help2man"
526 else
527 DEPEND+=" app-arch/xz-utils"
528 fi
529
530 export STRIP_MASK="*/grub/*/*.{mod,img}"
531
532 QA_EXECSTACK="
533 usr/bin/grub*
534 usr/sbin/grub*
535 usr/lib*/grub/*/*.mod
536 usr/lib*/grub/*/kernel.exec
537 usr/lib*/grub/*/kernel.img
538 usr/lib*/grub/*/setjmp.module
539 "
540
541 QA_WX_LOAD="
542 usr/lib*/grub/*/kernel.exec
543 usr/lib*/grub/*/kernel.img
544 usr/lib*/grub/*/*.image
545 "
546
547 QA_PRESTRIPPED="
548 usr/lib.*/grub/.*/kernel.img
549 "
550
551 grub_run_phase() {
552 local phase=$1
553 local platform=$2
554 [[ -z ${phase} || -z ${platform} ]] && die "${FUNCNAME} [phase] [platform]"
555
556 [[ -d "${WORKDIR}/build-${platform}" ]] || \
557 { mkdir "${WORKDIR}/build-${platform}" || die ; }
558 pushd "${WORKDIR}/build-${platform}" > /dev/null || die
559
560 echo ">>> Running ${phase} for platform \"${platform}\""
561 echo ">>> Working in: \"${WORKDIR}/build-${platform}\""
562
563 grub_${phase} ${platform}
564
565 popd > /dev/null || die
566 }
567
568 grub_src_configure() {
569 local platform=$1
570 local target
571 local transform="grub2"
572 local with_platform
573
574 [[ -z ${platform} ]] && die "${FUNCNAME} [platform]"
575
576 if [[ ${platform} != "guessed" ]]; then
577 transform="grub2-${platform}"
578 fi
579
580 # check if we have to specify the target (EFI)
581 # or just append correct --with-platform
582 if [[ ${platform} == efi* ]]; then
583 # EFI platform hack
584 [[ ${platform/*-} == 32 ]] && target=i386
585 [[ ${platform/*-} == 64 ]] && target=x86_64
586 # program-prefix is required empty because otherwise it is equal to
587 # target variable, which we do not want at all
588 with_platform="
589 --with-platform=${platform/-*}
590 --target=${target}
591 --program-prefix=
592 "
593 elif [[ ${platform} != "guessed" ]]; then
594 with_platform=" --with-platform=${platform}"
595 fi
596
597 ECONF_SOURCE="${S}" \
598 econf \
599 --disable-werror \
600 --program-transform-name="s,grub,${transform}," \
601 --with-grubdir=grub2 \
602 $(use_enable debug mm-debug) \
603 $(use_enable debug grub-emu-usb) \
604 $(use_enable device-mapper) \
605 $(use_enable efiemu) \
606 $(use_enable mount grub-mount) \
607 $(use_enable nls) \
608 $(use_enable truetype grub-mkfont) \
609 $(use_enable libzfs) \
610 $(use sdl && use_enable debug grub-emu-sdl) \
611 ${with_platform}
612 }
613
614 grub_src_compile() {
615 default_src_compile
616 pax-mark -mpes "${grub_binaries[@]}"
617 }
618
619 grub_src_install() {
620 default_src_install
621 }
622
623 src_prepare() {
624 local i j
625
626 epatch_user
627
628 # fix texinfo file name, as otherwise the grub2.info file will be
629 # useless
630 sed -i \
631 -e '/setfilename/s:grub.info:grub2.info:' \
632 -e 's:(grub):(grub2):' \
633 docs/grub.texi
634
635 # autogen.sh does more than just run autotools
636 if [[ -n ${DO_AUTORECONF} ]] ; then
637 sed -i -e '/^autoreconf/s:^:set +e; e:' autogen.sh || die
638 (. ./autogen.sh) || die
639 fi
640
641 # install into the right dir for eselect #372735
642 sed -i \
643 -e '/^bashcompletiondir =/s:=.*:= $(datarootdir)/bash-completion:' \
644 util/bash-completion.d/Makefile.in || die
645
646 # get enabled platforms
647 GRUB_ENABLED_PLATFORMS=""
648 for i in ${GRUB_PLATFORMS[@]}; do
649 use grub_platforms_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}"
650 done
651 [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && GRUB_ENABLED_PLATFORMS="guessed"
652 elog "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}"
653 }
654
655 src_configure() {
656 local i
657
658 use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
659 use libzfs && addpredict /etc/dfs
660 use static && append-ldflags -static
661
662 for i in ${GRUB_ENABLED_PLATFORMS}; do
663 grub_run_phase ${FUNCNAME} ${i}
664 done
665 }
666
667 src_compile() {
668 # Used for pax marking in grub_src_compile
669 local grub_binaries=(
670 grub-editenv
671 grub-fstest
672 grub-menulst2cfg
673 grub-mkimage
674 grub-mklayout
675 grub-mkpasswd-pbkdf2
676 grub-mkrelpath
677 grub-script-check
678 grub-bios-setup
679 grub-ofpathname
680 grub-probe
681 grub-sparc64-setup
682 )
683 use mount && grub_binaries+=( grub-mount )
684 use truetype && grub_binaries+=( grub-mkfont )
685
686 local i
687
688 for i in ${GRUB_ENABLED_PLATFORMS}; do
689 grub_run_phase ${FUNCNAME} ${i}
690 done
691 }
692
693 src_install() {
694 local i
695
696 for i in ${GRUB_ENABLED_PLATFORMS}; do
697 grub_run_phase ${FUNCNAME} ${i}
698 done
699
700 mv "${ED}"usr/share/info/grub{,2}.info || die
701
702 # can't be in docs array as we use default_src_install in different builddir
703 dodoc AUTHORS ChangeLog NEWS README THANKS TODO
704 insinto /etc/default
705 newins "${FILESDIR}"/grub.default grub
706 }
707
708 pkg_postinst() {
709 # display the link to guide
710 elog "For information on how to configure grub-2 please refer to the guide:"
711 elog " http://dev.gentoo.org/~scarabeus/grub-2-guide.xml"
712 }