Fail* directories reorganized, Code-cleanup (-> coding-style), Typos+comments fixed.
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1321 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
48
simulators/bochs/build/redhat/NOTES
Normal file
48
simulators/bochs/build/redhat/NOTES
Normal file
@ -0,0 +1,48 @@
|
||||
Here's a useful usenet article that shows how to build a filelist
|
||||
instead of having to specify each one.
|
||||
-----------------------------------------------------------------
|
||||
|
||||
From: John Ross Hunt (bigboote@mediaone.net)
|
||||
Subject: RE: Newbie to build spec files
|
||||
Newsgroups: linux.redhat.rpm
|
||||
Date: 2000/07/27
|
||||
|
||||
|
||||
> So, is there a better way, in RPM 3, to populate %files?
|
||||
> Because I know
|
||||
> 'buildroot' and it has nothing to do with %files.
|
||||
|
||||
I found this bit of code in a .spec file to build a %files list on the fly
|
||||
and have been using it ever since. I've always thought RPM should be able
|
||||
to provide a default %files list in the event one isn't present in the .spec
|
||||
file.
|
||||
|
||||
--
|
||||
John Ross Hunt
|
||||
bigboote@mediaone.net <mailto:bigboote@mediaone.net>
|
||||
|
||||
|
||||
|
||||
%define pkg_name foo
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
cd $RPM_BUILD_ROOT
|
||||
find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > \
|
||||
$RPM_BUILD_DIR/file.list.%{pkg_name}
|
||||
|
||||
find . -type f | sed -e 's,^\.,\%attr(-\,root\,root) ,' \
|
||||
-e '/\/etc\//s|^|%config|' >> \
|
||||
$RPM_BUILD_DIR/file.list.%{pkg_name}
|
||||
|
||||
find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> \
|
||||
$RPM_BUILD_DIR/file.list.%{pkg_name}
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/file.list.%{pkg_name}
|
||||
|
||||
%files -f ../file.list.%{pkg_name}
|
||||
%doc README TODO example
|
||||
-----------------------------------------------------------------
|
||||
81
simulators/bochs/build/redhat/bochs.rpmspec.template
Normal file
81
simulators/bochs/build/redhat/bochs.rpmspec.template
Normal file
@ -0,0 +1,81 @@
|
||||
Summary: Bochs Project x86 PC Emulator
|
||||
Name: bochs
|
||||
Version: @SEDVERSION@
|
||||
Release: 1
|
||||
License: LGPL
|
||||
Group: Applications/Emulators
|
||||
URL:http://bochs.sourceforge.net
|
||||
Packager:Volker Ruppert <info@vruppert.de>
|
||||
Source:bochs-@SEDVERSION@.tar.gz
|
||||
BuildRoot: /var/tmp/%{name}-buildroot
|
||||
|
||||
%description
|
||||
Bochs is a highly portable open source IA-32 (x86) PC emulator written
|
||||
in C++, that runs on most popular platforms. It includes emulation of
|
||||
the Intel x86 CPU, common I/O devices, and a custom BIOS. Currently,
|
||||
Bochs can be compiled to emulate a 386, 486, Pentium, Pentium Pro or
|
||||
AMD64 CPU, including optional MMX, SSEx and 3DNow! instructions.
|
||||
Bochs is capable of running most Operating Systems inside the emulation
|
||||
including Linux, DOS, Windows 9X/NT/2000/XP or Windows 7.
|
||||
|
||||
%define pkg_name bochs
|
||||
|
||||
%prep
|
||||
rm -rf $RPM_BUILD_DIR/bochs-@SEDVERSION@
|
||||
tar xzvf $RPM_SOURCE_DIR/bochs-@SEDVERSION@.tar.gz
|
||||
if test "/" != $RPM_BUILD_ROOT; then
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
fi
|
||||
%build
|
||||
cd $RPM_BUILD_DIR/bochs-@SEDVERSION@
|
||||
CONFIGURE_ARGS="--prefix=/usr --mandir=$RPM_BUILD_ROOT/%{_mandir}"
|
||||
export CONFIGURE_ARGS
|
||||
sh .conf.linux
|
||||
make
|
||||
make unpack_dlx # must use prefix=/usr since this step sets up
|
||||
# the paths in dlx bochsrc file.
|
||||
%install
|
||||
pwd
|
||||
cd $RPM_BUILD_DIR/bochs-@SEDVERSION@
|
||||
for i in "" usr usr/bin usr/lib usr/share usr/share/doc %{_mandir}; do
|
||||
if ! test -d $RPM_BUILD_ROOT/$i; then mkdir $RPM_BUILD_ROOT/$i; fi
|
||||
done
|
||||
make install install_dlx prefix=$RPM_BUILD_ROOT/usr
|
||||
# Build list of plugins on the fly (if any). This allows the
|
||||
# spec file to support RPM building with or without plugins.
|
||||
cd $RPM_BUILD_ROOT
|
||||
find ./usr/lib -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > \
|
||||
$RPM_BUILD_DIR/file.list.%{pkg_name}
|
||||
find ./usr/lib -type f | sed -e 's,^\.,\%attr(-\,root\,root) ,' \
|
||||
-e '/\/etc\//s|^|%config|' >> \
|
||||
$RPM_BUILD_DIR/file.list.%{pkg_name}
|
||||
find ./usr/lib -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> \
|
||||
$RPM_BUILD_DIR/file.list.%{pkg_name}
|
||||
# We could use the same technique to produce the complete file list,
|
||||
# with only one very minor problem: it lists directories that are
|
||||
# used by other programs, so when you remove the package you get
|
||||
# errors like
|
||||
# error: cannot remove /usr/share/doc - directory not empty
|
||||
|
||||
%files -f file.list.%{pkg_name}
|
||||
%defattr(-, root, root)
|
||||
/usr/bin/bochs
|
||||
/usr/bin/bochs-dlx
|
||||
/usr/bin/bxcommit
|
||||
/usr/bin/bximage
|
||||
/usr/share/bochs/*
|
||||
/usr/share/doc/*
|
||||
%{_mandir}/*
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_DIR/bochs-@SEDVERSION@
|
||||
rm -rf $RPM_BUILD_DIR/file.list.%{pkg_name}
|
||||
if test "/" != $RPM_BUILD_ROOT; then
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
fi
|
||||
%preun
|
||||
# clean up the bochsout.txt that is always produced if you
|
||||
# run bochs-dlx.
|
||||
rm -rf /usr/share/bochs/dlxlinux/bochsout.txt
|
||||
%postun
|
||||
rmdir /usr/share/bochs > /dev/null 2>&1
|
||||
100
simulators/bochs/build/redhat/make-rpm
Executable file
100
simulators/bochs/build/redhat/make-rpm
Executable file
@ -0,0 +1,100 @@
|
||||
#!/bin/bash -x
|
||||
#########################################################################
|
||||
# $Id$
|
||||
#########################################################################
|
||||
# build/redhat/make-rpm
|
||||
#
|
||||
# This script creates an RPM from the bochs directory. You must run
|
||||
# it as root from the top of the source directory (where the configure
|
||||
# scripts are). Then just run:
|
||||
# ./build/redhat/make-rpm
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
CAT=cat
|
||||
RM=rm
|
||||
CP=cp
|
||||
MV=mv
|
||||
MKDIR=mkdir
|
||||
GREP=grep
|
||||
ECHO=echo
|
||||
RPM=rpm
|
||||
RPMBUILD=/usr/bin/rpmbuild
|
||||
SED=sed
|
||||
TAR=tar
|
||||
RPMSRCPATH=_rpm_top
|
||||
SOURCES=${RPMSRCPATH}/SOURCES
|
||||
SPECS=${RPMSRCPATH}/SPECS
|
||||
RPMSPEC="build/redhat/bochs.rpmspec.template"
|
||||
TMPDIR=/tmp
|
||||
|
||||
echo Reading version from configure.in script.
|
||||
VERSION='unknown'
|
||||
eval `${GREP} '^VERSION="' configure.in`
|
||||
if test $? != 0 -o "$VERSION" = unknown; then
|
||||
echo Could not get version number from configure.in script.
|
||||
echo Exiting.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# clean up previous rpm builds
|
||||
${RM} -rf *.rpm ${RPMSRCPATH}
|
||||
if test -f Makefile; then
|
||||
make dist-clean
|
||||
fi
|
||||
|
||||
# make a TAR.GZ of the entire source directory, exactly as it is. The
|
||||
# tar is placed in $SOURCES/bochs-$VERSION.tar.gz. Because the current
|
||||
# directory could be named nearly anything, I copy all the contents into
|
||||
# $SOURCES/bochs-$VERSION and then build a tar in $SOURCES.
|
||||
|
||||
${RM} -rf ${TMPDIR}/bochs-${VERSION}
|
||||
test $? = 0 || exit 1
|
||||
${MKDIR} ${TMPDIR}/bochs-${VERSION}
|
||||
test $? = 0 || exit 1
|
||||
${TAR} cf - * .??* | (cd ${TMPDIR}/bochs-${VERSION} && tar xf -)
|
||||
test $? = 0 || exit 1
|
||||
(cd ${TMPDIR}; tar czf bochs-${VERSION}.tar.gz --exclude=CVS bochs-${VERSION})
|
||||
test $? = 0 || exit 1
|
||||
${RM} -rf ${TMPDIR}/bochs-${VERSION}
|
||||
test $? = 0 || exit 1
|
||||
|
||||
# create RPM build area
|
||||
rm -rf ${RPMSRCPATH}
|
||||
mkdir ${RPMSRCPATH} ${RPMSRCPATH}/SOURCES ${RPMSRCPATH}/SPECS ${RPMSRCPATH}/BUILD ${RPMSRCPATH}/RPMS ${RPMSRCPATH}/SRPMS
|
||||
test $? = 0 || exit 1 # test that mkdir succeeded
|
||||
|
||||
# copy source into sources
|
||||
${MV} ${TMPDIR}/bochs-${VERSION}.tar.gz ${SOURCES}
|
||||
test $? = 0 || exit 1
|
||||
|
||||
# copy the spec into SPECS. The template is in $RPMSPEC, and we use
|
||||
# SED to substitute in the version number.
|
||||
${RM} -f ${SPECS}/bochs.spec
|
||||
test $? = 0 || exit 1
|
||||
${CAT} ${RPMSPEC} | ${SED} "s/@SEDVERSION@/${VERSION}/g" > ${SPECS}/bochs.spec
|
||||
test $? = 0 || exit 1
|
||||
|
||||
# finally, start the rpm build.
|
||||
if [ -x ${RPMBUILD} ]
|
||||
then
|
||||
${RPMBUILD} -ba --define "_topdir `pwd`/${RPMSRCPATH}" ${SPECS}/bochs.spec
|
||||
else
|
||||
${RPM} -ba --define "_topdir `pwd`/${RPMSRCPATH}" ${SPECS}/bochs.spec
|
||||
fi
|
||||
|
||||
# test status
|
||||
if test $? = 0; then
|
||||
echo RPM build succeeded
|
||||
else
|
||||
echo RPM build failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# copy all rpms out into main directory
|
||||
ALLRPMS=`find ${RPMSRCPATH} -name '*.rpm'`
|
||||
if test "$ALLRPMS" != ""; then
|
||||
echo Moving .rpm files into the main directory.
|
||||
mv ${ALLRPMS} .
|
||||
ls -l *.rpm
|
||||
fi
|
||||
Reference in New Issue
Block a user