kvm-vl.spec 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. Summary: Kernel-based Virtual Machine
  2. Summary(ja): カーネルベースの仮想マシン
  3. Name: kvm
  4. Version: 83
  5. Release: 1%{?_dist_release}
  6. License: GPLv2+ and LGPLv2+
  7. Group: Development/Tools
  8. URL: http://kvm.qumranet.com/kvmwiki
  9. Source0: %{name}-%{version}.tar.gz
  10. Source1: %{name}.modules
  11. Patch2: %{name}-62-block-rw-range-check.patch
  12. # patches from upstream qemu
  13. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  14. BuildRequires: SDL-devel
  15. # to build the bios
  16. BuildRequires: dev86
  17. BuildRequires: iasl
  18. BuildRequires: %{_includedir}/gnu/stubs-32.h
  19. BuildRequires: zlib-devel
  20. # TLS / x509 auth in VNC server
  21. BuildRequires: gnutls-devel
  22. # for the docs
  23. BuildRequires: texi2html
  24. BuildRequires: rsync
  25. # kvm kernel side is only x86/x86_64 as that's where the hardware is
  26. ExclusiveArch: %{ix86} x86_64
  27. %description
  28. KVM (for Kernel-based Virtual Machine) is a full virtualization solution
  29. for Linux on x86 hardware.
  30. Using KVM, one can run multiple virtual machines running unmodified Linux
  31. or Windows images. Each virtual machine has private virtualized hardware:
  32. a network card, disk, graphics adapter, etc.
  33. %prep
  34. %setup -q
  35. %patch2 -p1
  36. # "configure --kerneldir" looks for this
  37. # FIXME: kvm-84 or later shouldn't need this anymore, see:
  38. # http://git.kernel.org/?p=linux/kernel/git/marcelo/kvm-userspace.git;a=commit;h=4f45aa2db
  39. echo "%{name}-%{version}" > $(pwd)/kernel/.kernelrelease
  40. # we must not use any of the binaries from the qemu/pc-bios/ directory,
  41. # as they don't have the corresponding sources shipped with them
  42. rm -f qemu/pc-bios/*.{bin,x,dtb} qemu/pc-bios/openbios-*
  43. find qemu/pc-bios -exec file {} \; | grep '\(data\|BIOS\|executable\)' && \
  44. echo "Found some binary blobs in qemu/pc-bios!" && exit 1
  45. %build
  46. # systems like rhel build system does not have a recent enough linker so
  47. # --build-id works. this option is used fedora 8 onwards for giving info
  48. # to the debug packages.
  49. build_id_available() {
  50. echo "int main () { return 0; }" | gcc -x c -Wl,--build-id - 2>/dev/null
  51. }
  52. if build_id_available; then
  53. qemuldflags="-Wl,--build-id";
  54. else
  55. qemuldflags="";
  56. fi
  57. # we need to install the data bits in a different path
  58. sed -i 's/datasuffix=\"\/share\/qemu\"/datasuffix=\"\/share\/kvm\"/' qemu/configure
  59. ./configure \
  60. --with-patched-kernel \
  61. --kerneldir=$(pwd)/kernel \
  62. --prefix=%{_prefix} \
  63. --qemu-ldflags=$qemuldflags \
  64. --disable-blobs \
  65. --audio-drv-list=sdl,alsa,oss
  66. # build the bios, and fix it's makefile
  67. sed -i 's/gcc -m32/gcc/' bios/Makefile
  68. make bios
  69. make vgabios
  70. # we can't use RPM_OPT_FLAGS for the same reasons as qemu (#208026) for the
  71. # qemu bits. so let's set it for the other pieces. this requires some
  72. # manual keeping up of what is in the kvm tree.
  73. sed -i 's/CFLAGS =/CFLAGS +=/' user/Makefile
  74. echo "CFLAGS=$RPM_OPT_FLAGS" >> user/config.mak
  75. make %{?_smp_mflags}
  76. %install
  77. rm -rf $RPM_BUILD_ROOT
  78. make DESTDIR=$RPM_BUILD_ROOT install
  79. # we have to have our own copies of the bios/keymaps due to incompat with
  80. # qemu 0.9. include the man page
  81. mv $RPM_BUILD_ROOT/%{_mandir}/man1/qemu.1* $RPM_BUILD_ROOT/%{_mandir}/man1/qemu-kvm.1
  82. rm -rf $RPM_BUILD_ROOT/%{_mandir}/man*/qemu-img* $RPM_BUILD_ROOT/%{_docdir}
  83. rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu-img
  84. # no shared lib, static libs
  85. rm -fr $RPM_BUILD_ROOT/%{_includedir} $RPM_BUILD_ROOT/%{_libdir}
  86. # make install gives it bogus execute permissiions
  87. chmod -x $RPM_BUILD_ROOT/%{_mandir}/man1/qemu-kvm.1*
  88. install -d $RPM_BUILD_ROOT/%{_datadir}/%{name}
  89. for i in bios.bin extboot.bin vgabios.bin vgabios-cirrus.bin
  90. do
  91. install -m 0644 qemu/pc-bios/$i $RPM_BUILD_ROOT/%{_datadir}/%{name}/$i
  92. done
  93. mv $RPM_BUILD_ROOT/%{_bindir}/qemu-system-x86_64 $RPM_BUILD_ROOT/%{_bindir}/qemu-kvm
  94. mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/modules
  95. install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/modules/kvm.modules
  96. install -m 0755 user/kvmtrace %{buildroot}/%{_bindir}/
  97. install -m 0755 user/kvmtrace_format %{buildroot}/%{_bindir}/
  98. # the pxe etherboot images will be symlinks to the images on
  99. # /usr/share/etherboot, as KVM doesn't know how to look
  100. # for other paths, yet.
  101. pxe_link() {
  102. ln -s ../etherboot/$2.rom %{buildroot}/usr/share/kvm/pxe-$1.bin
  103. }
  104. pxe_link e1000 e1000-82542
  105. pxe_link ne2k_pci ne
  106. pxe_link pcnet pcnet32
  107. pxe_link rtl8139 rtl8139
  108. pxe_link virtio virtio-net
  109. %post
  110. # load kvm modules now, so we can make sure no reboot is needed.
  111. # If there's already a kvm module installed, we don't mess with it
  112. sh /%{_sysconfdir}/sysconfig/modules/kvm.modules
  113. %clean
  114. rm -rf $RPM_BUILD_ROOT
  115. %files
  116. %defattr(-,root,root,-)
  117. %{_bindir}/*
  118. %{_mandir}/*
  119. %{_datadir}/%{name}
  120. %{_sysconfdir}/sysconfig/modules/%{name}.modules
  121. %changelog
  122. * Mon Jan 19 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 83-1
  123. - new upstream release
  124. - build with gnutls-1.6.3
  125. * Mon Jul 07 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 70-1
  126. - new upstream release
  127. - import patches from fedora
  128. * Thu Nov 01 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 48-0vl1
  129. - initial build for Vine Linux
  130. - update to kvm-48
  131. * Mon Oct 15 2007 Daniel P. Berrange <berrange@redhat.com> - 36-7.fc8
  132. - Fixed PXE boot when KVM is enabled (rhbz #331191)
  133. * Wed Sep 26 2007 Daniel P. Berrange <berrange@redhat.com> - 36-6.fc8
  134. - Fixed rtl8139 checksum calculation for Vista (rhbz #308201)
  135. * Mon Sep 24 2007 Jeremy Katz <katzj@redhat.com> - 36-5
  136. - fix build on x86_64
  137. * Mon Sep 24 2007 Jeremy Katz <katzj@redhat.com> - 36-3
  138. - add support for selecting boot device at runtime
  139. * Tue Sep 4 2007 Jeremy Katz <katzj@redhat.com> - 36-2
  140. - rebase vnc auth patch
  141. * Tue Sep 4 2007 Jeremy Katz <katzj@redhat.com> - 36-1
  142. - update to kvm-36
  143. * Mon Aug 27 2007 Daniel P. Berrange <berrange@redhat.com> - 35-3.fc8
  144. - Added patch for VNC password auth and TLS+x509 cert auth
  145. * Mon Aug 20 2007 Jeremy Katz <katzj@redhat.com> - 35-2
  146. - add fix for ATAPI from upstream qemu
  147. * Mon Aug 20 2007 Jeremy Katz <katzj@redhat.com> - 35-1
  148. - update to kvm-35
  149. - patch to use -Wl,--build-id so that we get debuginfo
  150. * Thu Jul 19 2007 Jeremy Katz <katzj@redhat.com> - 31-1
  151. - update to kvm-31
  152. * Mon Jul 16 2007 Jeremy Katz <katzj@redhat.com> - 28-2
  153. - add patch from danpb to fix mac addrs of multiple 8139 nics (#247641)
  154. * Wed Jun 13 2007 Jeremy Katz <katzj@redhat.com> - 28-1
  155. - update to kvm-28
  156. * Sat Jun 9 2007 Jeremy Katz <katzj@redhat.com> - 27-1
  157. - update to kvm-27
  158. * Tue May 29 2007 Jeremy Katz <katzj@redhat.com> - 26-1
  159. - update to kvm-26
  160. * Wed May 16 2007 Jeremy Katz <katzj@redhat.com> - 24-1
  161. - update to kvm-24
  162. * Wed Apr 25 2007 Jeremy Katz <katzj@redhat.com> - 19-2
  163. - fix kernel and ramdisk being specified on the command line (#237879)
  164. * Tue Apr 17 2007 Jeremy Katz <katzj@redhat.com> - 19-1
  165. - update to kvm-19
  166. - use rtl8139 as the default nic emulation instead of ne2k_pci (#236790)
  167. * Mon Mar 26 2007 Jeremy Katz <katzj@redhat.com> - 15-2
  168. - add file so that kvm modules get loaded on boot
  169. * Wed Mar 7 2007 Jeremy Katz <katzj@redhat.com> - 15-1
  170. - update to kvm-15
  171. * Mon Feb 26 2007 Jeremy Katz <katzj@redhat.com> - 14-2
  172. - use default optflags for non-qemu pieces (#230012)
  173. * Fri Feb 23 2007 Jeremy Katz <katzj@redhat.com> - 14-1
  174. - update to kvm-14
  175. - note: this requires a kernel that's 2.6.21-rc1 or newer
  176. * Mon Feb 19 2007 Jeremy Katz <katzj@redhat.com> - 12-3
  177. - add the buildrequires for the docs to build
  178. * Mon Feb 19 2007 Jeremy Katz <katzj@redhat.com> - 12-2
  179. - include bios and keymaps in the kvm package since we need a slightly
  180. different version for kvm now
  181. - include man page
  182. * Fri Jan 26 2007 Jeremy Katz <katzj@redhat.com> - 12-1
  183. - update to kvm-12
  184. - add qemu patch for better ATAPI DMA support (which works with ata_piix)
  185. * Fri Jan 19 2007 Jeremy Katz <katzj@redhat.com> - 11-1
  186. - update to kvm-11
  187. * Fri Jan 5 2007 Jeremy Katz <katzj@redhat.com> - 9-1
  188. - update to kvm-9
  189. * Wed Jan 3 2007 Jeremy Katz <katzj@redhat.com> - 7-4
  190. - actually build without -devel...
  191. * Wed Dec 20 2006 Jeremy Katz <katzj@redhat.com> - 7-3
  192. - remove the -devel subpackage since there's no shared lib upstream yet
  193. - direct download link for source
  194. * Tue Dec 19 2006 Jeremy Katz <katzj@redhat.com> - 7-2
  195. - BR e2fsprogs-devel
  196. * Tue Dec 19 2006 Jeremy Katz <katzj@redhat.com> - 7-1
  197. - Initial build