]> git.pld-linux.org Git - packages/qemu.git/blobdiff - qemu.spec
- BR: rpmbuild(macros) >= 1.330 -- build_kernel_modules fix for kernels 2.6.18
[packages/qemu.git] / qemu.spec
index 062b1a863dae8ca03e3566e24de1f04524b4147e..ae8b853e34550882c63da673f4f10b4f4b9c12ed 100644 (file)
--- a/qemu.spec
+++ b/qemu.spec
@@ -37,16 +37,18 @@ Patch5:             %{name}-gcc4_ppc.patch
 Patch6:                %{name}-nosdlgui.patch
 Patch7:                %{name}-ifup.patch
 URL:           http://fabrice.bellard.free.fr/qemu/
+%if %{with kernel} && %{with dist_kernel}
+BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7
+%endif
+%if %{with userspace}
 BuildRequires: SDL-devel >= 1.2.1
 BuildRequires: alsa-lib-devel
 %{!?with_gcc4:BuildRequires:   gcc < 5:4.0}
-%if %{with kqemu} && %{with dist_kernel}
-BuildRequires: kernel%{_alt_kernel}-module-build >= 3:2.6.7
-%endif
 BuildRequires: perl-tools-pod
-BuildRequires: rpmbuild(macros) >= 1.326
+BuildRequires: rpmbuild(macros) >= 1.330
 BuildRequires: tetex
 BuildRequires: sed >= 4.0
+%endif
 Requires:      SDL >= 1.2.1
 # sparc is currently unsupported (missing cpu_get_real_ticks() impl in vl.c)
 ExclusiveArch: %{ix86} %{x8664} %{!?with_kqemu:ppc}
@@ -161,9 +163,20 @@ EOF
 %build
 %if %{with kernel}
 cd kqemu-%{_kqemu_version}
+
+mv -f kqemu-mod-i386.o{,.bin}
+mv -f kqemu-mod-x86_64.o{,.bin}
 mv -f kqemu-linux.c{,.orig}
+cat > Makefile <<'EOF'
+obj-m := kqemu.o
+kqemu-objs:= kqemu-linux.o kqemu-mod.o
+
+$(obj)/kqemu-mod.o: $(src)/kqemu-mod-$(ARCH).o.bin
+       cp $< $@
+EOF
+
 %build_kernel_modules -m kqemu <<'EOF'
-if grep -q "CONFIG_PREEMPT_RT$" o/.config; then
+if grep -q "CONFIG_PREEMPT_RT" o/.config; then
        sed 's/SPIN_LOCK_UNLOCKED/SPIN_LOCK_UNLOCKED(kqemu_lock)/' \
                kqemu-linux.c.orig > kqemu-linux.c
 else
This page took 0.108334 seconds and 4 git commands to generate.