diff --git a/CHANGELOG.md b/CHANGELOG.md index eb13d22..5a62492 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] - Migrated to github.com/golang-jwt/jwt to address a security vulnerability. [#78](https://github.com/xmidt-org/themis/pull/78) +- Updated spec file and rpkg version macro to be able to choose when the 'v' is included in the version. [#80](https://github.com/xmidt-org/themis/pull/80) ## [v0.4.7] - Migrate to github actions, normalize analysis tools, Dockerfiles and Makefiles. [#67](https://github.com/xmidt-org/themis/pull/67) diff --git a/deploy/packaging/themis.spec b/deploy/packaging/themis.spec index 384c745..2bfd2bd 100644 --- a/deploy/packaging/themis.spec +++ b/deploy/packaging/themis.spec @@ -3,7 +3,7 @@ %define debug_package %{nil} Name: themis -Version: {{{ git_tag_version }}} +Version: v{{{ git_tag_version }}} Release: 1%{?dist} Summary: The Xmidt authentication JWT issuer for connecting devices in standalone mode. @@ -12,7 +12,7 @@ Packager: Comcast Group: System Environment/Daemons License: ASL 2.0 URL: https://github.com/xmidt-org/themis -Source0: %{name}-%{version}.tar.gz +Source0: https://github.com/xmidt-org/%{name}/archive/%{version}.tar.gz Prefix: /opt BuildRoot: %{_tmppath}/%{name} @@ -24,7 +24,7 @@ BuildRequires: git The Xmidt authentication JWT issuer for connecting devices in standalone mode %prep -%setup -q +%setup -n %{name}-{{{ git_tag_version }}} %build GOPROXY=https://proxy.golang.org go build -ldflags "-linkmode=external -X 'main.BuildTime=`date -u '+%c'`' -X main.GitCommit={{{ git_short_hash }}} -X main.Version=%{version}" -o %{name} . diff --git a/rpkg.macros b/rpkg.macros index 45baa75..0e49be8 100644 --- a/rpkg.macros +++ b/rpkg.macros @@ -15,5 +15,9 @@ function git_tag_version { tag="$(git describe --tags --abbrev=0)" fi + # Remove the potential prefix of `v` + if [[ $tag =~ ^v[0-9].* ]]; then + tag="${tag:1}" + fi output "$tag" -} \ No newline at end of file +}