| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- ##
- ## bochs.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
- ## Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.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: OpenPKG
- Distribution: OpenPKG
- Class: BASE
- Group: Misc
- License: LGPL
- Version: 2.1.1
- Release: 20050615
- # 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
|