2020-02-12 22:50:24 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
pushd $SCRIPT_DIR
|
|
|
|
|
|
|
|
date=$(date +%Y%m%d)
|
|
|
|
version_desc=$(git describe --tags --match "*.*")
|
|
|
|
version=$(echo $version_desc | cut -d '-' -f2)
|
|
|
|
patch_count=$(echo $version_desc | cut -d '-' -f3)
|
|
|
|
hash=$(echo $version_desc | cut -d '-' -f4)
|
|
|
|
|
|
|
|
if [ x$patch_count != x ]; then
|
|
|
|
release=0.${date}.${patch_count}git${hash}%{?dist}
|
|
|
|
else
|
2020-02-14 17:45:13 +00:00
|
|
|
release=1%{?dist}
|
2020-02-12 22:50:24 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
./spec_tmpl.sh version=$version release=$release template=libmodulemd.spec.in > libmodulemd.spec
|
|
|
|
|
|
|
|
popd
|