]> git.pld-linux.org Git - packages/qemu.git/blobdiff - qemu.spec
- build kernel modules, now is broken without kqemu, NFY
[packages/qemu.git] / qemu.spec
index 71f14e79cfc47d26f05b95ccc7ae81e232f00067..56f14887aaf7844641514117fcb23602033fca8f 100644 (file)
--- a/qemu.spec
+++ b/qemu.spec
@@ -1,20 +1,30 @@
+#
+# Conditional build:
+%bcond_with    kqemu                   # with QEMU accelerator module
+#
 Summary:       QEMU CPU Emulator
 Summary(pl):   QEMU - emulator procesora
 Name:          qemu
 Version:       0.7.0
-Release:       1
+Release:       1.1
 License:       GPL
 Group:         Applications/Emulators
 #Source0Download: http://fabrice.bellard.free.fr/qemu/download.html
 Source0:       http://fabrice.bellard.free.fr/qemu/%{name}-%{version}.tar.gz
 # Source0-md5: 234e9ace03b00259bb57dc5a9c633056
+%if %{with kqemu}
+Source1:       http://fabrice.bellard.free.fr/qemu/kqemu-0.6.2-1.tar.gz
+# NoSource1-md5:       c6bb3b40fb3d526d731eb0f1f9dee7ee
+NoSource:      1
+%endif
 Patch0:                %{name}-nostatic.patch
 Patch1:                %{name}-DESTDIR.patch
 Patch2:                %{name}-longjmp.patch
 Patch3:                %{name}-dot.patch
 URL:           http://fabrice.bellard.free.fr/qemu/
 BuildRequires: SDL-devel >= 1.2.1
-ExclusiveArch: %{ix86} amd64 ppc
+BuildRequires: sed >= 4.0
+ExclusiveArch: %{ix86} %{x8664} ppc
 # sparc is currently unsupported (missing cpu_get_real_ticks() impl in vl.c)
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -54,19 +64,37 @@ aby dzia
   pecetów na pojedynczym serwerze.
 
 %prep
-%setup -q
+%setup -q %{?with_kqemu:-a1}
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
 
+sed -i -e 's/sdl_static=yes/sdl_static=no/' configure
+# cannot use optflags on x86 - they cause "no register to spill" errors
+#sed -i -e 's/-Wall -O2 -g/-Wall %{rpmcflags}/' Makefile Makefile.target
+
+%{?with_kqemu:echo -n > kqemu/install.sh}
+
 %build
+
+cp -rdp %{_kernelsrcdir}/ .
+rm linux/.config
+cp -f linux/config-smp linux/.config
+make -C linux modules_prepare
+
+# --extra-cflags don't work (overridden by CFLAGS in Makefile*)
 ./configure \
        --prefix=%{_prefix} \
        --cc="%{__cc}" \
        --make="%{__make}" \
+       --enable-kqemu \
+       --kernel-path=`pwd`/linux
 
-%{__make}
+%{__make} 
+mv kqemu/kqemu.ko kqemu/kqemu.smp
+cp -f linux/config-up linux/.config
+make -C linux modules_prepare
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -74,6 +102,10 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
+install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
+install kqemu/kqemu.smp $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/kqemu.ko
+install kqemu/kqemu.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -84,3 +116,4 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/qemu
 %{_mandir}/man1/qemu.1*
 %{_mandir}/man1/qemu-img.1*
+/lib/*
This page took 0.089661 seconds and 4 git commands to generate.