~dholbach/click-reviewers-tools/modules-module-plus-tests

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Daniel Holbach
  • Date: 2013-09-26 10:42:09 UTC
  • mto: This revision was merged to the branch mainline in revision 72.
  • Revision ID: daniel.holbach@canonical.com-20130926104209-tn29e50y9aczzrss
add packaging

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
# -*- makefile -*-
 
3
 
 
4
# Uncomment this to turn on verbose mode.
 
5
export DH_VERBOSE=1
 
6
 
 
7
%:
 
8
        dh $@ --with python3 --buildsystem pybuild
 
9
 
 
10
PY3REQUESTED := $(shell py3versions -r)
 
11
PY3DEFAULT := $(shell py3versions -d)
 
12
# Run setup.py with the default python3 last so that the scripts use
 
13
# #!/usr/bin/python3 and not #!/usr/bin/python3.X.
 
14
PY3 := $(filter-out $(PY3DEFAULT),$(PY3REQUESTED)) python3
 
15
 
 
16
override_dh_auto_clean:
 
17
        dh_clean
 
18
        rm -rf build *.egg-info .pybuild
 
19
        find -name \*.pyc -print0 | xargs -0r rm -f
 
20
        find -name __pycache__ -print0 | xargs -0r rm -rf
 
21
 
 
22
 
 
23
override_dh_auto_build:
 
24
        dh_auto_build
 
25
        set -ex; for python in $(PY3); do \
 
26
                $$python setup.py build; \
 
27
        done
 
28
 
 
29
override_dh_auto_install:
 
30
        # setuptools likes to leave some debris around, which confuses things.
 
31
        find build -name \*.pyc -print0 | xargs -0r rm -f
 
32
        find build -name __pycache__ -print0 | xargs -0r rm -rf
 
33
        find build -name \*.egg-info -print0 | xargs -0r rm -rf
 
34
        dh_auto_install
 
35
        set -ex; for python in $(PY3); do \
 
36
                $$python setup.py install --install-layout=deb \
 
37
                --root=$(CURDIR)/debian/tmp; \
 
38
        done
 
39
 
 
40
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 
41
override_dh_auto_test:
 
42
        set -ex; for python in $(PY3); do \
 
43
                $$python setup.py test; \
 
44
        done
 
45
endif