Add ldflags to set the version number to match the RPM Version/Release data

This commit is contained in:
Jason Rothstein 2019-07-28 23:45:45 -05:00
parent 2e01e24029
commit 46f60501c4

View File

@ -2,7 +2,7 @@ ExclusiveArch: %{go_arches}
Name: gitea
Version: 1.8.3
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Gitea: Git with a cup of tea
License: MIT
@ -68,8 +68,7 @@ export GOOS
#
# Using -v to display what is happening
#
# go build -a -v -tags 'bindata pam sqlite sqlite_unlock_notify'
TAGS='bindata pam sqlite sqlite_unlock_notify' make generate build
go build -a -v -tags 'bindata pam sqlite sqlite_unlock_notify' -ldflags '-X "main.Version=%{version}-%{release}" -X "main.Tags="bindata pam sqlite sqlite_unlock_notify"'
sed -i \
-e 's|^User=.*$|User=gitea|g' \
-e 's|^Group=.*$|Group=gitea|g' \