1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
#!/bin/sh
#
# $RCSfile$
#
if [ ! -d "adm" ]; then
echo "You must be running this script from the topdir directory."
exit 1;
fi
# Note: this script assume that release_bin has already been called.
echo "== Getting version number"
VERSION=`adm/get_version`
echo "== Version is " $VERSION
echo "== Getting and creating top dir"
# Variable subsitution for rpm --showrc output
_usrsrc="/usr/src"
BUILDROOT=`eval echo $(rpm --showrc | egrep "[^{]_topdir" | cut --fields=2 | sed 's/%/$/')`
mkdir -p $BUILDROOT/{SPECS,SOURCES,BUILD,SRPMS,RPMS}
# echo "== Creating spec file"
# cp adm/xxdiff-rpm.spec $BUILDROOT/SPECS/xxdiff-$VERSION.spec
echo "== Copying pristine build to $BUILDROOT/SOURCES"
PRISTINE=../xxdiff-$VERSION.tar.bz2
if [ ! -f "$PRISTINE" ]; then
echo "Cannot find pristine sources in $PRISTINE"
fi
cp $PRISTINE $BUILDROOT/SOURCES
echo "== Building source and binary packages"
# Note: we use nodeps here because tmake package is not quite common yet under
# rh-7.1.
# use -bs to build source only
rpmbuild -ba --nodeps --clean --rmsource adm/xxdiff-rpm.spec
#rpm -bs --nodeps adm/xxdiff-rpm.spec
#rpm -bs --nodeps --rmsource --rmspec $BUILDROOT/SPECS/xxdiff-$VERSION.spec
#rpm -bs --nodeps --rmsource --rmspec $BUILDROOT/SPECS/xxdiff-$VERSION.spec
#rpm -ts --nodeps --clean --rmsource --rmspec $PRISTINE
DEST=$HOME
echo "== Copying source and binary packages to $DEST"
if test `uname -m` = "x86_64"
then
arch="x86_64"
else
arch="i386"
fi
cp $BUILDROOT/RPMS/$arch/xxdiff-$VERSION*.$arch.rpm $DEST
cp $BUILDROOT/SRPMS/xxdiff-$VERSION*.src.rpm $DEST
echo "== Signing package files in $DEST"
rpm --addsign $DEST/xxdiff-$VERSION*.rpm
echo "== Done."
|