Blob Blame History Raw
%bcond_with     debugger

Name:           bochs
Version:        2.2.6
Release:        1%{?dist}
Summary:        Portable x86 PC emulator

Group:          Applications/Emulators
License:        LGPL
URL:            http://bochs.sourceforge.net/
Source0:        http://download.sf.net/bochs/%{name}-%{version}.tar.gz
Source1:        http://bochs.sourceforge.net/guestos/dlxlinux4.tar.gz
Patch0:         %{name}-nonet-build.patch
Patch1:         %{name}-config.patch
Patch2:         %{name}-wx26.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  docbook-utils
BuildRequires:  libXt-devel
BuildRequires:  libXpm-devel
BuildRequires:  ncurses-devel
BuildRequires:  SDL-devel
BuildRequires:  wxGTK-devel
%if %{with debugger}
BuildRequires:  readline-devel
%endif

%description
Bochs is a portable x86 PC emulation software package that emulates
enough of the x86 CPU, related AT hardware, and BIOS to run DOS,
Windows '95, Minix 2.0, and other OS's, all on your workstation.

%package        dlxlinux
Summary:        DLX Linux hard disk image for Bochs
Group:          Applications/Emulators
Requires:       %{name} >= 2.0

%description    dlxlinux
DLX is a version of Linux which was small enough to distribute along
with the Bochs Windows binary release.  Because of its small size, a
limited number of linux commands are available.  The official DLX site
is at <http://www.wu-wien.ac.at/usr/h93/h9301726/dlx.html>.  DLX was
created by Erich and Hannes Boehm.


%prep
%setup -q
%patch0 -p0 -z .nonet
%patch2 -p1 -z .wx26
cp -p %{SOURCE1} .

# Uh-oh, great!
sed -i \
  -e 's|wx_needs_gtk2=0|wx_needs_gtk2=1|' \
  -e 's|/opt/gnome/include/|%{_includedir}/|' \
  configure*

# Fix up some man page paths.
sed -i \
  -e 's|/usr/local/share/doc/bochs/|%{_docdir}/%{name}-%{version}/|' \
  -e 's|/usr/local/share/|%{_datadir}/|' \
  doc/man/*.*

# Fix build error with g++ 4.1.0
sed -i -e '/#ifndef PARANOID/,/#endif/d' iodev/harddrv.h


%build
# Note: the CPU level, MMX et al affect what the emulator will emulate, they
# are not properties of the build target architecture.
export CXXFLAGS="$RPM_OPT_FLAGS -DPARANOID"
%configure \
  --enable-plugins \
  --enable-ne2000 \
  --enable-pci \
  %{?with_debugger:--enable-debugger} \
  --enable-all-optimizations \
  --enable-vbe \
  --enable-clgd54xx \
  --enable-3dnow \
  --enable-sb16=linux \
  --with-x11 \
  --with-nogui \
  --with-term \
  --with-rfb \
  --with-sdl \
  --with-wx \
  --with-svga

make %{?_smp_mflags}
make unpack_dlx

# This needs to be done after "make unpack_dlx".
%{__patch} -p0 < %{PATCH1}
sed -i -e 's/\r//' dlxlinux/readme.txt dlxlinux/bochsrc.txt


%install
rm -rf $RPM_BUILD_ROOT _installed-docs
make install install_dlx DESTDIR=$RPM_BUILD_ROOT
mv $RPM_BUILD_ROOT%{_docdir}/bochs _installed-docs


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc _installed-docs/* README-*
%{_bindir}/bochs
%{_bindir}/bxcommit
%{_bindir}/bximage
# Note: must include *.la in %{_libdir}/bochs/plugins/
%{_libdir}/bochs/
%{_mandir}/man1/bochs.1*
%{_mandir}/man1/bxcommit.1*
%{_mandir}/man1/bximage.1*
%{_mandir}/man5/bochsrc.5*
%dir %{_datadir}/bochs/
%{_datadir}/bochs/*BIOS*
%{_datadir}/bochs/keymaps/

%files dlxlinux
%defattr(-,root,root,-)
%{_bindir}/bochs-dlx
%{_mandir}/man1/bochs-dlx.1*
%{_datadir}/bochs/dlxlinux/


%changelog
* Wed Feb 15 2006 Hans de Goede <j.w.r.degoede@hhs.nl> - 2.2.6-1
- New upstream version 2.2.6
- Remove --enable-pae as that requires a CPU level of 6 with the new version
- Remove a few configure switches which are identical to the
  upstream defaults and thus don't do anything
- Add --enable-clgd54xx
- Add --with-svga which adds support for svgalib as display
- Fix compile with wxGTK-2.6 and unconditionalize wxGTK build

* Fri Dec 16 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.2.1-2
- Adapt to modular X.
- Fix build with g++ 4.1.0.
- Conditionalize wxGTK build and default it to off (build failures w/2.6.x).
- Use sed instead of dos2unix and perl during build.

* Sat Jul  9 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.2.1-1
- 2.2.1, precision patch applied upstream.

* Sun May 29 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.2-2
- Try to fix x86_64 build.

* Sat May 28 2005 Ville Skyttä <ville.skytta at iki.fi> - 2.2-1
- 2.2, buildpaths and fpu-regparms patches applied upstream, pthread and
  ncurses linking hacks no longer needed.
- Use upstream default display library, wx is clunky with wxGTK2 2.4.x.
- Enable 3DNow! emulation and the SDL display library.

* Sun May 22 2005 Jeremy Katz <katzj@redhat.com> - 2.1.1-3
- rebuild on all arches

* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 2.1.1-2
- rebuilt

* Sun Dec  5 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:2.1.1-1
- Update to 2.1.1.
- Enable PAE and 4M pages support.
- Loosen version in dlxlinux to main dependency.
- BuildRequire ncurses-devel instead of ncurses-c++-devel for FC3.
- Apply upstream fpu-regparm patch to fix the build on FC3.

* Fri Jan 16 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:2.1-0.fdr.2
- Fix RFB linking, force pthreads.
- dos2unix some -dlxlinux files.

* Mon Jan 12 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:2.1-0.fdr.1
- Update to 2.1.
- Make sure everything is built with GTK2.
- Add "--with debugger" rpmbuild option.
- Put SDL build behind the "--with sdl" rpmbuild option due to startup crashes.

* Sun Nov 30 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:2.1-0.fdr.0.3.pre2
- Update to 2.1pre2.

* Tue Oct 21 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:2.1-0.fdr.0.2.pre1
- Remove .cvsignore from docs.

* Sat Oct 11 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:2.1-0.fdr.0.1.pre1
- Update to 2.1pre1.
- Enable 3DNow! on athlon.
- Other cosmetic tweaks.

* Sat Jul 19 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:2.0.2-0.fdr.3
- List wanted GUIs explicitly, exclude svgalib (bug 306).

* Wed May 21 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:2.0.2-0.fdr.2
- Rebuild with wxGTK2.

* Tue May 20 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:2.0.2-0.fdr.1
- First Fedora release, based on upstream SRPM.