Newer
Older
Pete Fritchman
committed
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Pete Fritchman
committed
set -e
progname=$(basename $0)
Lloyd Hilaiel
committed
cd $(dirname $0)/.. # top level of the checkout
Pete Fritchman
committed
mkdir -p rpmbuild/SOURCES rpmbuild/SPECS rpmbuild/SOURCES
rm -rf rpmbuild/RPMS rpmbuild/SOURCES/browserid
tar --exclude rpmbuild --exclude .git --exclude .svn \
Pete Fritchman
committed
--exclude var -czf \
$PWD/rpmbuild/SOURCES/browserid-server.tar.gz .
Pete Fritchman
committed
set +e
export GIT_REVISION=$(git log -1 --oneline)
export SVN_REVISION=$(svn info locale/ | sed -n -e "s,^Revision: ,,p")
rpmbuild --define "_topdir $PWD/rpmbuild" \
--define "svnrev $SVN_REVISION" -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