From 0325c07f38055ab8665448726da72ba32e947410 Mon Sep 17 00:00:00 2001 From: Kristina Pathak Date: Fri, 21 Jan 2022 12:34:51 -0800 Subject: [PATCH 1/2] added version fixes for rpm building --- deploy/packaging/themis.spec | 6 +++--- rpkg.macros | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) 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 +} From 25515a69083d4c08c30e8087d491d20f5f9edbe5 Mon Sep 17 00:00:00 2001 From: Kristina Pathak Date: Fri, 21 Jan 2022 12:45:20 -0800 Subject: [PATCH 2/2] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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)