File: rules

package info (click to toggle)
golang-google-cloud 0.56.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 22,368 kB
  • sloc: sh: 191; ansic: 75; makefile: 65; awk: 64; asm: 46; python: 21
file content (53 lines) | stat: -rwxr-xr-x 1,647 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
#!/usr/bin/make -f

# pubsub/internal/longtest has "no non-test Go files" error and is thus excluded
export DH_GOLANG_EXCLUDES := cmd pubsub/internal/longtest internal/gapicgen
export DH_GOLANG_EXCLUDES_ALL := 1
export DH_GOLANG_INSTALL_EXTRA := storage/internal/test

%:
	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