blob: 9d236bc227a0fe161a530cbee7fbaaa4a649b14e [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001#!/bin/bash
2
3TAG=$(git describe | cut -d- -f1 | sed -e 's/^v//')
4ADD=$(git describe | cut -s -d- -f2)
5CMT=$(git describe --dirty --match 'v*'| cut -s -d- -f3,4)
6
7if [ "$1" = "rpm-version" ]; then
8 echo ${TAG}
9 exit
10fi
11
12if [ "$1" = "rpm-release" ]; then
13 [ -z "${ADD}" ] && echo release && exit
14 echo ${ADD}~${CMT}
15 exit
16fi
17
18if [ -n "${ADD}" ]; then
19 echo ${TAG}-${ADD}~${CMT}
20else
21 echo ${TAG}
22fi