]> git.pld-linux.org Git - packages/qemu.git/blob - qemu.spec
- update kqemu accelerator to 0.7.1-1
[packages/qemu.git] / qemu.spec
1 #
2 # TODO:
3 # - wait till the gcc bug http://gcc.gnu.org/PR16185 is fixed.
4 #
5 # Conditional build:
6 %bcond_with     kqemu                   # with QEMU accelerator module
7 %bcond_with     cflags_passing          # with passing rpmcflags to Makefiles
8 %bcond_with     nosdlgui                # do not use SDL gui (use X11 instead)
9 #
10 Summary:        QEMU CPU Emulator
11 Summary(pl):    QEMU - emulator procesora
12 Name:           qemu
13 Version:        0.7.1
14 Release:        1
15 License:        GPL
16 Group:          Applications/Emulators
17 #Source0Download: http://fabrice.bellard.free.fr/qemu/download.html
18 Source0:        http://fabrice.bellard.free.fr/qemu/%{name}-%{version}.tar.gz
19 # Source0-md5:  b0c80d2c082049a5b8ccbc7f55fe165b
20 %if %{with kqemu}
21 Source1:        http://fabrice.bellard.free.fr/qemu/kqemu-0.7.1-1.tar.gz
22 # Source1-md5:  012498dac620eb8c212bf5f622414dd0
23 # NoSource1-md5:        c6bb3b40fb3d526d731eb0f1f9dee7ee
24 NoSource:       1
25 %endif
26 Patch0:         %{name}-nostatic.patch
27 Patch1:         %{name}-DESTDIR.patch
28 Patch2:         %{name}-longjmp.patch
29 Patch3:         %{name}-dot.patch
30 Patch4:         %{name}-initrd_load_addr.patch
31 Patch5:         %{name}-gcc4_x86.patch
32 Patch6:         %{name}-gcc4_ppc.patch
33 Patch7:         %{name}-parallel.patch
34 Patch8:         %{name}-nosdlgui.patch
35 URL:            http://fabrice.bellard.free.fr/qemu/
36 Requires:       SDL >= 1.2.1
37 BuildRequires:  SDL-devel >= 1.2.1
38 BuildRequires:  sed >= 4.0
39 %if %{with kqemu}
40 BuildRequires: kernel-source
41 %endif
42 ExclusiveArch:  %{ix86} %{x8664} ppc
43 # sparc is currently unsupported (missing cpu_get_real_ticks() impl in vl.c)
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46 # some SPARC boot image in ELF format
47 %define         _noautostrip    .*%{_datadir}/qemu/proll.elf
48
49 %description
50 QEMU is a FAST! processor emulator. By using dynamic translation it
51 achieves a reasonnable speed while being easy to port on new host
52 CPUs. QEMU has two operating modes:
53
54 - User mode emulation. In this mode, QEMU can launch Linux processes
55   compiled for one CPU on another CPU. Linux system calls are converted
56   because of endianness and 32/64 bit mismatches. Wine (Windows
57   emulation) and DOSEMU (DOS emulation) are the main targets for QEMU.
58
59 - Full system emulation. In this mode, QEMU emulates a full system,
60   including a processor and various peripherials. 
61   It can also be used to provide virtual hosting of several 
62   virtual PC on a single server.
63
64 %description -l pl
65 QEMU to szybki(!) emulator procesora. Poprzez u¿ycie dynamicznego
66 t³umaczenia osi±ga rozs±dn± szybko¶æ i jest ³atwy do przeportowania,
67 aby dzia³a³ na kolejnych procesorach. QEMU ma dwa tryby pracy:
68
69 - Emulacja trybu u¿ytkownika. W tym trybie QEMU mo¿e uruchamiaæ
70   procesy linuksowe skompilowane dla jednego procesora na innym
71   procesorze. Linuksowe wywo³ania systemowe s± t³umaczone ze wzglêdu
72   na niezgodno¶æ kolejno¶ci bajtów w s³owie i 32/64-bitowego rozmiaru
73   s³owa. Wine (emulacja Windows) i DOSEMU (emulacja DOS-a) to g³ówne
74   cele QEMU.
75
76 - Pe³na emulacja systemu. W tym trybie QEMU emuluje ca³y system,
77   w³±czaj±c w to procesor i ró¿ne urz±dzenia peryferyjne.
78   Mo¿e byæ tak¿e u¿ywane do wirtualnego hostowania kilku wirtualnych 
79   pecetów na pojedynczym serwerze.
80
81 %prep
82 %setup -q %{?with_kqemu:-a1}
83 %patch0 -p1
84 %patch1 -p1
85 %patch2 -p1
86 %patch3 -p1
87 %patch4 -p1
88 %patch5 -p0
89 %patch6 -p1
90 %patch7 -p1
91 %{?with_nosdlgui:%patch8 -p1}
92
93 %{__sed} -i -e 's/sdl_static=yes/sdl_static=no/' configure
94
95 # cannot use optflags on x86 - they cause "no register to spill" errors
96 %if %{with cflags_passing}
97 %{__sed} -i -e 's/-Wall -O2 -g/-Wall %{rpmcflags}/' Makefile Makefile.target
98 %endif
99
100 %{?with_kqemu:echo -n > kqemu/install.sh}
101
102 %build
103
104 %if %{with kqemu}
105 cp -rdp %{_kernelsrcdir}/ .
106 rm -f linux/.config
107 cp -f linux/config-smp linux/.config
108 make -C linux modules_prepare
109 %endif
110
111 # --extra-cflags don't work (overridden by CFLAGS in Makefile*)
112 # they can be passed if the cflags_passing bcond is used
113 ./configure \
114         --prefix=%{_prefix} \
115         --cc="%{__cc}" \
116   %if %{with kqemu}
117         --enable-kqemu }\
118         --kernel-path=`pwd`/linux \
119   %endif
120         --make="%{__make}"
121
122 %{__make} 
123
124 %if %{with kqemu}
125 mv kqemu/kqemu.ko kqemu/kqemu.smp
126 cp -f linux/config-up linux/.config
127 make -C linux modules_prepare
128 %endif
129
130 %install
131 rm -rf $RPM_BUILD_ROOT
132
133 %{__make} install \
134         DESTDIR=$RPM_BUILD_ROOT
135
136 %if %{with kqemu}
137 install -d $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}{,smp}/misc
138 install kqemu/kqemu.smp $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}smp/misc/kqemu.ko
139 install kqemu/kqemu.ko $RPM_BUILD_ROOT/lib/modules/%{_kernel_ver}/misc
140 %endif
141
142 # This dir is unneeded
143 rm -rf $RPM_BUILD_ROOT/usr/share/doc/qemu
144
145 %clean
146 rm -rf $RPM_BUILD_ROOT
147
148 %post
149 %if %{with kqemu}
150 %depmod
151
152 %banner %{name} -e << EOF
153 To enable qemu accelerator (kqemu), You must manually create device for it:
154 mknod /dev/kqemu c 250 0
155 chmod 666 /dev/kqemu
156
157 And before start qemu, the kqemu kernel module must be loaded:
158 modprobe kqemu
159 EOF
160 %endif
161
162 %postun
163 %{?with_kqemu: %depmod}
164
165 %files
166 %defattr(644,root,root,755)
167 %doc README qemu-doc.html qemu-tech.html
168 %attr(755,root,root) %{_bindir}/*
169 %{_datadir}/qemu
170 %{_mandir}/man1/qemu.1*
171 %{_mandir}/man1/qemu-img.1*
172 %{?with_kqemu: /lib/*}
This page took 0.073452 seconds and 4 git commands to generate.