• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/$git_tag_latest.tar.gz
20wget -P $TMP/SOURCES http://llvm.org/releases/$llvmver/{cfe,llvm}-$llvmver.src.tar.xz
21
22sed \
23  -e "s/^\(Version:\s*\)@REVISION@/\1$revision/" \
24  -e "s/^\(Release:\s*\)@GIT_REV_COUNT@/\1$release/" \
25  SPECS/bcc+clang.spec > $TMP/SPECS/bcc.spec
26
27pushd $TMP
28rpmbuild --define "_topdir `pwd`" -ba SPECS/bcc.spec
29popd
30
31cp $TMP/RPMS/*/*.rpm .
32cp $TMP/SRPMS/*.rpm .
33