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