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