File: rules

package info (click to toggle)
golang-golang-x-net-dev 0.0%2Bgit20150226.3d87fd6-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,000 kB
  • ctags: 4,376
  • sloc: makefile: 22; asm: 2
file content (36 lines) | stat: -rwxr-xr-x 1,357 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f
# -*- makefile -*-

export DH_VERBOSE=1

# GOPKG is the upstream path which you would normally “go get”.
# Using it allows us to build applications without patching locations.
export DH_GOPKG := golang.org/x/net

%:
	dh $@ --buildsystem=golang --with=golang

BUILDDIR := $(shell perl -w -MDebian::Debhelper::Buildsystem::golang -e \
        'print Debian::Debhelper::Buildsystem::golang->new()->get_builddir()')

override_dh_auto_configure:
	dh_auto_configure -O--buildsystem=golang
	# Include test fixtures.
	cp -av html/charset/testdata $(BUILDDIR)/src/$(DH_GOPKG)/html/charset/
	cp -av html/testdata $(BUILDDIR)/src/$(DH_GOPKG)/html/

override_dh_auto_test:
	# Some tests require root, need -short to skip them for now.
	dh_auto_test -O--buildsystem=golang -- -short

DEBVERS    ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
VERSION    ?= $(shell echo '$(DEBVERS)' | sed 's/^[[:digit:]]*://; s/[-].*//')
DEBPKGNAME ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Source: //p')
GITCOMMIT  ?= $(shell echo '$(VERSION)' | \
              sed -e 's/.*+git[[:digit:]]*\.\([[:xdigit:]]*\).*/\1/')

gen-orig-tgz:
	if [ ! -f ../$(DEBPKGNAME)_$(VERSION).orig.tar.gz ] ; then \
	    git archive --format=tar.gz --prefix=$(DEBPKGNAME)-$(VERSION)/ \
                $(GITCOMMIT) >../$(DEBPKGNAME)_$(VERSION).orig.tar.gz ; \
	fi