Skip to content

Commit

Permalink
Merge pull request #31 from xmidt-org/hotfix-copr
Browse files Browse the repository at this point in the history
added version fixes for rpm building
  • Loading branch information
schmidtw authored Jan 21, 2022
2 parents 73b7539 + 6f1ede2 commit e6120ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- added mutex to prevent data races [#16](https://github.com/xmidt-org/mimisbrunnr/pull/16)
- added documentation and enhancements [#20](https://github.com/xmidt-org/mimisbrunnr/pull/20)
- Migrate to github actions, normalize analysis tools, Dockerfiles and Makefiles. [#27](https://github.com/xmidt-org/mimisbrunnr/pull/27)
- Updated spec file and rpkg version macro to be able to choose when the 'v' is included in the version. [#31](https://github.com/xmidt-org/mimisbrunnr/pull/31)

## [v0.1.0]
- Initial creation
Expand Down
6 changes: 3 additions & 3 deletions deploy/packaging/mimisbrunnr.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%define debug_package %{nil}

Name: mimisbrunnr
Version: {{{ git_tag_version }}}
Version: v{{{ git_tag_version }}}
Release: 1%{?dist}
Summary: Provides device specific event delivery.

Expand All @@ -11,7 +11,7 @@ Packager: Comcast
Group: System Environment/Daemons
License: ASL 2.0
URL: https://github.com/xmidt-org/mimisbrunnr
Source0: %{name}-%{version}.tar.gz
Source0: https://github.com/xmidt-org/%{name}/archive/%{version}.tar.gz

Prefix: /opt
BuildRoot: %{_tmppath}/%{name}
Expand All @@ -23,7 +23,7 @@ BuildRequires: git
Provides device specific event delivery.

%prep
%setup -q
%setup -n %{name}-{{{ git_tag_version }}}

%build
GO111MODULE=on GOPROXY=https://proxy.golang.org go build -ldflags "-linkmode=external -X 'main.BuildTime=`date -u '+%Y-%m-%d %H:%M:%S'`' -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"
}
}

0 comments on commit e6120ef

Please sign in to comment.