[packages/caddy] only gitTag is relevant for release build

glen glen at pld-linux.org
Sun May 22 22:39:42 CEST 2016


commit d3a5ccf9477be5f77a37292e36398f869d579409
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun May 22 23:37:14 2016 +0300

    only gitTag is relevant for release build

 build-date.patch | 17 -----------------
 caddy.spec       | 14 ++------------
 2 files changed, 2 insertions(+), 29 deletions(-)
---
diff --git a/caddy.spec b/caddy.spec
index ebacff9..c9479c9 100644
--- a/caddy.spec
+++ b/caddy.spec
@@ -11,7 +11,6 @@ License:	Apache v2.0
 Group:		Networking/Daemons/HTTP
 Source0:	https://github.com/mholt/caddy/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	2d08bf70a7ad4255513bf1e0df174e98
-Patch0:		build-date.patch
 URL:		https://caddyserver.com/
 BuildRequires:	golang >= 1.6
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -34,26 +33,17 @@ cryptographic assets for you.
 
 %prep
 %setup -q
-%patch0 -p1
 
 GOPATH=$(pwd)/vendor
 install -d $GOPATH/src/github.com/mholt
 ln -s ../../../.. $GOPATH/src/github.com/mholt/caddy
 
-date=$(date -u +"%%a %%b %%d %%H:%%M:%%S %%Z %%Y")
-%{__sed} -i -e "/buildDate/ s/(unknown)/$date/" main.go
-
 %build
 export GOPATH=$(pwd)/vendor
 
 # command extraced by running "build.bash" from git tree
-LDFLAGS="\
--X main.gitTag=v%{version} \
--X main.gitNearestTag=v%{version} \
--X main.gitCommit= \
--X main.gitShortStat= \
--X main.gitFilesModified= \
-"
+# however only gitTag is relevant for release build
+LDFLAGS="-X main.gitTag=v%{version}"
 
 test -d vendor/src/golang.org || go get ./... || :
 %gobuild -o caddy.bin
diff --git a/build-date.patch b/build-date.patch
deleted file mode 100644
index b18d344..0000000
--- a/build-date.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-unable to pass -X main.buildDate as ldflags if it contains space
-
-likely go link command lacks proper argument passing that it loses spaces
-
-so patch the source directly
-
---- caddy-0.8.3/main.go~	2016-04-26 18:28:05.000000000 +0300
-+++ caddy-0.8.3/main.go	2016-05-22 14:13:18.927407255 +0300
-@@ -233,7 +233,7 @@
- 	appVersion = "(untracked dev build)" // inferred at startup
- 	devBuild   = true                    // inferred at startup
- 
--	buildDate        string // date -u
-+	buildDate = "(unknown)" // date -u
- 	gitTag           string // git describe --exact-match HEAD 2> /dev/null
- 	gitNearestTag    string // git describe --abbrev=0 --tags HEAD
- 	gitCommit        string // git rev-parse HEAD
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/caddy.git/commitdiff/d3a5ccf9477be5f77a37292e36398f869d579409



More information about the pld-cvs-commit mailing list