1#!/bin/bash 2 3set -x 4set -e 5 6TMP=$(mktemp -d /tmp/rpmbuild.XXXXXX) 7 8function cleanup() { 9 [[ -d $TMP ]] && rm -rf $TMP 10} 11trap cleanup EXIT 12 13mkdir $TMP/{BUILD,RPMS,SOURCES,SPECS,SRPMS} 14 15llvmver=3.7.1 16 17. scripts/git-tag.sh 18 19git archive HEAD --prefix=bcc/ --format=tar.gz -o $TMP/SOURCES/bcc.tar.gz 20 21sed \ 22 -e "s/^\(Version:\s*\)@REVISION@/\1$revision/" \ 23 -e "s/^\(Release:\s*\)@GIT_REV_COUNT@/\1$release/" \ 24 SPECS/bcc.spec > $TMP/SPECS/bcc.spec 25 26pushd $TMP 27rpmbuild $RPM_WITH_OPTS --define "_topdir `pwd`" -ba SPECS/bcc.spec 28popd 29 30cp $TMP/RPMS/*/*.rpm . 31cp $TMP/SRPMS/*.rpm . 32