diff options
author | Evan Martin <martine@danga.com> | 2012-12-29 21:36:00 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-12-29 21:47:41 (GMT) |
commit | 2c953d1501de5195e2485185fa24a2ebfd76bbb5 (patch) | |
tree | 2fc88e378a6df571bb125d282b14475f2b9ba05c /misc/packaging/rpmbuild.sh | |
parent | 7096bf1507f98be981aa14ffd9ed5a4a8b1c1494 (diff) | |
parent | 3249938cdf574058a066436aea06b0541ded6958 (diff) | |
download | Ninja-1.1.0.zip Ninja-1.1.0.tar.gz Ninja-1.1.0.tar.bz2 |
version 1.1.0v1.1.0
Diffstat (limited to 'misc/packaging/rpmbuild.sh')
-rwxr-xr-x | misc/packaging/rpmbuild.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/misc/packaging/rpmbuild.sh b/misc/packaging/rpmbuild.sh new file mode 100755 index 0000000..9b74c65 --- /dev/null +++ b/misc/packaging/rpmbuild.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +echo Building ninja RPMs.. +GITROOT=$(git rev-parse --show-toplevel) +cd $GITROOT + +VER=1.0 +REL=$(git rev-parse --short HEAD)git +RPMTOPDIR=$GITROOT/rpm-build +echo "Ver: $VER, Release: $REL" + +# Create tarball +mkdir -p $RPMTOPDIR/{SOURCES,SPECS} +git archive --format=tar --prefix=ninja-${VER}-${REL}/ HEAD | gzip -c > $RPMTOPDIR/SOURCES/ninja-${VER}-${REL}.tar.gz + +# Convert git log to RPM's ChangeLog format (shown with rpm -qp --changelog <rpm file>) +sed -e "s/%{ver}/$VER/" -e "s/%{rel}/$REL/" misc/packaging/ninja.spec > $RPMTOPDIR/SPECS/ninja.spec +git log --format="* %cd %aN%n- (%h) %s%d%n" --date=local | sed -r 's/[0-9]+:[0-9]+:[0-9]+ //' >> $RPMTOPDIR/SPECS/ninja.spec + +# Build SRC and binary RPMs +rpmbuild --quiet \ + --define "_topdir $RPMTOPDIR" \ + --define "_rpmdir $PWD" \ + --define "_srcrpmdir $PWD" \ + --define '_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \ + -ba $RPMTOPDIR/SPECS/ninja.spec && + +rm -rf $RPMTOPDIR && +echo Done |