File: rules

package info (click to toggle)
chasquid 1.16.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,744 kB
  • sloc: sh: 1,325; python: 341; makefile: 78
file content (60 lines) | stat: -rwxr-xr-x 1,981 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

# - t-03-queue_persistency is an artifact of dh_golang: there's a .go file with
#   a main in that directory which is used for integration tests, and should
#   not be included or built as part of the Debian package.
# - cmd/dovecot-auth-cli is an internal binary useful for
#   development, but not suited for production use.
# - test/util/ are internal binaries used on tests, but not part of the build.
export DH_GOLANG_EXCLUDES := \
	t-03-queue_persistency \
	cmd/dovecot-auth-cli \
	test/util/

# Include the embedded files.
export DH_GOLANG_INSTALL_EXTRA := \
	internal/nettrace/templates/


BUILDFLAGS := -ldflags \
    " -X main.version=$(DEB_VERSION) \
      -X main.sourceDateTs=$(SOURCE_DATE_EPOCH)"

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

override_dh_auto_build:
	dh_auto_build -- $(BUILDFLAGS)

# No need to install the source files, this is a binary package.
override_dh_auto_install:
	dh_auto_install -- --no-source

# Enable both the service and the sockets (by default only the service will be
# enabled, and that's not enough for our case).
# This is based on openssh's package.
override_dh_installsystemd:
	dh_installsystemd --name chasquid chasquid.service
	dh_installsystemd --name chasquid --no-enable chasquid-smtp.socket
	dh_installsystemd --name chasquid --no-enable \
            chasquid-submission.socket
	dh_installsystemd --name chasquid --no-enable \
            chasquid-submission_tls.socket

override_dh_installchangelogs:
	dh_installchangelogs -k docs/relnotes.md

override_dh_installdocs:
	# Some entries in docs/ are symlinks; replace them with copies so
	# dh_installdocs doesn't leave dangling links.
	cp -r docs/ .tmpdocs/
	cp README.md .tmpdocs/
	( cd .tmpdocs/; for f in `find . -type l`; do \
		cp --remove-destination `readlink $$f` $$f; done )
	dh_installdocs .tmpdocs/*
	rm -r .tmpdocs/

# Don't run dh_dwz, which does not work on Go binaries (for now).
override_dh_dwz: