File: rules

package info (click to toggle)
s3ql 2.11.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 2,796 kB
  • sloc: python: 17,094; makefile: 123; sh: 33; ansic: 20
file content (111 lines) | stat: -rwxr-xr-x 3,082 bytes parent folder | download | duplicates (2)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE=1


# NOTE:
# Anyone willing to convert the package to pure debhelper
# (i.e., without dh sequencer) and/or pybuild is very 
# welcome to do so.

%:
	dh $@ --with python3,sphinxdoc

override_dh_auto_build: build-stamp

build-stamp: build_cython build-python build_sphinx
	touch $@

build_cython:
	dh_testdir
	python3 setup.py build_cython
	touch $@

build-python: 
	dh_testdir
	python3-dbg setup.py build -g
	python3 setup.py build -g
	touch $@

build_sphinx:
	dh_testdir
	python3 setup.py build_ext --inplace build_sphinx
	touch $@

override_dh_auto_install: 
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	# Note: Install non -dbg last, so that scripts don't get a -dbg interpreter
	python3-dbg setup.py install --force --root=debian/tmp \
               --install-lib=/usr/lib/s3ql \
               --install-scripts=/usr/lib/s3ql \
               --no-compile -O0 --install-layout=deb

	python3 setup.py install --force --root=debian/tmp \
               --install-lib=/usr/lib/s3ql \
               --install-scripts=/usr/lib/s3ql \
               --no-compile -O0 --install-layout=deb

override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	python3 setup.py build_ext --inplace
	# Some tests will try to create log files in $HOME
	mkdir -p debian/tmphome
	HOME=$(CURDIR)/debian/tmphome py.test-3 tests/
endif

override_dh_install:
	dh_install

	# Rename to avoid conflict with pcp package
	(cd debian/s3ql/usr/share/man/man1/; mv pcp.1 parallel-cp.1)

	# Install debugging extension and remove from regular package
	(cd debian/s3ql; \
	    find . -name "*_d.so" -or \
	           -regextype posix-egrep -regex ".+-[a-z0-9]*d[a-z]*.so" \
	           -printf "%P\0" -delete) \
	| xargs -0 dh_install --autodest -ps3ql-dbg

	# Link all executable files not ending in .py into /usr/bin 
	mkdir -p debian/s3ql/usr/bin/
	for entry in debian/s3ql/usr/lib/s3ql/*; do \
	    if [ -d "$$entry" ] || [ ! -x "$$entry" ] \
               || [ "$${entry%.py}" != "$$entry" ]; then \
               continue; \
            fi; \
            ln -s ../lib/s3ql/`basename "$$entry"` \
                  "debian/s3ql/usr/bin/`basename \"$$entry\"`"; \
        done

override_dh_link:
	rm -rf debian/s3ql-dbg/usr/share/doc/s3ql-dbg
	dh_link


# We don't want to call setup.py clean, because this
# requires a number of (potentially uninstalled) build-dependencies.
override_dh_auto_clean:
	rm -rf build doc tests/test.log src/s3ql/deltadump.c contrib/*.1
	find \( \( -name '*.egg-info' -type d \) \
	     -o \( -name __pycache__  -type d \) \
	     -o \( -name '*.so' -type f \) \
	     \) -prune -exec rm -rf '{}' +
	rm -rf build-python build_cython build_sphinx build-stamp
	rm -rf debian/tmphome

override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
	dh_strip -ps3ql --dbg-package=s3ql-dbg
endif

.PHONY: get-orig-source
get-orig-source:
	# Work around bug #749225
	PERL_LWP_SSL_VERIFY_HOSTNAME=0 \
	uscan --rename --destdir=$(CURDIR) --repack --force-download \
	      --download-current-version