[Pkg-privacy-commits] [pt-websocket] 08/11: use dh_golang to build instead, it handles path changes better
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 11:14:47 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository pt-websocket.
commit e5408c7819a88be846c26719bb7a7b3fe9cfaa32
Author: Ximin Luo <infinity0 at pwned.gg>
Date: Sat May 24 17:19:31 2014 +0100
use dh_golang to build instead, it handles path changes better
---
debian/patches/series | 1 +
debian/patches/use-dh-golang.patch | 27 +++++++++++++++++++++++++++
debian/rules | 19 +++++++++++++++----
3 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2e2a039
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+use-dh-golang.patch
diff --git a/debian/patches/use-dh-golang.patch b/debian/patches/use-dh-golang.patch
new file mode 100644
index 0000000..0709013
--- /dev/null
+++ b/debian/patches/use-dh-golang.patch
@@ -0,0 +1,27 @@
+Description: Use dh_golang to build the binaries
+Author: Ximin Luo <infinity0 at pwned.gg>
+Forwarded: not-needed
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/Makefile
++++ b/Makefile
+@@ -17,7 +17,7 @@
+ pt-websocket-client/pt-websocket-client: pt-websocket-client/*.go
+ cd pt-websocket-client && go build $(GOBUILDFLAGS)
+
+-doc/pt-websocket-server.1: pt-websocket-server/pt-websocket-server
++doc/pt-websocket-server.1: obj-$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)/bin/pt-websocket-server
+ help2man --no-info --name "WebSocket server pluggable transport" --version-string "$(VERSION)" -o "$@" "$<"
+
+ install: pt-websocket-server/pt-websocket-server
+--- a/pt-websocket-server/pt-websocket-server.go
++++ b/pt-websocket-server/pt-websocket-server.go
+@@ -20,7 +20,7 @@
+ "time"
+ )
+
+-import "../websocket"
++import "git.torproject.org/pluggable-transports/websocket/websocket"
+
+ import "git.torproject.org/pluggable-transports/goptlib.git"
+
diff --git a/debian/rules b/debian/rules
index fe5a7e0..4684665 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,17 +4,28 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-export GOPATH=/usr/share/gocode
+export DH_GOPKG := git.torproject.org/pluggable-transports/websocket
+export DH_GOPKG_SUBDIRS := websocket pt-websocket-server
+
+DH_BUILDDIR = obj-$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
%:
- dh $@
+ dh $@ --buildsystem=golang --with=golang
override_dh_auto_build:
- dh_auto_build
+ cd $(DH_BUILDDIR) && GOPATH=$$PWD go install -v $(DH_GOPKG_SUBDIRS:%=$(DH_GOPKG)/%)
make doc/pt-websocket-server.1
+override_dh_auto_test:
+ cd $(DH_BUILDDIR) && GOPATH=$$PWD go test -v $(DH_GOPKG_SUBDIRS:%=$(DH_GOPKG)/%)
+
override_dh_auto_install:
- dh_auto_install -S makefile -- PREFIX=/usr
+ dh_auto_install
+ rm -rf debian/pt-websocket/usr/share/gocode
+
+override_dh_auto_clean:
+ dh_auto_clean
+ make clean
override_dh_compress:
dh_compress -X /examples/
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/pt-websocket.git
More information about the Pkg-privacy-commits
mailing list