From 7ad0aa1a36f57e917f936c40de16e9be860ef707 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Wed, 2 May 2007 00:04:36 +0000 Subject: Switch from einfo to elog, remove hardened use flag and detect hardened gcc flags as xen-tools does. svn path=/xen/; revision=29 --- app-emulation/xen/Manifest | 16 +++--- app-emulation/xen/xen-3.0.2.ebuild | 93 +++++++++++++++++++++++++++++++++++ app-emulation/xen/xen-3.0.4_p1.ebuild | 30 +++++------ 3 files changed, 117 insertions(+), 22 deletions(-) create mode 100644 app-emulation/xen/xen-3.0.2.ebuild diff --git a/app-emulation/xen/Manifest b/app-emulation/xen/Manifest index d160812..4b638a5 100644 --- a/app-emulation/xen/Manifest +++ b/app-emulation/xen/Manifest @@ -4,14 +4,14 @@ RMD160 6143efc84069b1d66c9b3fcc625e7c44b27dbce6 files/xen-3.0.2-nopiessp.patch 4 SHA256 b206dbb8bf55ece33a851f8c9de511d5abd031825b339df9446ef5689f05c088 files/xen-3.0.2-nopiessp.patch 443 DIST xen-3.0.2-src.tgz 4933621 RMD160 34e4431a981891319f8a5ea0c3f604e7d8d7d7af SHA1 b7e797048b516f8b385afd3da9ae2eded1b8033a SHA256 f18ffab16a457fa721d11933c75f8288f6958c88c2669857c7c11d5107ba2951 DIST xen-3.0.4_1-src.tgz 6473636 RMD160 f869eec35f6afe0bc9824ce2eb4a600f789d423b SHA1 7ca5af70996215229e143c7563e69b3719284a95 SHA256 6b3842393e69a9c8fcdbc2789d05830aba6f1d108a6f97f1448de4a86f92a5cb -EBUILD xen-3.0.2.ebuild 2426 RMD160 6d84f68f0deaa1fe7da214f4914d75dd25d8582a SHA1 6c8c18a288b9c56a7187533cea0b6f67c533d366 SHA256 5371990aa59284556383d420850dd114577b66f97759099d419023be19efc589 -MD5 2c94bd7b6aa43ce902e1fb4d742f7b91 xen-3.0.2.ebuild 2426 -RMD160 6d84f68f0deaa1fe7da214f4914d75dd25d8582a xen-3.0.2.ebuild 2426 -SHA256 5371990aa59284556383d420850dd114577b66f97759099d419023be19efc589 xen-3.0.2.ebuild 2426 -EBUILD xen-3.0.4_p1.ebuild 2494 RMD160 93bd5c3d0e855521b3fc1fc5e34e2851fa4c9e4d SHA1 0ad5d0d205e8d1414a54741a137df9b1f7216990 SHA256 46465ddd2e13deb41c07a70427c006a4df3d960a8a44cf477d9d3262f20e9d84 -MD5 06b9919a2ac4728494f8464cdaee4821 xen-3.0.4_p1.ebuild 2494 -RMD160 93bd5c3d0e855521b3fc1fc5e34e2851fa4c9e4d xen-3.0.4_p1.ebuild 2494 -SHA256 46465ddd2e13deb41c07a70427c006a4df3d960a8a44cf477d9d3262f20e9d84 xen-3.0.4_p1.ebuild 2494 +EBUILD xen-3.0.2.ebuild 2356 RMD160 27526372765c75d431c64201c44c2b20aad2ba5c SHA1 978a442614e4016b032c5202bd51a91cbfad6903 SHA256 0701155c43e107a00e345280b72cacc832d6f1824ad04be11028ffb4e10eef0a +MD5 de2b1b5dab51fe190096369b22561a7f xen-3.0.2.ebuild 2356 +RMD160 27526372765c75d431c64201c44c2b20aad2ba5c xen-3.0.2.ebuild 2356 +SHA256 0701155c43e107a00e345280b72cacc832d6f1824ad04be11028ffb4e10eef0a xen-3.0.2.ebuild 2356 +EBUILD xen-3.0.4_p1.ebuild 2695 RMD160 afbc380a50e71cec4a4340a55e8b893c3907fe65 SHA1 454f03ca8d14058a7c4b900f1f1ffd2bb4dc5411 SHA256 aeab0f9363ad35eb648dafbb8adf3850cce315e3aaa99975a25e392c1c58d89f +MD5 d87b5d08e7f61c66219d1b434935f0b9 xen-3.0.4_p1.ebuild 2695 +RMD160 afbc380a50e71cec4a4340a55e8b893c3907fe65 xen-3.0.4_p1.ebuild 2695 +SHA256 aeab0f9363ad35eb648dafbb8adf3850cce315e3aaa99975a25e392c1c58d89f xen-3.0.4_p1.ebuild 2695 MD5 6618adc624bc8ab64af0f4555c33529a files/digest-xen-3.0.2 235 RMD160 ad3a1d2a82c40b0bca653431c2d7964809580e5e files/digest-xen-3.0.2 235 SHA256 274536fc8a3cb10fda114e533062b0dbddcda4ae15f52033a39b85785b221794 files/digest-xen-3.0.2 235 diff --git a/app-emulation/xen/xen-3.0.2.ebuild b/app-emulation/xen/xen-3.0.2.ebuild new file mode 100644 index 0000000..06b7a62 --- /dev/null +++ b/app-emulation/xen/xen-3.0.2.ebuild @@ -0,0 +1,93 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit mount-boot flag-o-matic + +DESCRIPTION="The Xen virtual machine monitor" +HOMEPAGE="http://xen.sourceforge.net" +MY_PV=${PV/_p/_} +SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV/_/-}/src.tgz/xen-${MY_PV}-src.tgz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="debug custom-cflags pae hardened" + +RDEPEND="sys-boot/grub + sys-kernel/xen-sources" +PDEPEND="~app-emulation/xen-tools-${PV}" + +RESTRICT="test" + +# Approved by QA team in bug #144032 +QA_WX_LOAD="boot/xen-syms-${MY_PV/_/-}" + +pkg_setup() { + if [[ -z ${XEN_TARGET_ARCH} ]]; then + if use x86; then + export XEN_TARGET_ARCH="x86_32" + elif use amd64; then + export XEN_TARGET_ARCH="x86_64" + else + die "Unsupported architecture!" + fi + fi +} + + +src_unpack() { + unpack ${A} + # if the user *really* wants to use their own custom-cflags, let them + if use custom-cflags; then + einfo "User wants their own CFLAGS - removing defaults" + # try and remove all the default custom-cflags + find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \ + -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \ + -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \ + -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \ + -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \ + -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \ + -i {} \; + fi + if use hardened; then + cd "${S}" + epatch "${FILESDIR}/${PN}"-3.0.2-nopiessp.patch + fi +} + +src_compile() { + local myopt + use debug && myopt="${myopt} debug=y" + use pae && myopt="${myopt} pae=y" + + if use custom-cflags; then + filter-flags -fPIE -fstack-protector + else + unset CFLAGS + fi + + # Send raw LDFLAGS so that --as-needed works + emake LDFLAGS="$(raw-ldflags)" -C xen ${myopt} || die "compile failed" +} + +src_install() { + local myopt + use debug && myopt="${myopt} debug=y" + use pae && myopt="${myopt} pae=y" + + make DESTDIR="${D}" install-xen ${myopt} || die "install failed" +} + +pkg_postinst() { + elog "Please visit the Xen and Gentoo wiki:" + elog "http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo" + + echo + elog "Note: xen tools have been moved to app-emulation/xen-tools" + + if use pae; then + echo + ewarn "This is a PAE build of Xen. It will *only* boot PAE kernels!" + fi +} diff --git a/app-emulation/xen/xen-3.0.4_p1.ebuild b/app-emulation/xen/xen-3.0.4_p1.ebuild index 1e2d91f..de6457f 100644 --- a/app-emulation/xen/xen-3.0.4_p1.ebuild +++ b/app-emulation/xen/xen-3.0.4_p1.ebuild @@ -13,13 +13,12 @@ S="${WORKDIR}/xen-${MY_PV}-src" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="debug custom-cflags pae hardened" +IUSE="debug custom-cflags pae" RDEPEND="|| ( sys-boot/grub sys-boot/grub-static ) - sys-kernel/xen-sources" -PDEPEND="~app-emulation/xen-tools-${PV} - >=sys-kernel/xen-sources-2.6.16.33" + >=sys-kernel/xen-sources-2.6.16.33" +PDEPEND="~app-emulation/xen-tools-${PV}" RESTRICT="test" @@ -38,7 +37,6 @@ pkg_setup() { fi } - src_unpack() { unpack ${A} # if the user *really* wants to use their own custom-cflags, let them @@ -53,10 +51,14 @@ src_unpack() { -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \ -i {} \; fi - if use hardened; then - cd "${S}" - epatch "${FILESDIR}/${PN}"-3.0.2-nopiessp.patch - fi + + # xen tries to be smart and filter out CFLAGs not supported by gcc. + # It doesn't handle no* flags though, but flag-o-matic's test-flag-CC does. + for FLAG in -nopie -fno-stack-protector -fno-stack-protector-all; do + test-flag-CC ${FLAG} && HARDFLAGS="${HARDFLAGS} ${FLAG}" + done + sed -i "s/^CFLAGS-y.*__XEN__.*$/& ${HARDFLAGS}/" \ + "${S}"/xen/Rules.mk } src_compile() { @@ -76,21 +78,21 @@ src_compile() { src_install() { local myopt + use debug && myopt="${myopt} debug=y" use pae && myopt="${myopt} pae=y" make DESTDIR="${D}" ${myopt} install-xen || die "install failed" } pkg_postinst() { - einfo "Please visit the Xen and Gentoo wiki:" - einfo "http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo" + elog "Please visit the Xen and Gentoo wiki:" + elog "http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo" echo - einfo "Note: xen tools have been moved to app-emulation/xen-tools;" - einfo "you need to install that package to manage your domains." + elog "Note: xen tools have been moved to app-emulation/xen-tools" if use pae; then echo - einfo "This is a PAE build of Xen. It will *only* boot PAE kernels!" + ewarn "This is a PAE build of Xen. It will *only* boot PAE kernels!" fi } -- cgit v1.2.3-65-gdbad