You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

174 lines
6.1 KiB

##
## bochs.spec -- OpenPKG RPM Specification
## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 2000-2005 Cable & Wireless <http://www.cw.com/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package information
Name: bochs
Summary: IA-32 Emulator
URL: http://bochs.sourceforge.net/
Vendor: Kevin Lawton
Packager: The OpenPKG Project
Distribution: OpenPKG
Class: BASE
Group: Misc
License: LGPL
Version: 2.1.1
Release: 20041011
# list of sources
Source0: http://osdn.dl.sourceforge.net/sourceforge/bochs/bochs-%{version}.tar.gz
Source1: http://osdn.dl.sourceforge.net/sourceforge/bochs/fdos-10meg.tar.gz
Patch0: bochs.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130, X11, gcc, gzip
PreReq: OpenPKG, openpkg >= 20040130, X11
AutoReq: no
AutoReqProv: no
%description
Bochs is a highly portable open source IA-32 (x86) PC emulator
that runs on most popular platforms. It includes emulation of
the Intel x86 CPU, common I/O devices, and a custom BIOS. Bochs
can be compiled to emulate a 386, 486 or Pentium CPU. It can
then run most Operating Systems inside the emulation including
Linux, Windows, DOS, and others. This package also contains a
pre-configured FreeDOS 8h1 image to demonstrate Bochs in action.
%track
prog bochs = {
version = %{version}
url = http://prdownloads.sourceforge.net/bochs/
regex = bochs-(\d+\.\d+(\.\d+)?)\.tar\.gz
}
%prep
%setup -q
%setup -q -T -D -a 1
%patch -p0
# remove CVS sub-directories because they would be
# picked up by "make install" later.
find . -type d -name CVS -print | xargs rm -rf
%build
# make sure Bochs find the global configuration
%{l_shtool} subst \
-e 's;/etc/bochsrc;%{l_prefix}/etc/bochs/bochsrc;' \
main.cc
# configure the sources
CC="%{l_cc}" \
CXX="%{l_cxx}" \
CFLAGS="%{l_cflags -O}" \
CXXFLAGS="%{l_cxxflags -O}" \
./configure \
--prefix=%{l_prefix} \
--with-x11 \
--x-includes=`%{l_rc} --query x11_incdir` \
--x-libraries=`%{l_rc} --query x11_libdir` \
--enable-cpu-level=5 \
--enable-all-optimizations \
--enable-cdrom \
--enable-ne2000 \
--disable-shared
# build the sources
%{l_make} %{l_mflags -O}
%install
rm -rf $RPM_BUILD_ROOT
# pre-generate extra directories
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/etc/bochs \
$RPM_BUILD_ROOT%{l_prefix}/libexec/bochs
# perform standard installation procedure
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
# post-adjust manual pages
rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/bochs-dlx.1.gz
%{l_gzip} -d $RPM_BUILD_ROOT%{l_prefix}/man/man*/*.gz
# provide configuration file
mv $RPM_BUILD_ROOT%{l_prefix}/share/doc/bochs/bochsrc-sample.txt \
$RPM_BUILD_ROOT%{l_prefix}/etc/bochs/bochsrc.sample
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
# provide VGA font directory
( cd $RPM_BUILD_ROOT%{l_prefix}/share/bochs
rm -f install-x11-fonts test-x11-fonts
mkdir fonts
x11_bindir=`%{l_rc} --query x11_bindir`
$x11_bindir/mkfontdir fonts
) || exit $?
# provide executable wrapper which finds the VGA font
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
mv $RPM_BUILD_ROOT%{l_prefix}/bin/bochs \
$RPM_BUILD_ROOT%{l_prefix}/libexec/bochs/
( echo "#!/bin/sh"
echo "if [ \"\$DISPLAY.\" = \".\" ]; then"
echo " echo \"DISPLAY not set\""
echo " exit 1"
echo "fi"
echo "xset fp+ %{l_prefix}/share/bochs/fonts"
echo "exec %{l_prefix}/libexec/bochs/bochs \${1+\"\$@\"}"
) >$RPM_BUILD_ROOT%{l_prefix}/bin/bochs
chmod a+x $RPM_BUILD_ROOT%{l_prefix}/bin/bochs
# install FreeDOS image as default scratch OS
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/share/bochs/img
%{l_shtool} install -c -m 644 \
fdos-10meg/fdosmini.img \
$RPM_BUILD_ROOT%{l_prefix}/share/bochs/img/freedos.img
%{l_shtool} install -c -m 644 \
-e 's;$BXBIOS;%{l_prefix}/share/bochs;g' \
-e 's;fdosmini.img;%{l_prefix}/share/bochs/img/freedos.img;g' \
-e '/vga_update_interval.*/d' \
-e '/realtime_pit/d' \
fdos-10meg/bochsrc.txt \
$RPM_BUILD_ROOT%{l_prefix}/etc/bochs/bochsrc
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT
%post
if [ $1 -eq 1 ]; then
( echo "Hint: This Bochs package has a FreeDOS image pre-installed"
echo "In order to run it as a regular user, you either have to"
echo "change the permissions and/or the ownership of the image file"
echo "$RPM_INSTALL_PREFIX/share/bochs/img/freedos.img manually."
) | %{l_rpmtool} msg -b -t notice
fi