summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 0357ed3cb8160f3c32fac4ab5665c77a5c738f86 (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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
#
# Uncomment this to turn on verbose mode.
#DH_VERBOSE=1

PYTHON2=$(shell pyversions -vr)

%:
	dh $@ --with python2,sphinxdoc --buildsystem=python_distutils

override_dh_prep:
	rst2man docs/man/leap-client.1.rst docs/man/leap-client.1
	dh_prep

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))

# run tests!
#

test-python%:
	xvfb-run ./run_tests.sh -x -N

override_dh_auto_test: $(PYTHON2:%=test-python%) $(PYTHON3:%=test-python%)
endif

#dh_auto_build should be enough to build the python2 version

build-python%:
	python$* setup.py build

#override_dh_auto_build: $(PYTHON3:%=build-python%)
#        dh_auto_build

install-python%:
	python$* setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb

#override_dh_auto_install: $(PYTHON3:%=install-python%)
#        dh_auto_install

override_dh_installchangelogs:
	dh_installchangelogs -k NEWS.rst

# build and install sphinx docs
# 
override_dh_installdocs:
	python setup.py build_sphinx
	dh_installdocs build/sphinx/html

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build
	rm -rf docs/_build 
	rm -rf *.egg-info
	#rm docs/man/leap-client.1