## ## bochs.spec -- OpenPKG RPM Package Specification ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. ## Copyright (c) 2000-2006 Ralf S. Engelschall ## ## 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: Emulator License: LGPL Version: 2.2.6 Release: 20060923 # list of sources Source0: http://switch.dl.sourceforge.net/sourceforge/bochs/bochs-%{version}.tar.gz Source1: http://switch.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 BuildPreReq: zlib PreReq: zlib 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;' \ config.cc # fix installation procedure %{l_shtool} subst \ -e 's; install ; %{l_shtool} install -c ;g' \ -e 's;^\(.\)install;\1%{l_shtool} install -c;' \ Makefile.in # configure the sources case "%{l_platform -t}" in *-netbsd* ) NIC="--disable-ne2000" ;; * ) NIC="--enable-ne2000" ;; esac CXX="%{l_cxx}" \ CFLAGS="%{l_cflags -O}" \ CXXFLAGS="%{l_cxxflags -O} %{l_cppflags} %{l_ldflags}" \ CPPFLAGS="%{l_cppflags}" \ LDFLAGS="%{l_ldflags}" \ ./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 \ --disable-vde \ $NIC \ --enable-compressed-hd \ --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