nova/plugins/xenserver/xenapi/contrib/build-rpm.sh
Mate Lakat f8d25feed1 xenapi: rpmbuild fixes
Fixes bug 1157695

This fix removes the parted dependency from the rpm specification file,
and also gets rid of the assumption, that the build-rpm.sh is executed
at a specific directory.

Change-Id: I1dcf9096a783a88bc09af0f4f4d5541a7e505748
2013-03-20 15:29:09 +00:00

23 lines
558 B
Bash
Executable File

#!/bin/bash
PACKAGE=openstack-xen-plugins
THIS_DIR=$(cd $(dirname $0) && pwd)
RPMBUILD_DIR="$THIS_DIR/rpmbuild"
if [ ! -d $RPMBUILD_DIR ]; then
echo $RPMBUILD_DIR is missing
exit 1
fi
for dir in BUILD BUILDROOT SRPMS RPMS SOURCES; do
rm -rf $RPMBUILD_DIR/$dir
mkdir -p $RPMBUILD_DIR/$dir
done
rm -rf /tmp/$PACKAGE
mkdir /tmp/$PACKAGE
cp -r "$THIS_DIR/../etc/xapi.d" /tmp/$PACKAGE
tar czf $RPMBUILD_DIR/SOURCES/$PACKAGE.tar.gz -C /tmp $PACKAGE
rpmbuild -ba --nodeps --define "_topdir $RPMBUILD_DIR" \
$RPMBUILD_DIR/SPECS/$PACKAGE.spec