kqemu-vl.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. %define build_kmod 0
  2. %define kversion %(uname -r)
  3. %define kver %(uname -r | sed -e 's/-/_/g')
  4. %define kflavor %(uname -r | sed -e 's/.*vl.//')
  5. %if "%kflavor" == ""
  6. %undefine kflavor
  7. %endif
  8. %define kmod kernel-module%{?kflavor:-%{kflavor}}
  9. %define name kqemu
  10. %define ver 1.4.0
  11. %define rel 1.pre1%{?_dist_release}
  12. Summary: QEMU accelerator Linux kernel module
  13. Summary(ja): QEMU Accelerator Linux カーネルモジュール
  14. Name: %{name}
  15. Version: %{ver}
  16. Release: %{rel}
  17. Source0: %{name}-%{ver}pre1.tar.gz
  18. Source1: kqemu.modules
  19. Source2: 99-kqemu.rules
  20. Source10: kqemu-kmp.spec
  21. License: GPL2
  22. Group: System Environment/Base
  23. URL: http://fabrice.bellard.free.fr/qemu/
  24. Requires: qemu >= 0.9.1
  25. BuildRequires: kernel-devel
  26. BuildRoot: %{_tmppath}/%{name}-%{ver}-root
  27. %description
  28. QEMU Accelerator (KQEMU) is a kernel module allowing the QEMU PC
  29. emulator to run much faster when emulating a PC on an x86 host.
  30. %description -l ja
  31. QEMU Accelerator (KQEMU) は、x86 プロセッサを搭載したホスト PC 上で
  32. PC エミュレーションを実行する時に、QEMU PC エミュレータを非常に高速に
  33. 実行できるカーネルモジュールです。
  34. #------------------------------------------------------------------------------
  35. %package -n dkms-%{name}
  36. Summary: QEMU accelerator Linux kernel module
  37. Summary(ja): QEMU Accelerator Linux カーネルモジュール
  38. Group: System Environment/Kernel
  39. Requires: %{name} = %{version}-%{release}
  40. Requires: qemu >= 0.8.1
  41. Requires(pre): kernel, kernel-devel
  42. Requires(post): dkms
  43. Requires(preun): dkms
  44. Obsoletes: kernel-module-kqemu
  45. %description -n dkms-%{name}
  46. QEMU Accelerator (KQEMU) is a kernel module allowing the QEMU PC
  47. emulator to run much faster when emulating a PC on an x86 host.
  48. %description -n dkms-%{name} -l ja
  49. QEMU Accelerator (KQEMU) は、x86 プロセッサを搭載したホスト PC 上で
  50. PC エミュレーションを実行する時に、QEMU PC エミュレータを非常に高速に
  51. 実行できるカーネルモジュールです。
  52. #------------------------------------------------------------------------------
  53. %prep
  54. %setup -q -n %{name}-%{ver}pre1
  55. %build
  56. %install
  57. %__rm -rf %{buildroot}
  58. # install system config files.
  59. %__install -d -m 755 %{buildroot}/%{_sysconfdir}/sysconfig/modules/
  60. %__install -m 755 %{SOURCE1} %{buildroot}/%{_sysconfdir}/sysconfig/modules/
  61. %__install -d -m 755 %{buildroot}/%{_sysconfdir}/udev/rules.d/
  62. %__install -m 644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/udev/rules.d/
  63. # install kernel module source.
  64. mkdir -p %{buildroot}/usr/src/%{name}-%{version}-%{release}
  65. cp -a * %{buildroot}/usr/src/%{name}-%{version}-%{release}/
  66. ## DKMS.CONF ##
  67. cat > %{buildroot}/usr/src/%{name}-%{version}-%{release}/dkms.conf << EOF
  68. PACKAGE_NAME="%{name}"
  69. PACKAGE_VERSION="%{version}-%{release}"
  70. BUILT_MODULE_NAME[0]="kqemu"
  71. DEST_MODULE_LOCATION[0]="/extra/kqemu"
  72. MAKE[0]="./configure --kernel-path=\${kernel_source_dir} && make"
  73. AUTOINSTALL="YES"
  74. EOF
  75. ## KMP.SPEC ##
  76. sed -e 's|##KMOD_NAME##|%{name}|g' \
  77. -e 's|##KMOD_VER##|%{version}-%{release}|g' \
  78. -e 's|##LICENSE##|%{license}|g' \
  79. %{SOURCE10} > \
  80. %{buildroot}/usr/src/%{name}-%{version}-%{release}/%{name}-kmp.spec
  81. %clean
  82. %__rm -rf %{buildroot}
  83. %post -n dkms-%{name}
  84. /usr/sbin/dkms add -m %{name} -v %{version}-%{release} --rpm_safe_upgrade
  85. /usr/sbin/dkms mkkmp -m %{name} -v %{version}-%{release}
  86. /usr/sbin/dkms build -m %{name} -v %{version}-%{release} --rpm_safe_upgrade
  87. /usr/sbin/dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade
  88. exit 0
  89. %preun -n dkms-%{name}
  90. /usr/sbin/dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all
  91. exit 0
  92. %files
  93. %defattr(-,root,root)
  94. %doc Changelog LICENSE kqemu-doc.html kqemu-doc.texi
  95. %{_sysconfdir}/sysconfig/modules/kqemu.modules
  96. %{_sysconfdir}/udev/rules.d/99-kqemu.rules
  97. %files -n dkms-%{name}
  98. %defattr(-,root,root)
  99. %dir /usr/src/%{name}-%{version}-%{release}
  100. /usr/src/%{name}-%{version}-%{release}/*
  101. %changelog
  102. * Tue Nov 03 2009 NAKAMURA Kenta <kenta@vinelinux.org> - 1.4.0-1.pre1
  103. - new upstream release.
  104. * Sat May 2 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.3.0-5.pre11
  105. - fix post/preun scripts for dkms subpackage
  106. * Sun Apr 26 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.3.0-4.pre11
  107. - add Source10 for mkkmp feature
  108. * Thu Apr 9 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.3.0-3.pre11
  109. - drop kernel-module-kqemu subpackage; make DKMS-compatible
  110. * Tue Jan 28 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.3.0-2.pre11
  111. - add kflavor(pae,smp..) to package name
  112. * Sun Apr 27 2008 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.3.0-1.pre11
  113. - apply new versioning policy.
  114. * Wed Mar 07 2007 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.3.0-0vl4.0pre11
  115. - new upstream release.
  116. - license is changed to GPL.
  117. * Wed Sep 06 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.3.0-0vl3.0pre9
  118. - fix typo of Group <BTS:VineLinux:148>.
  119. * Sat Jul 22 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.3.0-0vl2.0pre9
  120. - run depmod for target kernel version
  121. (we need System.map to run depmod in %%post script)
  122. * Mon Jul 17 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.3.0-0vl1.0pre9
  123. - combine kqemu-common & kernel-module-kqemu to one source package.
  124. - add build_kmod option to switch build target.(kqemu or kernel-module-kqemu)
  125. - change Group to System Environment/Base for kqemu.
  126. - build for kernel-2.6.16-0vl20
  127. * Mon Jul 03 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.3.0-0vl0.0pre9.2
  128. - build for kernel-2.6.16-0vl19
  129. - add Requires qemu >= 0.8.1
  130. * Sun Jul 02 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.3.0-0vl0.0pre9.1
  131. - build for kernel-2.6.16-0vl18
  132. * Sun Jul 02 2006 Kazutaka HARADA <kazutaka@dc4.so-net.ne.jp> 1.3.0-0vl0.0pre9.1
  133. - initial build for VineSeed test package.
  134. - build for kernel-2.6.16-0vl17