File: rules

package info (click to toggle)
golang-google-cloud 0.9.0-10
  • links: PTS, VCS
  • area: main
  • in suites: buster, buster-backports
  • size: 4,964 kB
  • sloc: sh: 98; makefile: 82; awk: 67
file content (54 lines) | stat: -rwxr-xr-x 1,665 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
#!/usr/bin/make -f

# vision has new dependencies, skip for now.
export DH_GOLANG_EXCLUDES := cmd/go-cloud-debug-agent vision speech/apiv1beta1
export DH_GOLANG_EXCLUDES_ALL := 1
export DH_GOLANG_INSTALL_EXTRA := bigtable/testdata datastore/testdata \
	storage/testdata vision/testdata

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

OLDIPATH := google.golang.org/cloud
IPATH := cloud.google.com/go
BUILDDIR := $(CURDIR)/build

override_dh_auto_configure:
	# Prevent dh-golang from creating a symlink here.
	mkdir -p `dirname $(BUILDDIR)/src/$(OLDIPATH)`
	dh_auto_configure
	# Duplicate source tree into new namespace, for compatibility during
	# transition.
	rm -f $(BUILDDIR)/src/$(OLDIPATH)
	mkdir -vp $(BUILDDIR)/src/$(OLDIPATH)
	cp -avT $(BUILDDIR)/src/$(IPATH) $(BUILDDIR)/src/$(OLDIPATH)
	find $(BUILDDIR)/src/$(OLDIPATH) -name \*.go \
	    -exec sed -i 's#\<$(IPATH)\>#$(OLDIPATH)#' {} \;

override_dh_auto_build:
	dh_auto_build
	# Also build the duplicated tree.
	DH_GOPKG=$(OLDIPATH) dh_auto_build

override_dh_auto_test:
	dh_auto_test -- -short
	# Also test the duplicated tree.
	DH_GOPKG=$(OLDIPATH) dh_auto_test -- -short

override_dh_auto_install:
	dh_auto_install
	# Also install the duplicated tree.
	DH_GOPKG=$(OLDIPATH) dh_auto_install

PKG1 := golang-google-cloud-dev
PKG2 := golang-google-cloud-compute-metadata-dev
PREFIX := usr/share/gocode/src

override_dh_install:
	dh_install
	# Move compute/metadata files into separate package.
	for path in $(IPATH) $(OLDIPATH); do \
	    mkdir -vp debian/$(PKG2)/$(PREFIX)/$$path/; \
	    mv -v debian/$(PKG1)/$(PREFIX)/$$path/compute/ \
		debian/$(PKG2)/$(PREFIX)/$$path; \
	done