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