diff options
author | 2007-07-22 13:48:00 +0000 | |
---|---|---|
committer | 2007-07-22 13:48:00 +0000 | |
commit | 534571fd6de77a68558d1e4d9f1fce83c5d42a59 (patch) | |
tree | b189efc40539ba283107bd089d1e8070c374f626 | |
parent | winetools ebuild. cf. bug 46390. (diff) | |
download | philantrop-534571fd6de77a68558d1e4d9f1fce83c5d42a59.tar.gz philantrop-534571fd6de77a68558d1e4d9f1fce83c5d42a59.tar.bz2 philantrop-534571fd6de77a68558d1e4d9f1fce83c5d42a59.zip |
Ugly ebuilds for kvm but they suit my needs for now. :-)
svn path=/trunk/; revision=15
-rw-r--r-- | app-emulation/kvm/Manifest | 44 | ||||
-rw-r--r-- | app-emulation/kvm/files/digest-kvm-27 | 2 | ||||
-rw-r--r-- | app-emulation/kvm/files/digest-kvm-28 | 2 | ||||
-rw-r--r-- | app-emulation/kvm/files/digest-kvm-29 | 2 | ||||
-rw-r--r-- | app-emulation/kvm/files/digest-kvm-31 | 2 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm_add-scripts-qemu-ifup.patch | 12 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm_use_bios_files_in_usr_share_kvm.patch | 11 | ||||
-rw-r--r-- | app-emulation/kvm/files/kvm_use_etc_kvm_kvm-ifup.patch | 15 | ||||
-rw-r--r-- | app-emulation/kvm/kvm-27.ebuild | 83 | ||||
-rw-r--r-- | app-emulation/kvm/kvm-28.ebuild | 83 | ||||
-rw-r--r-- | app-emulation/kvm/kvm-29.ebuild | 87 | ||||
-rw-r--r-- | app-emulation/kvm/kvm-31.ebuild | 83 |
12 files changed, 426 insertions, 0 deletions
diff --git a/app-emulation/kvm/Manifest b/app-emulation/kvm/Manifest new file mode 100644 index 0000000..e707f9b --- /dev/null +++ b/app-emulation/kvm/Manifest @@ -0,0 +1,44 @@ +AUX kvm_add-scripts-qemu-ifup.patch 359 RMD160 d66e31dedd21c5fb752721ae2bc86caaf0e1301d SHA1 3e5eede431640625a2cfc03c4f1a39b0bd3f33fe SHA256 7f47028bc50cc669bebe1ca70e667a296715601601be71049a2f7c1d211bb320 +MD5 11750a6894c39ab6350cb62c034b6796 files/kvm_add-scripts-qemu-ifup.patch 359 +RMD160 d66e31dedd21c5fb752721ae2bc86caaf0e1301d files/kvm_add-scripts-qemu-ifup.patch 359 +SHA256 7f47028bc50cc669bebe1ca70e667a296715601601be71049a2f7c1d211bb320 files/kvm_add-scripts-qemu-ifup.patch 359 +AUX kvm_use_bios_files_in_usr_share_kvm.patch 306 RMD160 e9f299ea50151d7eb41a33d05dd86dca766d319d SHA1 8a721d15f518ed20da0ba9852737b119c4fa724f SHA256 3757405b687431d5998d89cf844015713b6b3d6dc90965bdc73bd0dfec38c585 +MD5 0088f7d64734479ddd9c181dfdacd070 files/kvm_use_bios_files_in_usr_share_kvm.patch 306 +RMD160 e9f299ea50151d7eb41a33d05dd86dca766d319d files/kvm_use_bios_files_in_usr_share_kvm.patch 306 +SHA256 3757405b687431d5998d89cf844015713b6b3d6dc90965bdc73bd0dfec38c585 files/kvm_use_bios_files_in_usr_share_kvm.patch 306 +AUX kvm_use_etc_kvm_kvm-ifup.patch 437 RMD160 d1127dd655b94fc518c9bb9abc7e8a72b75e0330 SHA1 403acc59c7b9a61ff25da302bb094116b6ebe23c SHA256 3c49a8a11f5941f148f09ad3bedda6fa2513e83d746f39060be09b05beec48ce +MD5 3c362ab33d2691d93b538cf965090dfe files/kvm_use_etc_kvm_kvm-ifup.patch 437 +RMD160 d1127dd655b94fc518c9bb9abc7e8a72b75e0330 files/kvm_use_etc_kvm_kvm-ifup.patch 437 +SHA256 3c49a8a11f5941f148f09ad3bedda6fa2513e83d746f39060be09b05beec48ce files/kvm_use_etc_kvm_kvm-ifup.patch 437 +DIST kvm-27.tar.gz 2965582 RMD160 477f032fd7b408b3823e1694d20f11042fbd7be9 SHA1 dd9c2ccfa95192db14778a991c58fd938bbc9702 SHA256 94dc7240f590de54c509cc0ac0720cdab356dc867558e2466149378825f44289 +DIST kvm-28.tar.gz 2357002 RMD160 b63436a261100f212a22fadcb6df14986e66891d SHA1 04f129d574c2c0c851e88e5ccac9afd95b1f9a0c SHA256 1414fce83709e9297e5f3f235edaf10c1dd2a3a08ed083205a2c41cbcd8510af +DIST kvm-29.tar.gz 2265896 RMD160 5885afa0db6a59034c699bf939f71e14a4df6b2c SHA1 ed6ec8a78fad520d07b621d62ce7764a4bbe475b SHA256 ca30479f3824c22d6434aac39c3497c67383263ce15dff0e402af9df157ad850 +DIST kvm-31.tar.gz 2872227 RMD160 c4ecf444fea67bae5ae23887b0c8aa04ded0b677 SHA1 7069a8f0e3ee925207399cc26053e41383675d82 SHA256 a4f56c7a8750bd518f78d5a53a5426d4af856c21e6fbfcd38a472f33c54a786c +EBUILD kvm-27.ebuild 2171 RMD160 0dc06e97ae84d865a96a0b99c109aba24775d0fc SHA1 ab20fea2653aa4e06a089f32363fe9ca639eda41 SHA256 86c790582915c211de577c9b82b87129ad7cdafd49ba3307a372007f3d6e9c83 +MD5 00f0ddcbdd70ff884ff80872d0748475 kvm-27.ebuild 2171 +RMD160 0dc06e97ae84d865a96a0b99c109aba24775d0fc kvm-27.ebuild 2171 +SHA256 86c790582915c211de577c9b82b87129ad7cdafd49ba3307a372007f3d6e9c83 kvm-27.ebuild 2171 +EBUILD kvm-28.ebuild 2171 RMD160 0dc06e97ae84d865a96a0b99c109aba24775d0fc SHA1 ab20fea2653aa4e06a089f32363fe9ca639eda41 SHA256 86c790582915c211de577c9b82b87129ad7cdafd49ba3307a372007f3d6e9c83 +MD5 00f0ddcbdd70ff884ff80872d0748475 kvm-28.ebuild 2171 +RMD160 0dc06e97ae84d865a96a0b99c109aba24775d0fc kvm-28.ebuild 2171 +SHA256 86c790582915c211de577c9b82b87129ad7cdafd49ba3307a372007f3d6e9c83 kvm-28.ebuild 2171 +EBUILD kvm-29.ebuild 2227 RMD160 e5cfc9d143cdeae49e985d453e78b764610cc616 SHA1 e799e3316525ff9e06c4c1542598329a0c6a2c84 SHA256 f3d5fd939931acf342cf4b57c6c0fdd96d89ae6d35beeff654bfac2d0591d0db +MD5 2feb888be9c29946b01f4acb174d2b51 kvm-29.ebuild 2227 +RMD160 e5cfc9d143cdeae49e985d453e78b764610cc616 kvm-29.ebuild 2227 +SHA256 f3d5fd939931acf342cf4b57c6c0fdd96d89ae6d35beeff654bfac2d0591d0db kvm-29.ebuild 2227 +EBUILD kvm-31.ebuild 2171 RMD160 0dc06e97ae84d865a96a0b99c109aba24775d0fc SHA1 ab20fea2653aa4e06a089f32363fe9ca639eda41 SHA256 86c790582915c211de577c9b82b87129ad7cdafd49ba3307a372007f3d6e9c83 +MD5 00f0ddcbdd70ff884ff80872d0748475 kvm-31.ebuild 2171 +RMD160 0dc06e97ae84d865a96a0b99c109aba24775d0fc kvm-31.ebuild 2171 +SHA256 86c790582915c211de577c9b82b87129ad7cdafd49ba3307a372007f3d6e9c83 kvm-31.ebuild 2171 +MD5 0649bb1e72d169bafccd5dc36484bb1d files/digest-kvm-27 164 +RMD160 191e336e00befee4be10fcb704165d36479ce44e files/digest-kvm-27 164 +SHA256 407c4ce0732f9a5654021b77a325d0451f9db6a95e716c1daef93d077d7deeda files/digest-kvm-27 164 +MD5 06421cbaabd7c3c7e529f3db05ec5d6e files/digest-kvm-28 164 +RMD160 beb452fb42c60813b718812abefc56a21d7982c4 files/digest-kvm-28 164 +SHA256 455cb64123bd7fe46103e1847f36eeff3cd66d30c6741de61fe757a6105c5078 files/digest-kvm-28 164 +MD5 b940f343c3e1fc53e12e1ad3f80f8b48 files/digest-kvm-29 164 +RMD160 0f55f6307e7193cd42b9880539e8ebe0892458a7 files/digest-kvm-29 164 +SHA256 df7dd4350d2e451a5ed66d7ecb65d228626915c42ac7cf77313443b5d3db85c6 files/digest-kvm-29 164 +MD5 570d974b9ed929fdc6f3a34255f1dea3 files/digest-kvm-31 164 +RMD160 531e21e54d8f561c20ff3451481520923f340305 files/digest-kvm-31 164 +SHA256 9f2a2e1480e93bc1856c945eb16f64adbb799a428c2bd97e6ca610f4eb6fa398 files/digest-kvm-31 164 diff --git a/app-emulation/kvm/files/digest-kvm-27 b/app-emulation/kvm/files/digest-kvm-27 new file mode 100644 index 0000000..274f137 --- /dev/null +++ b/app-emulation/kvm/files/digest-kvm-27 @@ -0,0 +1,2 @@ +RMD160 477f032fd7b408b3823e1694d20f11042fbd7be9 kvm-27.tar.gz 2965582 +SHA256 94dc7240f590de54c509cc0ac0720cdab356dc867558e2466149378825f44289 kvm-27.tar.gz 2965582 diff --git a/app-emulation/kvm/files/digest-kvm-28 b/app-emulation/kvm/files/digest-kvm-28 new file mode 100644 index 0000000..4783eaa --- /dev/null +++ b/app-emulation/kvm/files/digest-kvm-28 @@ -0,0 +1,2 @@ +RMD160 b63436a261100f212a22fadcb6df14986e66891d kvm-28.tar.gz 2357002 +SHA256 1414fce83709e9297e5f3f235edaf10c1dd2a3a08ed083205a2c41cbcd8510af kvm-28.tar.gz 2357002 diff --git a/app-emulation/kvm/files/digest-kvm-29 b/app-emulation/kvm/files/digest-kvm-29 new file mode 100644 index 0000000..5437f07 --- /dev/null +++ b/app-emulation/kvm/files/digest-kvm-29 @@ -0,0 +1,2 @@ +RMD160 5885afa0db6a59034c699bf939f71e14a4df6b2c kvm-29.tar.gz 2265896 +SHA256 ca30479f3824c22d6434aac39c3497c67383263ce15dff0e402af9df157ad850 kvm-29.tar.gz 2265896 diff --git a/app-emulation/kvm/files/digest-kvm-31 b/app-emulation/kvm/files/digest-kvm-31 new file mode 100644 index 0000000..07cf36d --- /dev/null +++ b/app-emulation/kvm/files/digest-kvm-31 @@ -0,0 +1,2 @@ +RMD160 c4ecf444fea67bae5ae23887b0c8aa04ded0b677 kvm-31.tar.gz 2872227 +SHA256 a4f56c7a8750bd518f78d5a53a5426d4af856c21e6fbfcd38a472f33c54a786c kvm-31.tar.gz 2872227 diff --git a/app-emulation/kvm/files/kvm_add-scripts-qemu-ifup.patch b/app-emulation/kvm/files/kvm_add-scripts-qemu-ifup.patch new file mode 100644 index 0000000..37fc63e --- /dev/null +++ b/app-emulation/kvm/files/kvm_add-scripts-qemu-ifup.patch @@ -0,0 +1,12 @@ + +Taken from upstream SVN, in scripts/qemu-ifup. + +diff -ruN scripts-orig/qemu-ifup scripts/qemu-ifup +--- scripts-orig/qemu-ifup 1970-01-01 02:00:00.000000000 +0200 ++++ scripts/qemu-ifup 2006-12-23 08:32:56.000000000 +0200 +@@ -0,0 +1,5 @@ ++#!/bin/sh ++ ++switch=$(ip route list | awk '/^default / { print $NF }') ++ifconfig $1 0.0.0.0 up ++brctl addif ${switch} $1 diff --git a/app-emulation/kvm/files/kvm_use_bios_files_in_usr_share_kvm.patch b/app-emulation/kvm/files/kvm_use_bios_files_in_usr_share_kvm.patch new file mode 100644 index 0000000..8b54a5d --- /dev/null +++ b/app-emulation/kvm/files/kvm_use_bios_files_in_usr_share_kvm.patch @@ -0,0 +1,11 @@ +--- qemu/configure~ 2006-11-02 14:25:06.000000000 +0200 ++++ qemu/configure 2007-01-12 11:54:05.000000000 +0200 +@@ -514,7 +514,7 @@ + prefix="/usr/local" + fi + mandir="$prefix/share/man" +-datadir="$prefix/share/qemu" ++datadir="$prefix/share/kvm" + docdir="$prefix/share/doc/qemu" + bindir="$prefix/bin" + fi diff --git a/app-emulation/kvm/files/kvm_use_etc_kvm_kvm-ifup.patch b/app-emulation/kvm/files/kvm_use_etc_kvm_kvm-ifup.patch new file mode 100644 index 0000000..d427bfb --- /dev/null +++ b/app-emulation/kvm/files/kvm_use_etc_kvm_kvm-ifup.patch @@ -0,0 +1,15 @@ + +Use an independent script to control the network at startup. + +diff -ruN kvm-orig/qemu/vl.c kvm/qemu/vl.c +--- kvm-orig/qemu/vl.c 2007-02-14 06:56:52.000000000 +0100 ++++ kvm/qemu/vl.c 2007-02-14 18:38:13.000000000 +0100 +@@ -92,7 +92,7 @@ + #include "qemu-kvm.h" + #endif + +-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" ++#define DEFAULT_NETWORK_SCRIPT "/etc/kvm/kvm-ifup" + #ifdef __sun__ + #define SMBD_COMMAND "/usr/sfw/sbin/smbd" + #else diff --git a/app-emulation/kvm/kvm-27.ebuild b/app-emulation/kvm/kvm-27.ebuild new file mode 100644 index 0000000..641eac9 --- /dev/null +++ b/app-emulation/kvm/kvm-27.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit linux-mod eutils + +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +DESCRIPTION="KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V)" +HOMEPAGE="http://kvm.qumranet.com/kvmwiki" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +RESTRICT="mirror" + +MODULE_NAMES="kernel/kvm(extra:) + kernel/kvm-intel(extra:) + kernel/kvm-amd(extra:)" +BUILD_TARGETS="kernel" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch ${FILESDIR}/kvm_use_bios_files_in_usr_share_kvm.patch + epatch ${FILESDIR}/kvm_add-scripts-qemu-ifup.patch + epatch ${FILESDIR}/kvm_use_etc_kvm_kvm-ifup.patch +} + +src_compile() { + + if [ "$(gcc-major-version)" == "4" ]; then + eerror "kvm requires gcc-3 in order to build and work correctly" + eerror "please compile it switching to gcc-3." + die "gcc 4 cannot build qemu" + fi + + #fix make install to not install modules + sed -i '/$(kcmd)/d' ${WORKDIR}/${P}/Makefile + + linux-mod_pkg_setup + conf_opts="--prefix=/usr" + + ./configure ${conf_opts} || die "configure failed" + #Check if kvm is NOT part of the kernel and compile the module + if ! linux_chkconfig_present KVM; then + linux-mod_src_compile + ./configure ${conf_opts} + #If it is we need to disable the build of the module + else + ./configure ${conf_opts} --with-patched-kernel || die "Configure failed" + fi + make user qemu || die "make failed" +} + +pkg_preinst() { + enewgroup kvm +} + +src_install() { + make install DESTDIR="${D}" || die + if ! linux_chkconfig_present KVM; then + linux-mod_src_install + fi + + if use amd64; then + mv ${D}/usr/bin/qemu-system-x86_64 ${D}/usr/bin/kvm-system-x86_64 + else + mv ${D}/usr/bin/qemu ${D}/usr/bin/kvm + fi + + mv ${D}/usr/share/doc/qemu ${D}/usr/share/doc/kvm + mv ${D}/usr/share/man/man1/qemu.1 ${D}/usr/share/man/man1/kvm.1 +# rm -f ${D}/usr/bin/qemu-img +# rm -f ${D}/usr/share/man/man1/qemu-img.1 + insinto /etc/udev/rules.d/ + doins ${WORKDIR}/${P}/scripts/65-kvm.rules + insinto /etc/kvm/ + doins ${WORKDIR}/${P}/scripts/qemu-ifup +} diff --git a/app-emulation/kvm/kvm-28.ebuild b/app-emulation/kvm/kvm-28.ebuild new file mode 100644 index 0000000..641eac9 --- /dev/null +++ b/app-emulation/kvm/kvm-28.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit linux-mod eutils + +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +DESCRIPTION="KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V)" +HOMEPAGE="http://kvm.qumranet.com/kvmwiki" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +RESTRICT="mirror" + +MODULE_NAMES="kernel/kvm(extra:) + kernel/kvm-intel(extra:) + kernel/kvm-amd(extra:)" +BUILD_TARGETS="kernel" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch ${FILESDIR}/kvm_use_bios_files_in_usr_share_kvm.patch + epatch ${FILESDIR}/kvm_add-scripts-qemu-ifup.patch + epatch ${FILESDIR}/kvm_use_etc_kvm_kvm-ifup.patch +} + +src_compile() { + + if [ "$(gcc-major-version)" == "4" ]; then + eerror "kvm requires gcc-3 in order to build and work correctly" + eerror "please compile it switching to gcc-3." + die "gcc 4 cannot build qemu" + fi + + #fix make install to not install modules + sed -i '/$(kcmd)/d' ${WORKDIR}/${P}/Makefile + + linux-mod_pkg_setup + conf_opts="--prefix=/usr" + + ./configure ${conf_opts} || die "configure failed" + #Check if kvm is NOT part of the kernel and compile the module + if ! linux_chkconfig_present KVM; then + linux-mod_src_compile + ./configure ${conf_opts} + #If it is we need to disable the build of the module + else + ./configure ${conf_opts} --with-patched-kernel || die "Configure failed" + fi + make user qemu || die "make failed" +} + +pkg_preinst() { + enewgroup kvm +} + +src_install() { + make install DESTDIR="${D}" || die + if ! linux_chkconfig_present KVM; then + linux-mod_src_install + fi + + if use amd64; then + mv ${D}/usr/bin/qemu-system-x86_64 ${D}/usr/bin/kvm-system-x86_64 + else + mv ${D}/usr/bin/qemu ${D}/usr/bin/kvm + fi + + mv ${D}/usr/share/doc/qemu ${D}/usr/share/doc/kvm + mv ${D}/usr/share/man/man1/qemu.1 ${D}/usr/share/man/man1/kvm.1 +# rm -f ${D}/usr/bin/qemu-img +# rm -f ${D}/usr/share/man/man1/qemu-img.1 + insinto /etc/udev/rules.d/ + doins ${WORKDIR}/${P}/scripts/65-kvm.rules + insinto /etc/kvm/ + doins ${WORKDIR}/${P}/scripts/qemu-ifup +} diff --git a/app-emulation/kvm/kvm-29.ebuild b/app-emulation/kvm/kvm-29.ebuild new file mode 100644 index 0000000..233e6e3 --- /dev/null +++ b/app-emulation/kvm/kvm-29.ebuild @@ -0,0 +1,87 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit linux-mod eutils + +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +DESCRIPTION="KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V)" +HOMEPAGE="http://kvm.qumranet.com/kvmwiki" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="alsa" + +RESTRICT="mirror" + +DEPEND="media-libs/libsdl + " +REDEPEND="${DEPEND}" + +MODULE_NAMES="kernel/kvm(extra:) + kernel/kvm-intel(extra:) + kernel/kvm-amd(extra:)" +BUILD_TARGETS="kernel" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch ${FILESDIR}/kvm_use_bios_files_in_usr_share_kvm.patch + epatch ${FILESDIR}/kvm_add-scripts-qemu-ifup.patch + epatch ${FILESDIR}/kvm_use_etc_kvm_kvm-ifup.patch +} + +src_compile() { + + if [ "$(gcc-major-version)" == "4" ]; then + eerror "kvm requires gcc-3 in order to build and work correctly" + eerror "please compile it switching to gcc-3." + die "gcc 4 cannot build qemu" + fi + + #fix make install to not install modules + sed -i '/$(kcmd)/d' ${WORKDIR}/${P}/Makefile + + linux-mod_pkg_setup + conf_opts="--prefix=/usr" + + ./configure ${conf_opts} || die "configure failed" + #Check if kvm is NOT part of the kernel and compile the module + if ! linux_chkconfig_present KVM; then + linux-mod_src_compile + ./configure ${conf_opts} + #If it is we need to disable the build of the module + else + ./configure ${conf_opts} --with-patched-kernel || die "Configure failed" + fi + make user qemu || die "make failed" +} + +pkg_preinst() { + enewgroup kvm +} + +src_install() { + make install DESTDIR="${D}" || die + if ! linux_chkconfig_present KVM; then + linux-mod_src_install + fi + + if use amd64; then + mv ${D}/usr/bin/qemu-system-x86_64 ${D}/usr/bin/kvm-system-x86_64 + else + mv ${D}/usr/bin/qemu ${D}/usr/bin/kvm + fi + + mv ${D}/usr/share/doc/qemu ${D}/usr/share/doc/kvm + mv ${D}/usr/share/man/man1/qemu.1 ${D}/usr/share/man/man1/kvm.1 +# rm -f ${D}/usr/bin/qemu-img +# rm -f ${D}/usr/share/man/man1/qemu-img.1 + insinto /etc/udev/rules.d/ + doins ${WORKDIR}/${P}/scripts/65-kvm.rules + insinto /etc/kvm/ + doins ${WORKDIR}/${P}/scripts/qemu-ifup +} diff --git a/app-emulation/kvm/kvm-31.ebuild b/app-emulation/kvm/kvm-31.ebuild new file mode 100644 index 0000000..641eac9 --- /dev/null +++ b/app-emulation/kvm/kvm-31.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit linux-mod eutils + +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +DESCRIPTION="KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V)" +HOMEPAGE="http://kvm.qumranet.com/kvmwiki" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +RESTRICT="mirror" + +MODULE_NAMES="kernel/kvm(extra:) + kernel/kvm-intel(extra:) + kernel/kvm-amd(extra:)" +BUILD_TARGETS="kernel" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch ${FILESDIR}/kvm_use_bios_files_in_usr_share_kvm.patch + epatch ${FILESDIR}/kvm_add-scripts-qemu-ifup.patch + epatch ${FILESDIR}/kvm_use_etc_kvm_kvm-ifup.patch +} + +src_compile() { + + if [ "$(gcc-major-version)" == "4" ]; then + eerror "kvm requires gcc-3 in order to build and work correctly" + eerror "please compile it switching to gcc-3." + die "gcc 4 cannot build qemu" + fi + + #fix make install to not install modules + sed -i '/$(kcmd)/d' ${WORKDIR}/${P}/Makefile + + linux-mod_pkg_setup + conf_opts="--prefix=/usr" + + ./configure ${conf_opts} || die "configure failed" + #Check if kvm is NOT part of the kernel and compile the module + if ! linux_chkconfig_present KVM; then + linux-mod_src_compile + ./configure ${conf_opts} + #If it is we need to disable the build of the module + else + ./configure ${conf_opts} --with-patched-kernel || die "Configure failed" + fi + make user qemu || die "make failed" +} + +pkg_preinst() { + enewgroup kvm +} + +src_install() { + make install DESTDIR="${D}" || die + if ! linux_chkconfig_present KVM; then + linux-mod_src_install + fi + + if use amd64; then + mv ${D}/usr/bin/qemu-system-x86_64 ${D}/usr/bin/kvm-system-x86_64 + else + mv ${D}/usr/bin/qemu ${D}/usr/bin/kvm + fi + + mv ${D}/usr/share/doc/qemu ${D}/usr/share/doc/kvm + mv ${D}/usr/share/man/man1/qemu.1 ${D}/usr/share/man/man1/kvm.1 +# rm -f ${D}/usr/bin/qemu-img +# rm -f ${D}/usr/share/man/man1/qemu-img.1 + insinto /etc/udev/rules.d/ + doins ${WORKDIR}/${P}/scripts/65-kvm.rules + insinto /etc/kvm/ + doins ${WORKDIR}/${P}/scripts/qemu-ifup +} |