Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37576760
en ru br
ALT Linux repos
S:8.1.0-alt1
5.0: 0.12.1-alt0.M50.1
4.1: 0.12.1-alt0.M41.1
4.0: 0.12.1-alt0.M40.1
3.0: 0.7.1-alt1

Group :: Emulators
RPM: qemu

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

# vim: set ft=spec
# vim600: set fdm=marker:

# %%branch_switch set %%branch_release use

%define branch_switch M40

# {{{ macros define

%def_enable binfmt_misc

%def_with alpha
%def_with arm
%def_without cris
%def_with x86
%def_with m68k
%def_without microblaze
%def_with mips
%def_with ppc
%def_without sh4
%def_with sparc

%global target_list_system %nil
%global target_list_user %nil

%if_with alpha
%global target_list_user %target_list_user alpha-linux-user
%endif

%if_with arm
%global target_list_system %target_list_system arm-softmmu
%global target_list_user %target_list_user arm-linux-user armeb-linux-user
%endif

%if_with cris
%global target_list_system %target_list_system cris-softmmu
%global target_list_user %target_list_user cris-linux-user
%endif

%if_with x86
%global target_list_system %target_list_system i386-softmmu x86_64-softmmu
%global target_list_user %target_list_user i386-linux-user x86_64-linux-user
%endif

%if_with m68k
%global target_list_system %target_list_system m68k-softmmu
%global target_list_user %target_list_user m68k-linux-user
%endif

%if_with microblaze
%global target_list_system %target_list_system microblaze-softmmu
%global target_list_user %target_list_user microblaze-linux-user
%endif

%if_with mips
%global target_list_system %target_list_system mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu
%global target_list_user %target_list_user mips-linux-user mipsel-linux-user
%endif

%if_with ppc
%global target_list_system %target_list_system ppc-softmmu ppcemb-softmmu ppc64-softmmu
%global target_list_user %target_list_user ppc-linux-user ppc64-linux-user ppc64abi32-linux-user
%endif

%if_with sh4
%global target_list_system %target_list_system sh4-softmmu sh4eb-softmmu
%global target_list_user %target_list_user sh4-linux-user sh4eb-linux-user
%endif

%if_with sparc
%global target_list_system %target_list_system sparc-softmmu sparc64-softmmu
%global target_list_user %target_list_user sparc-linux-user sparc64-linux-user sparc32plus-linux-user
%endif
# }}}

Name: qemu
Version: 0.12.1
Release: %branch_release alt1

Summary: QEMU CPU Emulator
License: GPL/LGPL/BSD
Group: Emulators
Requires: %name-system = %version-%release, %name-user = %version-%release

URL: http://www.nongnu.org/qemu/
Source0: %name-%version.tar
Patch0: qemu-alt.patch

Packager: Kirill A. Shutemov <kas at altlinux.org>

%set_verify_elf_method fhs=relaxed
%add_strip_skiplist %_datadir/qemu/*

BuildRequires(pre): rpm-macros-branch
BuildPreReq: esound-devel
BuildPreReq: libalsa-devel
BuildRequires: glibc-devel-static libSDL-devel libgnutls-devel libncurses-devel
BuildRequires: libpulseaudio-devel tetex-core zlib-devel libX11-devel
BuildRequires: libcurl-devel libsasl2-devel libcheck-devel
BuildRequires: libuuid-devel

%description
QEMU is a fast processor emulator using dynamic translation to achieve
good emulation speed.  QEMU has two operating modes:

* Full system emulation.  In this mode, QEMU emulates a full system
 (for example a PC), including a processor and various peripherials.
 It can be used to launch different Operating Systems without rebooting
 the PC or to debug system code.

* User mode emulation.  In this mode, QEMU can launch Linux processes
 compiled for one CPU on another CPU.  It can be used to launch the
 Wine Windows API emulator or to ease cross-compilation and
 cross-debugging.

As QEMU requires no host kernel patches to run, it is very safe and easy
to use.

%package common
Summary: QEMU CPU Emulator - common files
Group: Emulators

%description common
QEMU is a fast processor emulator using dynamic translation to achieve
good emulation speed.
This package contains common files for qemu.

%package system
Summary: QEMU CPU Emulator - full system emulation
Group: Emulators
Requires: %name-common = %version-%release

%description system
Full system emulation.  In this mode, QEMU emulates a full system
(for example a PC), including a processor and various peripherials.
It can be used to launch different Operating Systems without rebooting
the PC or to debug system code.

%package user
Summary: QEMU CPU Emulator - user mode emulation
Group: Emulators
Requires: %name-common = %version-%release

%description user
User mode emulation.  In this mode, QEMU can launch Linux processes
compiled for one CPU on another CPU.  It can be used to launch the
Wine Windows API emulator or to ease cross-compilation and
cross-debugging.

%package user-binfmt_misc
Summary: QEMU CPU Emulator - user mode emulation, binfmt_misc version
Group: Emulators
Requires: %name-common = %version-%release

%description user-binfmt_misc
User mode emulation.  In this mode, QEMU can launch Linux processes
compiled for one CPU on another CPU.  It can be used to launch the
Wine Windows API emulator or to ease cross-compilation and
cross-debugging.
This package contains static version with enabled binfmt_misc support.
Suitable for hasher.

%prep
%setup -q
%patch0 -p1

%build
%if_enabled binfmt_misc
# non-GNU configure
./configure \
--target-list='%target_list_user' \
--prefix=%_prefix \
--static \
--disable-debug-tcg \
--disable-sparse \
--disable-strip \
--disable-system \
--enable-check-utests \
--enable-nptl \
--enable-guest-base \
--disable-linux-aio

%make_build
find -regex '.*linux-user/qemu.*' -perm 755 -exec mv '{}' '{}'.static ';'
%make_build clean
%endif

# non-GNU configure

./configure \
--target-list='%target_list_system %target_list_user' \
--prefix=%_prefix \
--disable-debug-tcg \
--disable-sparse \
--disable-strip \
--enable-sdl \
--audio-drv-list='oss alsa sdl esd' \
--audio-card-list='ac97 es1370 sb16 cs4231a adlib gus' \
--enable-mixemu \
--disable-xen \
--disable-brlapi \
--enable-vnc-tls \
--enable-vnc-sasl \
--enable-curses \
--enable-curl \
--disable-fdt \
--enable-check-utests \
--disable-bluez \
--disable-kvm \
--enable-nptl \
--enable-guest-base \
--disable-user-pie \
--disable-vde \
--disable-linux-aio \
--enable-uuid
%make_build

%{?!__buildreqs:%{?!_without_check:%{?!_disable_check:./check-qdict && ./check-qfloat && ./check-qint && ./check-qjson && ./check-qlist && ./check-qstring}}}
%install
%make_install install DESTDIR=%buildroot

mv %buildroot%_defaultdocdir/qemu %buildroot%_defaultdocdir/%name-%version
install -m644 TODO Changelog %buildroot%_defaultdocdir/%name-%version

%if_enabled binfmt_misc
find -regex '.*linux-user/qemu.*\.static' -exec install -m755 '{}' %buildroot%_bindir ';'
%endif

mv %buildroot%_bindir/qemu %buildroot%_bindir/qemu-system-x86
%ifarch %ix86
ln -s %_bindir/qemu-system-x86 %buildroot%_bindir/qemu
%else
ln -s %_bindir/qemu-system-%_target_cpu %buildroot%_bindir/qemu
%endif

%files

%files common
%_defaultdocdir/%name-%version

%files system
%attr(755,root,root) %_bindir/qemu
%attr(755,root,root) %_bindir/qemu-system*
%attr(755,root,root) %_bindir/qemu-img
%attr(755,root,root) %_bindir/qemu-nbd
%_datadir/qemu
%_man1dir/qemu*
%_man8dir/qemu*

%files user
%attr(755,root,root) %_bindir/qemu-*
%exclude %_bindir/qemu-system*
%if_enabled binfmt_misc
%exclude %_bindir/qemu-*.static
%endif
%exclude %_bindir/qemu-img
%exclude %_bindir/qemu-nbd

%if_enabled binfmt_misc
%files user-binfmt_misc
%_bindir/qemu-*.static
%endif

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin