From e400eca3de579994e00b058c1b4be711ec6f7f7a Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Mon, 29 Jul 2019 00:02:53 -0500 Subject: [PATCH] Modify main.go to set the version the spec file version-release data --- gitea.spec | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gitea.spec b/gitea.spec index 94b2544..648823c 100644 --- a/gitea.spec +++ b/gitea.spec @@ -2,7 +2,7 @@ ExclusiveArch: %{go_arches} Name: gitea Version: 1.8.3 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Gitea: Git with a cup of tea License: MIT @@ -63,12 +63,18 @@ export GOOS # rm -fr vendor # + +# +# Push our package version, release, and buidl tags into the code +# +sed -i -e 's/^var Version.*$/var Version = "%{version}-%{release}"/g' main.go + # # Using -a to force everything to compile # # Using -v to display what is happening # -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"' +go build -a -v -tags 'bindata pam sqlite sqlite_unlock_notify' sed -i \ -e 's|^User=.*$|User=gitea|g' \ -e 's|^Group=.*$|Group=gitea|g' \