File: rules

package info (click to toggle)
gitaly 16.11.6%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,623,944 kB
  • sloc: cpp: 33,732; java: 20,579; sh: 5,372; cs: 3,973; javascript: 3,426; python: 3,053; makefile: 2,303; ansic: 1,729; php: 1,455; asm: 1,217; xml: 838; ruby: 452; sql: 431; yacc: 22; sed: 1
file content (61 lines) | stat: -rwxr-xr-x 2,793 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
55
56
57
58
59
60
61
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DH_GOLANG_GO_GENERATE := 1
#export DH_GOLANG_INSTALL_ALL := 1  # test data
#export DH_GOLANG_INSTALL_EXTRA := vendor
export DH_RUBY = --gem-install
export DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR = debian/ruby-gitaly
export GEM2DEB_TEST_RUNNER = --check-dependencies
export RAILS_ENV = development # for bundle install --local test
export GITALY_EXECUTABLES = $(addprefix gitlab.com/gitlab-org/gitaly/v16/cmd/,$(notdir $(shell find ${CURDIR}/cmd -mindepth 1 -maxdepth 1 -type d -print)))
# All executables packed inside the Gitaly binary.
export GITALY_PACKED_EXECUTABLES = $(filter %gitaly-hooks %gitaly-git2go %gitaly-ssh %gitaly-lfs-smudge, ${GITALY_EXECUTABLES})

include /usr/share/dpkg/pkg-info.mk
## Set some build variables as per Makefile:
VERSION  ?= $(shell sh -c 'printf "$${1%%+ds*}"' -- "$(DEB_VERSION_UPSTREAM)")
PKG := gitlab.com/gitlab-org/gitaly/v16
MODULE_VERSION := v16
GO_LDFLAGS ?= -X $(PKG)/internal/version.version=$(VERSION) -X $(PKG)/internal/version.moduleVersion=$(MODULE_VERSION)
GO_BUILD_TAGS ?= static,system_libgit2

%:
	dh $@  --buildsystem=golang --with=golang --package=golang-gitlab-gitlab-org-gitaly-dev \
	--builddirectory=_build

override_dh_auto_clean:
	dh_auto_clean -O--buildsystem=golang -O--package=golang-gitlab-gitlab-org-gitaly-dev \
	-O--builddirectory=_build

override_dh_auto_configure:
	dh_auto_configure -O--buildsystem=golang -O--package=golang-gitlab-gitlab-org-gitaly-dev \
	-O--builddirectory=_build

override_dh_auto_build:
	dh_auto_build -O--buildsystem=golang -O--package=golang-gitlab-gitlab-org-gitaly-dev \
	-O--builddirectory=_build -- \
	   -ldflags "$(GO_LDFLAGS)" -tags "$(GO_BUILD_TAGS)" \
           $(GITALY_PACKED_EXECUTABLES)
	mkdir -p _build/src/${PKG}/_build/ && cp -a _build/bin _build/src/${PKG}/_build/
	dh_auto_build -O--buildsystem=golang -O--package=golang-gitlab-gitlab-org-gitaly-dev \
	-O--builddirectory=_build -- \
	   -ldflags "$(GO_LDFLAGS)" -tags "$(GO_BUILD_TAGS)" \
           gitlab.com/gitlab-org/gitaly/${MODULE_VERSION}/cmd/gitaly
	rm -rf _build/src/${PKG}/_build/

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
	# Test hangs, so don't even run it
	#-dh_auto_test -O--buildsystem=golang -O--package=golang-gitlab-gitlab-org-gitaly-dev \
	#-O--builddirectory=_build
endif

override_dh_auto_install:
	dh_auto_install -O--buildsystem=golang -O--package=golang-gitlab-gitlab-org-gitaly-dev \
	-O--no-binaries --builddirectory=_build --destdir=debian/golang-gitlab-gitlab-org-gitaly-dev
	$(RM) -rv debian/golang-gitlab-gitlab-org-gitaly-dev/usr/bin
	# Remove testdata, contains files that triggers more lintian errors
	for f in `find debian/ -name testdata`; do \
		$(RM) -rv $$f; \
	done