Newer
Older
Pete Fritchman
committed
#!/bin/bash
set -e
progname=$(basename $0)
Lloyd Hilaiel
committed
cd $(dirname $0)/.. # top level of the checkout
Pete Fritchman
committed
curdir=$(basename $PWD)
Lloyd Hilaiel
committed
if [ "$curdir" != "browserid" ]; then
Pete Fritchman
committed
echo "$progname: git checkout must be in a dir named 'browserid'" >&2
exit 1
fi
mkdir -p rpmbuild/SOURCES rpmbuild/SPECS
rm -rf rpmbuild/RPMS
tar -C .. --exclude rpmbuild -czf \
$PWD/rpmbuild/SOURCES/browserid-server.tar.gz browserid
set +e
export GIT_REVISION=$(git log -1 --oneline)
rpmbuild --define "_topdir $PWD/rpmbuild" -ba scripts/browserid.spec
Pete Fritchman
committed
rc=$?
if [ $rc -eq 0 ]; then
Lloyd Hilaiel
committed
ls -l $PWD/rpmbuild/RPMS/*/*.rpm
Pete Fritchman
committed
else
echo "$progname: failed to build browserid RPM (rpmbuild rc=$rc)" >&2
fi
exit $rc