summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: cf33004dfe1d33f488cfab2c62d2b964f12c443e (plain)
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
63
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@ --with python2,python3,sphinxdoc

override_dh_auto_build:
	set -ex; for python in $$(py3versions -r); do \
		$$python setup.py build; \
	done
	dh_auto_build

override_dh_auto_install:
	set -ex; for python in $$(py3versions -r); do \
		$$python setup.py install --root=$$(pwd)/debian/tmp \
			--install-layout=deb; \
	done
	dh_auto_install

override_dh_installdocs:
	python setup.py build_sphinx
	dh_installdocs

override_dh_compress:
	dh_compress -X.rst

override_dh_auto_clean:
	dh_auto_clean
	rm -Rf build/ docs/_build/ *.egg-info/

get-orig-source:
	uscan --noconf --verbose --rename --force-download \
		--download-current-version

unpack-orig-source: get-orig-source
	# Remove currently unpacked source.
	for f in * .[!.] .??*; do \
		if [ -e $${f} ] && [ $${f} != debian ] && \
				[ $${f} != .gitignore ]; then \
			rm -Rf $${f}; \
		fi; \
	done
	# Unpack source archive.
	set -e; \
	source=$$(dpkg-parsechangelog | sed -n 's/^Source: //p'); \
	version=$$(dpkg-parsechangelog | \
		sed -n 's/^Version: \([^-]*\).*$$/\1/p'); \
	tar -xzf ../$${source}_$${version}.orig.tar.gz
	# Find directory containing unpacked source files.  Move source files
	# into the top-level directory.
	set -e; \
	for f in */ .[!.]/ .??*/; do \
		if [ -d $${f} ] && [ $${f} != debian ]; then \
			for ff in $${f}/* $${f}/.[!.] $${f}/.??*; do \
				if [ -e $${ff} ]; then \
					mv $${ff} .; \
				fi; \
			done; \
			rmdir $${f}/; \
		fi; \
	done