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 62
|
#!/usr/bin/make -f
# Do not build the qingstor and mega backends for now, the required
# go packages are not available yet.
export DH_GOLANG_EXCLUDES := backend/qingstor backend/mega
# Also install test data
export DH_GOLANG_INSTALL_EXTRA := \
backend/alias/test \
backend/drive/test \
backend/http/test \
cmd/lsf/testfiles \
cmd/tree/testfiles
export BUILDTESTDIR=$(CURDIR)/buildtest
# some arches need more than 10 min to run TestTestsToRegexpLive
ARCHES_SLOW_TEST := mips64el mipsel
ifneq ($(findstring $(DEB_BUILD_ARCH),$(ARCHES_SLOW_TEST)),)
EXTRA_TESTFLAGS := -timeout 20m
endif
%:
dh $@ --buildsystem=golang --with=golang,bash-completion
# The docs (MANUAL.md, MANUAL.html and rclone.1 manpage) all
# contain information about the download and installation
# of rclone. This is not useful for Debian.
# The solution is a patch for the docs build system, then
# regenerate the docs. See #941209.
override_dh_install:
# Generate MANUAL.md
./bin/make_manual.py
# Generate HTML and manpage
pandoc -s --from markdown --to html MANUAL.md -o MANUAL.html
sed 's|src="https://rclone.org/img/logo_on_light__horizontal_color.svg"|src="logo_on_light__horizontal_color.svg"|g' -i MANUAL.html
pandoc -s --from markdown --to man MANUAL.md -o rclone.1
# Now fix some lexgrog errors in the manpage:
# Remove the only line with .hy on it (near the top of the file)
sed -i -e "/^\.hy/d" rclone.1
# Use a proper NAME section header
sed -i -e "s/^\.SH Rclone/.SH NAME\nRclone \-/" rclone.1
# Finally, replace the first occurence of .PP with a section header
sed -i -e "1,/^\.PP/{s/\.PP/.SH DESCRIPTION/}" rclone.1
dh_install -O--buildsystem=golang
override_dh_auto_clean:
dh_auto_clean
rm -rf $(BUILDTESTDIR)
rm -f MANUAL.md MANUAL.html rclone.1 || /bin/true
# build-time tests for github.com/ncw/rclone/vfs access the config file
# so provide a null config
override_dh_auto_test:
export XDG_CONFIG_HOME=$(BUILDTESTDIR); \
export XDG_CACHE_HOME=$(BUILDTESTDIR); \
export RCLONE_CONFIG="/notfound"; \
dh_auto_test -- $(EXTRA_TESTFLAGS)
override_dh_fixperms:
dh_fixperms
find debian/golang-github-rclone-rclone-dev/usr/share/gocode/src -executable -a -type f | xargs -r chmod a-x
|