File: rules

package info (click to toggle)
influxdb 1.6.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 11,612 kB
  • sloc: sh: 1,176; python: 809; ruby: 118; makefile: 56
file content (50 lines) | stat: -rwxr-xr-x 2,061 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
#!/usr/bin/make -f
# -*- makefile -*-

DEBIAN_DIR = $(CURDIR)/debian
TMP     = $(DEBIAN_DIR)/$(PACKAGE)
SOURCE = $(TMP)/../

export DH_GOLANG_GO_GENERATE := 1
export DH_GOPKG := github.com/influxdata/influxdb
export DH_GOLANG_INSTALL_EXTRA := query/tmpldata

# Excluding influx-tools just because there are failing go generate commands.
# One of the issue we are running into is that apparently stringer requires
# that packages be installed before it runs. dh-golang currently runs
# go generate before installing any packages. One way to fix this is that
# dh-golang could install all dependencies, run go generate, and then install
# the final package.
export DH_GOLANG_EXCLUDES := tests cmd/influx-tools

%:
	dh $@ --buildsystem=golang --with=golang,systemd --builddirectory=_build

override_dh_auto_configure:
	dh_auto_configure

	# Include tests files
	cp -v $(SOURCE)/stress/stress.toml _build/src/$(DH_GOPKG)/stress/stress.toml
	mkdir -v -p _build/src/$(DH_GOPKG)/stress/v2/iql
	cp -v $(SOURCE)/stress/v2/iql/file.iql _build/src/$(DH_GOPKG)/stress/v2/iql/file.iql
	cp -v $(SOURCE)/stress/v2/iql/default.iql _build/src/$(DH_GOPKG)/stress/v2/iql/default.iql

	# include tmpldata files
	cp -v $(SOURCE)/tsdb/engine/tsm1/*.tmpl* _build/src/$(DH_GOPKG)/tsdb/engine/tsm1
	cp -v $(SOURCE)/query/*.tmpl* _build/src/$(DH_GOPKG)/query
	cp -v $(SOURCE)/services/storage/*.tmpl* _build/src/$(DH_GOPKG)/services/storage
	cp -v $(SOURCE)/pkg/slices/*.tmpl* _build/src/$(DH_GOPKG)/pkg/slices

	# rename some imports
	find _build/src/$(DH_GOPKG) -type f -print0 | xargs -0 sed -i 's|github.com/uber-go/zap|go.uber.org/zap|g'

# influxdb version
DEB_VERSION := $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog --show-field Version)
DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-)
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//' | sed 's/[+~].*$$//')

override_dh_auto_build:
	dh_auto_build -- -ldflags="-X main.version=$(DEB_UPSTREAM_VERSION)"

override_dh_auto_test:
	# I could never get tests working reliably.