diff options
author | Jan Synacek <jsynacek@redhat.com> | 2014-05-13 08:29:56 +0200 |
---|---|---|
committer | Jan Synacek <jsynacek@redhat.com> | 2014-05-13 08:30:10 +0200 |
commit | 088c5d36334c8dfc8a1fc57870bafb030f68608b (patch) | |
tree | 7edf4543c67794548c16fb6f434d31c09c856d0a /make-rpm.sh | |
parent | b619fa3610d0920f6b1cec737c9ff2b7b4839c94 (diff) | |
download | openlmi-providers-088c5d36334c8dfc8a1fc57870bafb030f68608b.tar.gz openlmi-providers-088c5d36334c8dfc8a1fc57870bafb030f68608b.tar.xz openlmi-providers-088c5d36334c8dfc8a1fc57870bafb030f68608b.zip |
add make-rpm.sh
Diffstat (limited to 'make-rpm.sh')
-rwxr-xr-x | make-rpm.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/make-rpm.sh b/make-rpm.sh new file mode 100755 index 0000000..f4341b8 --- /dev/null +++ b/make-rpm.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +PKG="openlmi-providers" + +dir="$(dirname $(realpath $0))" + +"$dir/make-release.sh" $1 || exit 1 + +if [ $# -lt 1 ]; +then + # We want current dirty copy + tag="--dirty" +else + tag="$1" +fi + +VERSION="$(git describe $tag | sed 's/-/_/g')" + +tempdir="$(mktemp -d)" +mkdir -p "$tempdir" +trap "rm -rf $tempdir" EXIT + +sed "s/^Version:.*$/Version: $VERSION/g" "$dir/openlmi-providers.spec" > "$tempdir/openlmi-providers.spec" +rpmdev-bumpspec -c "Version $VERSION" "$tempdir/openlmi-providers.spec" + +rpmbuild --define "_sourcedir $PWD" -ba "$tempdir/openlmi-providers.spec" |