summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2010-03-17 15:19:20 -0500
committerVictor Lowther <victor.lowther@gmail.com>2010-03-17 15:19:20 -0500
commit5315e7c7aa23b50a7a54061c91cf5ed544607b58 (patch)
tree0e2fbfc24b010dbde5dc855a86fff8687f3d4cf3
parent6a0f687919da4465e3b76d6947e4fde46d092194 (diff)
Move make-rpm from the rpm branch to here
-rw-r--r--make-rpm22
1 files changed, 22 insertions, 0 deletions
diff --git a/make-rpm b/make-rpm
new file mode 100644
index 0000000..b8eb9c4
--- /dev/null
+++ b/make-rpm
@@ -0,0 +1,22 @@
+#!/bin/sh
+[[ -d .git ]] || { echo "Not at root of pm-utils repository, dying horribly"; exit 1; }
+cp .git/HEAD .git/HEAD.mkrpm
+cp .git/index .git/index.mkrpm
+git rev-parse --verify rpm || exit 1
+
+export PM_UTILS_DIR="$(pwd)"
+export TIMESTAMP="$(git log --pretty=format:"%ct" |head -1)"
+export GITREV="$(git log --pretty=format:"%t" |head -1)"
+git checkout -b __rpm_throwaway_branch
+git merge rpm
+
+sed -e "s,[@]TIMESTAMP[@],$TIMESTAMP,g" \
+ -e "s,[@]GITREV[@],$GITREV,g" <pm-utils.spec.in >pm-utils.spec
+
+rpmbuild -bb pm-utils.spec
+mv -f .git/HEAD.mkrpm .git/HEAD
+mv -f .git/index.mkrpm .git/index
+git checkout HEAD
+git branch -D __rpm_throwaway_branch
+
+