File bochs.spec of Package bochs

#
# spec file for package bochs (Version 2.2.1)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#



Name:           bochs
%if 0%{?suse_version} > 1310
BuildRequires:  SDL2-devel
%else
BuildRequires:  SDL-devel
%endif
BuildRequires:  docbook-toys docbook-utils gcc-c++ libpcap readline-devel xorg-x11 libXrandr-devel
BuildRequires:  alsa-devel
#BuildRequires:  wxWidgets-devel
%if 0%{?suse_version} < 1320
# force it to not use pkgconfig, older ncurses doesn't install a pkgconfig file and so isn't found
#!BuildIgnore:  pkg-config
%endif
License:        LGPL-2.1-or-later
Url:            http://bochs.sourceforge.net/
Group:          System/Emulators/PC
AutoReqProv:    on
Version:        2.8
Release:        1
Summary:        Cross-Platform IA32 Emulator
Source:         bochs-%{version}.tar.gz
Patch1:         fix-module-building.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Bochs is a highly portable open source IA-32 (x86) PC emulator written
in C++, that runs on most popular platforms. It includes emulation of
the Intel x86 CPU, common I/O devices, and a custom BIOS. Currently,
bochs can be compiled to emulate a 386, 486 or Pentium CPU. Bochs is
capable of running most Operating Systems inside the emulation
including Linux, Windows 95, DOS, and recently Windows NT 4.



Authors:
--------
    Kevin Lawton <kevin@bochs.com>

%prep
%setup -q
%patch1
# use wxWidgets interface by default
# sed -i "s/#config_interface: wx/config_interface: wx/" .bochsrc
# sed -i "s/#display_library: wx/display_library: wx/" .bochsrc

%build
%ifarch %ix86
export ARCHOPTS="--enable-fast-function-calls"
%endif
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" \
export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fpermissive -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" 
%configure \
	--enable-ne2000 \
	--enable-pci \
	--enable-usb \
	--enable-usb-ohci \
	--enable-clgd54xx \
	--enable-es1370 \
	--enable-e1000 \
	--enable-cpu-level=6 \
	--enable-readline \
	--enable-fpu \
	--enable-cdrom \
	--enable-sb16 \
	--enable-idle-hack \
	--enable-plugins \
	--enable-x86-64 \
	--enable-3dnow \
	--enable-repeat-speedups \
	--enable-all-optimizations \
	${ARCHOPTS} \
	--enable-docbook \
	--with-all-libs \
	--disable-static \
	--with-pic
make 

%install
make install DESTDIR=$RPM_BUILD_ROOT
make install_docbook DESTDIR=$RPM_BUILD_ROOT
install -d -m 755 $RPM_BUILD_ROOT/etc
install -m 644 .bochsrc $RPM_BUILD_ROOT/etc/bochsrc
install -d -m 755 $RPM_BUILD_ROOT/usr/lib/bochs/bios
install -d -m 755 $RPM_BUILD_ROOT/usr/share/doc/packages/
install -m 644 bios/BIOS-bochs-* bios/VGABIOS-elpin-* bios/VGABIOS-lgpl-* $RPM_BUILD_ROOT/usr/lib/bochs/bios
mv $RPM_BUILD_ROOT/usr/share/doc/bochs ./docs-html
chmod a-x ./docs-html/cpu_configurability.txt
# rm -rf $RPM_BUILD_ROOT/usr/share/bochs/keymaps/CVS
# rm -rf docs-html/CVS

%files
%defattr(-,root,root)
%doc CHANGES COPYING docs-html README bios/VGABIOS-elpin-LICENSE
/usr/bin/bochs
/usr/bin/bxhub
/usr/bin/bximage
#/usr/bin/bximage_old
#/usr/bin/bxcommit
%config(noreplace) /etc/bochsrc
%doc %{_mandir}/man1/*
%doc %{_mandir}/man5/*
/usr/share/bochs
%if "%_libdir" != "/usr/lib"
/usr/lib/bochs
%endif
%{_libdir}/bochs

%changelog
openSUSE Build Service is sponsored by