| 1 | #!/usr/bin/make -f |
| 2 | |
| 3 | include /usr/share/dpkg/pkg-info.mk |
| 4 | |
| 5 | %: |
| 6 | dh $@ --builddirectory=debian/_build --buildsystem=golang |
| 7 | |
| 8 | override_dh_auto_test: |
| 9 | # Force Go's new asynchronous timer channel behaviour. dh-golang builds in |
| 10 | # GOPATH mode so the "go 1.25.0" directive from go.mod does not affect the |
| 11 | # default GODEBUG settings. Without this asynctimerchan keeps its legacy |
| 12 | # value of 1 which is rejected by testing/synctest in Go 1.26. |
| 13 | # |
| 14 | # Skip TestMountIndex - requires a working FUSE mount via fusermount |
| 15 | # which is not available in Debian build chroots. |
| 16 | GODEBUG=asynctimerchan=0 \ |
| 17 | dh_auto_test -- -test.skip="^TestMountIndex$$" |
| 18 | |
| 19 | # Trim the CLI sources and the test fixtures from the source shipped in the |
| 20 | # -dev package. Nothing imports github.com/folbricht/desync/cmd/..., and |
| 21 | # testdata/ is ~11MB of binary blobs plus a throwaway TLS CA which are of no |
| 22 | # use to library consumers. |
| 23 | # |
| 24 | # The excludes are scoped to dh_auto_install rather than exported globally: |
| 25 | # DH_GOLANG_EXCLUDES also filters the targets handed to "go install" and |
| 26 | # "go test", so exporting it would stop the desync binary being built and the |
| 27 | # upstream test suite being run. |
| 28 | override_dh_auto_install: |
| 29 | DH_GOLANG_EXCLUDES='^cmd/ (^|/)testdata/' dh_auto_install |
| 30 | |
| 31 | # Generate man page from the --help/--version output with help2man. |
| 32 | ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS))) |
| 33 | execute_after_dh_auto_build: |
| 34 | help2man -N \ |
| 35 | -n "desync" \ |
| 36 | --version-string='$(DEB_VERSION_UPSTREAM)' \ |
| 37 | -o debian/desync.1 \ |
| 38 | debian/_build/bin/desync |
| 39 | endif |