| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/pkg-info.mk |
| 4 |
|
| 5 |
# - t-03-queue_persistency is an artifact of dh_golang: there's a .go file with |
| 6 |
# a main in that directory which is used for integration tests, and should |
| 7 |
# not be included or built as part of the Debian package. |
| 8 |
# - cmd/dovecot-auth-cli is an internal binary useful for |
| 9 |
# development, but not suited for production use. |
| 10 |
# - test/util/ are internal binaries used on tests, but not part of the build. |
| 11 |
export DH_GOLANG_EXCLUDES := \ |
| 12 |
t-03-queue_persistency \ |
| 13 |
cmd/dovecot-auth-cli \ |
| 14 |
test/util/ |
| 15 |
|
| 16 |
# Include the embedded files. |
| 17 |
export DH_GOLANG_INSTALL_EXTRA := \ |
| 18 |
internal/nettrace/templates/ |
| 19 |
|
| 20 |
|
| 21 |
BUILDFLAGS := -ldflags \ |
| 22 |
" -X main.version=$(DEB_VERSION) \ |
| 23 |
-X main.sourceDateTs=$(SOURCE_DATE_EPOCH)" |
| 24 |
|
| 25 |
%: |
| 26 |
dh $@ --buildsystem=golang --with=golang |
| 27 |
|
| 28 |
override_dh_auto_build: |
| 29 |
dh_auto_build -- $(BUILDFLAGS) |
| 30 |
|
| 31 |
# No need to install the source files, this is a binary package. |
| 32 |
override_dh_auto_install: |
| 33 |
dh_auto_install -- --no-source |
| 34 |
|
| 35 |
# Enable both the service and the sockets (by default only the service will be |
| 36 |
# enabled, and that's not enough for our case). |
| 37 |
# This is based on openssh's package. |
| 38 |
override_dh_installsystemd: |
| 39 |
dh_installsystemd --name chasquid chasquid.service |
| 40 |
dh_installsystemd --name chasquid --no-enable chasquid-smtp.socket |
| 41 |
dh_installsystemd --name chasquid --no-enable \ |
| 42 |
chasquid-submission.socket |
| 43 |
dh_installsystemd --name chasquid --no-enable \ |
| 44 |
chasquid-submission_tls.socket |
| 45 |
|
| 46 |
override_dh_installchangelogs: |
| 47 |
dh_installchangelogs -k docs/relnotes.md |
| 48 |
|
| 49 |
override_dh_installdocs: |
| 50 |
# Some entries in docs/ are symlinks; replace them with copies so |
| 51 |
# dh_installdocs doesn't leave dangling links. |
| 52 |
cp -r docs/ .tmpdocs/ |
| 53 |
cp README.md .tmpdocs/ |
| 54 |
( cd .tmpdocs/; for f in `find . -type l`; do \ |
| 55 |
cp --remove-destination `readlink $$f` $$f; done ) |
| 56 |
dh_installdocs .tmpdocs/* |
| 57 |
rm -r .tmpdocs/ |
| 58 |
|
| 59 |
# Don't run dh_dwz, which does not work on Go binaries (for now). |
| 60 |
override_dh_dwz: |