~mjeanson/+junk/odfpy.packaging

« back to all changes in this revision

Viewing changes to rules

  • Committer: Michael Jeanson
  • Date: 2009-10-08 22:24:06 UTC
  • Revision ID: mjeanson@rlnx.com-20091008222406-ox9awqbiboqgpb8k
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
 
 
3
# Uncomment this to turn on verbose mode.
 
4
#export DH_VERBOSE=1
 
5
 
 
6
PYVERS  := $(shell pyversions -vr)
 
7
PYVER   := $(shell python -c 'import sys; print sys.version[:3]')
 
8
 
 
9
build: build-stamp
 
10
build-stamp: $(PYVERS:%=build-stamp-python%)
 
11
        touch $@
 
12
build-stamp-python%:
 
13
        python$* setup.py build
 
14
        
 
15
        touch $@
 
16
 
 
17
clean:
 
18
        dh_testdir
 
19
        dh_testroot
 
20
        rm -f *-stamp*
 
21
        find -name '*.py[co]' -exec rm -f {} \;
 
22
        dh_clean
 
23
 
 
24
install: build install-prereq $(PYVERS:%=install-python%)
 
25
        dh_installdocs
 
26
        dh_installexamples 
 
27
 
 
28
        : # Replace all '#!' calls to python with /usr/bin/python
 
29
        : # and make them executable
 
30
        for i in `find debian -mindepth 3 -type f`; do \
 
31
          sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1,' \
 
32
                $$i > $$i.temp; \
 
33
          if cmp --quiet $$i $$i.temp; then \
 
34
            rm -f $$i.temp; \
 
35
          else \
 
36
            mv -f $$i.temp $$i; \
 
37
            chmod 755 $$i; \
 
38
            echo "fixed interpreter: $$i"; \
 
39
          fi; \
 
40
        done
 
41
 
 
42
install-prereq:
 
43
        dh_testdir
 
44
        dh_testroot
 
45
        dh_clean -k
 
46
 
 
47
install-python%:
 
48
        python$* setup.py install --root $(CURDIR)/debian/python-odfpy
 
49
 
 
50
# Build architecture-independent files here.
 
51
# Pass -i to all debhelper commands in this target to reduce clutter.
 
52
binary-indep: build install
 
53
        dh_testdir -i
 
54
        dh_testroot -i
 
55
#       dh_installdebconf -i
 
56
        dh_installdocs -i
 
57
        dh_installexamples -i
 
58
#       dh_installmenu -i
 
59
#       dh_installman -i
 
60
#       dh_installinfo -i
 
61
#       dh_undocumented -i
 
62
#       dh_installchangelogs -i CHANGES
 
63
        dh_pycentral -i
 
64
        dh_link -i
 
65
        dh_compress -i -X.py
 
66
        dh_fixperms -i
 
67
        dh_installdeb -i
 
68
        dh_gencontrol -i
 
69
        dh_md5sums -i
 
70
        dh_builddeb -i
 
71
 
 
72
binary-arch:
 
73
 
 
74
binary: binary-indep
 
75
.PHONY: build clean binary-indep binary-arch binary install