Blob Blame History Raw
Name:           bochs
Version:        2.1.1
Release:        1
Summary:        Bochs Project x86 PC Emulator

Group:          Applications/Emulators
License:        LGPL
URL:            http://bochs.sourceforge.net/
Source0:        http://download.sourceforge.net/bochs/bochs-2.1.1.tar.gz
Source1:        http://bochs.sourceforge.net/guestos/dlxlinux4.tar.gz
Patch0:         %{name}-nonet-build.patch
Patch1:         %{name}-buildpaths.patch
Patch2:         %{name}-config.patch
Patch3:         %{name}-gtk2.patch
Patch4:         %{name}-dlxreadme.patch
Patch5:         %{name}-fpu-regparm.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  docbook-utils, wxGTK2-devel, ncurses-devel, dos2unix
BuildRequires:  %{__perl}
%{?_with_sdl:BuildRequires: SDL-devel}
%{?_with_debugger:BuildRequires: readline-devel}

%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
%patch1 -p0
%patch3 -p0
%patch4 -p0
%patch5 -p0
# Fix up some man page paths.
%{__perl} -pi -e \
  's|/usr/local/share/doc/bochs\b|%{_docdir}/%{name}-%{version}| ;
   s|/usr/local/share/|%{_datadir}/|' \
  doc/man/*.*
cp -p %{SOURCE1} .


%build

# Force linking with ncurses, otherwise the "term" UI won't work.
export GUI_LINK_OPTS_TERM="-lncurses"

# Force pthreads, the rfb UI needs them and configure fails to add -lpthread.
export PTHREAD_LIBS=-lpthread
export PTHREAD_CFLAGS=-pthread

# Notes:
# - The CPU level, MMX et al affect what the emulator will emulate, they
#   are not properties of the build target architecture.
# - Using the following options makes the build fail as of 2.1(.1):
#   --enable-3dnow --enable-external-debugger
%configure \
  --enable-plugins \
  --enable-cpu-level=5 \
  --enable-ne2000 \
  --enable-pci \
  --enable-4meg-pages \
  --enable-pae \
  %{?_with_debugger:--enable-debugger} \
  --enable-all-optimizations \
  --enable-vbe \
  --enable-mmx \
  --enable-cdrom \
  --enable-sb16=linux \
  --with-x11 \
  --with-nogui \
  --with-term \
  --with-rfb \
  %{?_with_sdl} \
  --with-wx

make %{?_smp_mflags}
make unpack_dlx

# This needs to be done after "make unpack_dlx".
%{__patch} -p0 < %{PATCH2}
dos2unix 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
* 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.