~ubuntu-branches/ubuntu/raring/pyicu/raring-proposed

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-05-15 15:38:16 UTC
  • Revision ID: package-import@ubuntu.com-20120515153816-fzp4jn0h3kk9c9id
Tags: 1.3-1ubuntu1
* Add Python 3 packages (see Debian #671361; uploading in advance of
  Debian in order to be able to complete a port of ubiquity).
* Replace ICUtzinfo-not-heap-type.dpatch with upstream r191, which
  restores Python 3 compatibility.
* Drop manual cleaning of python-pyicu-dbg, since dh_python2 handles this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#export DH_VERBOSE=1
5
5
 
6
6
PKGNAME:=python-pyicu
 
7
PKG3NAME=python3-pyicu
7
8
PYVERS:=$(shell pyversions -vr)
 
9
PY3VERS:=$(shell py3versions -vr)
8
10
 
9
11
-include /usr/share/python/python.mk
10
12
ifeq (,$(py_sitename))
21
23
build-stamp:
22
24
        dh_testdir
23
25
 
 
26
        # setup.py modifies test source files when building for Python 3, so
 
27
        # build out of tree.
 
28
        rm -rf build-py2 build-py3
 
29
        mkdir -p build-py2 build-py3
 
30
        cp -a $(filter-out build-py2 build-py3 debian,$(wildcard *)) build-py2/
 
31
        cp -a $(filter-out build-py2 build-py3 debian,$(wildcard *)) build-py3/
 
32
 
24
33
        set -e; \
25
 
        for py in $(PYVERS); do  \
 
34
        for py in $(PYVERS) $(PY3VERS); do  \
 
35
            (cd build-py$${py%%.*}; \
26
36
            python$$py setup.py build; \
27
 
            python$$py-dbg setup.py build; \
 
37
            python$$py-dbg setup.py build); \
28
38
        done
29
39
 
30
40
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
31
41
        set -ex ;\
32
42
        for test in `ls test/*.py`; do \
33
 
          for py in $(PYVERS); do  \
34
 
            PYTHONPATH=`ls -d $(CURDIR)/build/lib.*-$$py` \
 
43
          for py in $(PYVERS) $(PY3VERS); do  \
 
44
            (cd build-py$${py%%.*}; \
 
45
            PYTHONPATH=`ls -d $$(pwd)/build/lib.*-$$py` \
35
46
              python$$py $$test ;\
36
 
            PYTHONPATH=`ls -d $(CURDIR)/build/lib_d.*-$$py || ls -d $(CURDIR)/build/lib.*-$$py-pydebug` \
37
 
              python$$py-dbg $$test ;\
 
47
            PYTHONPATH=`ls -d $$(pwd)/build/lib_d.*-$$py || ls -d $$(pwd)/build/lib.*-$$py-pydebug` \
 
48
              python$$py-dbg $$test) ;\
38
49
          done ;\
39
50
        done
40
51
endif
46
57
        dh_testdir
47
58
        dh_testroot
48
59
        rm -f install-stamp build-stamp
49
 
        -for py in $(PYVERS); do  \
50
 
            python$$py setup.py clean; \
51
 
        done
52
60
        find . -name "*.pyc" -print0 | xargs -0 rm -f
53
 
        rm -rf build
 
61
        find . -name __pycache__ -print0 | xargs -0 rm -rf
 
62
        rm -rf build-py2 build-py3
54
63
        dh_clean 
55
64
 
56
65
install: install-stamp
61
70
        dh_installdirs
62
71
        set -e; \
63
72
        for py in $(PYVERS); do  \
 
73
            (cd build-py2; \
64
74
            python$$py setup.py install --root=$(CURDIR)/debian/$(PKGNAME) --prefix=/usr $(py_setup_install_args) ;\
65
 
            python$$py-dbg setup.py install --root=$(CURDIR)/debian/$(PKGNAME)-dbg --prefix=/usr $(py_setup_install_args) ;\
66
 
        done
67
 
        find $(CURDIR)/debian/$(PKGNAME)-dbg -name "*.pyc" -print0 | xargs -0 rm -f
68
 
        find $(CURDIR)/debian/$(PKGNAME)-dbg -name "*.py" -print0 | xargs -0 rm -f
69
 
        find $(CURDIR)/debian/$(PKGNAME)-dbg -name "*.egg-info" -print0 | xargs -0 rm -f
 
75
            python$$py-dbg setup.py install --root=$(CURDIR)/debian/$(PKGNAME)-dbg --prefix=/usr $(py_setup_install_args)) ;\
 
76
        done
 
77
        for py in $(PY3VERS); do  \
 
78
            (cd build-py3; \
 
79
            python$$py setup.py install --root=$(CURDIR)/debian/$(PKG3NAME) --prefix=/usr $(py_setup_install_args) ;\
 
80
            python$$py-dbg setup.py install --root=$(CURDIR)/debian/$(PKG3NAME)-dbg --prefix=/usr $(py_setup_install_args)) ;\
 
81
        done
70
82
 
71
83
        dh_installdocs
72
84
        dh_installexamples
81
93
        dh_installchangelogs CHANGES
82
94
        dh_compress -X.py
83
95
        dh_strip -p$(PKGNAME) --dbg-package=$(PKGNAME)-dbg
 
96
        dh_strip -p$(PKG3NAME) --dbg-package=$(PKG3NAME)-dbg
84
97
        dh_fixperms
85
98
        dh_python2
 
99
        dh_python3
86
100
        rm -rf debian/$(PKGNAME)-dbg/usr/share/doc/$(PKGNAME)-dbg
87
101
        ln -s $(PKGNAME) debian/$(PKGNAME)-dbg/usr/share/doc/$(PKGNAME)-dbg
 
102
        rm -rf debian/$(PKG3NAME)-dbg/usr/share/doc/$(PKG3NAME)-dbg
 
103
        ln -s $(PKG3NAME) debian/$(PKG3NAME)-dbg/usr/share/doc/$(PKG3NAME)-dbg
88
104
        dh_installdeb
89
105
        dh_shlibdeps
90
106
        dh_gencontrol