File: rules

package info (click to toggle)
rclone 1.50.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 27,736 kB
  • sloc: javascript: 8,133; xml: 801; python: 391; sh: 338; makefile: 201
file content (55 lines) | stat: -rwxr-xr-x 1,834 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
#!/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
	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)

# 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); \
	dh_auto_test -- $(EXTRA_TESTFLAGS)