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