]> git.pld-linux.org Git - packages/caddy.git/commitdiff
only gitTag is relevant for release build
authorElan Ruusamäe <glen@delfi.ee>
Sun, 22 May 2016 20:37:14 +0000 (23:37 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sun, 22 May 2016 20:37:57 +0000 (23:37 +0300)
build-date.patch [deleted file]
caddy.spec

diff --git a/build-date.patch b/build-date.patch
deleted file mode 100644 (file)
index b18d344..0000000
+++ /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
index ebacff925926a0a85c679f5c129409b8de8c7e13..c9479c97af5afdc81d4102ccc525dccd4d3c26bd 100644 (file)
@@ -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
This page took 0.091405 seconds and 4 git commands to generate.