~unity-api-team/unity-scope-snappy/trunk

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
#!/usr/bin/make -f

export DH_GOPKG := launchpad.net/unity-scope-snappy

# Tell dh-golang that we need subpackages.
export DH_GOLANG_INSTALL_ALL := 1

# Setup the paths so we can run gocov and gocov-xml.
export GOPATH := $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
export PATH := $(GOPATH)/bin:$(PATH)

STORE_FILE_PATH := /usr/lib/$(DEB_HOST_MULTIARCH)/unity-scopes/snappy-store/store

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

# Run the tests and produce a Cobertura-compatible coverage report.
override_dh_auto_test: debian/snappy-store.ini debian/com.canonical.applications.WebdmPackageManager.service
	dbus-test-runner -m 600 -t make -p integration_tests
	dbus-test-runner -m 600 -t make -p coverage.xml

# Rewrite any *.in files to be compatible with multiarch.
debian/%: data/%.in
	sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@

# Rewrite the scope.ini file to point to the multiarch location.
debian/snappy-store.ini: store/snappy-store.ini
	sed 's|ScopeRunner.*|ScopeRunner = $(STORE_FILE_PATH) --runtime %R --scope %S|g' $< > $@