File: rules

package info (click to toggle)
golang-golang-x-tools 1%3A0.0~git20161028.0.b814a3b%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch, stretch-backports
  • size: 5,712 kB
  • ctags: 5,861
  • sloc: yacc: 155; sh: 95; makefile: 28; asm: 18; xml: 11; ansic: 10
file content (55 lines) | stat: -rwxr-xr-x 1,795 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE := 1

# Exclude "cover" since it is included in core as of Go 1.5+. Exclude heapview
# due to weird javascript dependencies.
export DH_GOLANG_EXCLUDES := golang.org/x/tools/cmd/cover \
    golang.org/x/tools/cmd/heapview golang.org/x/tools/godoc/static

# godoc/static is needed for tests.
export DH_GOLANG_INSTALL_EXTRA := godoc/static \
    $(wildcard */*/testdata) $(wildcard */*/*/testdata)

BUILDDIR := $(CURDIR)/build

%:
	dh $@ --buildsystem=golang --with=golang --builddirectory=$(BUILDDIR)

# gccgo installs godoc into $GOROOT/bin, so create a temporary $GOROOT into
# which it is actually allowed to write (as opposed to /usr/lib/go).
ifneq ($(strip $(shell go version | grep gccgo)),)
DH_GOLANG_EXCLUDES += golang.org/x/tools/cmd/godoc

TMPGOROOT := $(BUILDDIR)/root

override_dh_auto_configure:
	mkdir -p $(TMPGOROOT)
	dh_auto_configure

override_dh_auto_build:
	dh_auto_build
	GOROOT=$(TMPGOROOT) GOPATH=$(BUILDDIR) go install -v \
	    golang.org/x/tools/cmd/godoc
	mv -v $(TMPGOROOT)/bin/godoc $(BUILDDIR)/bin

override_dh_auto_test:
	# disable tests as they fail with gccgo
endif

override_dh_auto_install:
	dh_auto_install
	# Rename “eg” to “golang-eg” (#753978)
	mv debian/tmp/usr/bin/eg debian/tmp/usr/bin/golang-eg
	# Rename “stress” to “golang-stress” (#793693)
	mv debian/tmp/usr/bin/stress debian/tmp/usr/bin/golang-stress
	# Rename “bundle” to “golang-bundle” (#818551)
	mv debian/tmp/usr/bin/bundle debian/tmp/usr/bin/golang-bundle
	# Rename “guru” to “golang-guru”
	mv debian/tmp/usr/bin/guru debian/tmp/usr/bin/golang-guru

override_dh_auto_test:
	# use short tests where possible (especially to skip tests like
	# TestWebIndex which are very slow)
	dh_auto_test -- -test.short