Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added version fixes for rpm building #80

Merged
merged 2 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions deploy/packaging/themis.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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}
Expand All @@ -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} .
Expand Down
6 changes: 5 additions & 1 deletion rpkg.macros
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}