~ubuntu-branches/ubuntu/saucy/isomd5sum/saucy-proposed

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Ryan Finnie
  • Date: 2012-08-14 04:18:11 UTC
  • mfrom: (1.1.6) (2.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20120814041811-237ybcit9w58ldts
Tags: 1:1.0.9-2
* Switch to debhelper-7-style debian/rules
* debian/control: add XS-Python-Version: all

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
2
# -*- makefile -*-
3
 
# Sample debian/rules that uses debhelper.
4
 
#
5
 
# This file was originally written by Joey Hess and Craig Small.
6
 
# As a special exception, when this file is copied by dh-make into a
7
 
# dh-make output file, you may use that output file without restriction.
8
 
# This special exception was added by Craig Small in version 0.37 of dh-make.
9
3
 
10
4
# Uncomment this to turn on verbose mode.
11
5
#export DH_VERBOSE=1
12
6
 
13
 
# This has to be exported to make some magic below work.
14
 
export DH_OPTIONS
15
 
 
16
7
include /usr/share/python/python.mk
17
8
 
18
 
CFLAGS = -Wall -g
 
9
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
 
10
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) -fPIC
 
11
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
 
12
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
 
13
 
19
14
PYVERS=$(shell pyversions -r)
20
15
 
21
 
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
22
 
        CFLAGS += -O0
23
 
else
24
 
        CFLAGS += -O2
25
 
endif
26
 
 
27
 
build: build-arch build-indep
28
 
build-indep:
29
 
build-arch: build-isomd5sum build-python-pyisomd5sum
30
 
 
31
 
build-isomd5sum: build-isomd5sum-stamp
32
 
build-isomd5sum-stamp:
33
 
        $(MAKE) implantisomd5 checkisomd5
34
 
        touch $@
35
 
 
36
 
build-python-pyisomd5sum: build-python-pyisomd5sum-stamp
37
 
build-python-pyisomd5sum-stamp:
 
16
%:
 
17
        dh $@ --with=python2
 
18
 
 
19
override_dh_auto_build:
 
20
        $(MAKE) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" implantisomd5 checkisomd5
38
21
        set -e; \
39
22
        for python in $(PYVERS); do \
40
 
                $(MAKE) PYTHON=$$python pyisomd5sum.so; \
 
23
                $(MAKE) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS) -I/usr/include/$$python" LDFLAGS="$(LDFLAGS)" \
 
24
                PYTHON=$$python pyisomd5sum.so; \
41
25
                mv pyisomd5sum.so pyisomd5sum.so.$$python; \
42
26
        done
43
 
        touch $@
44
 
 
45
 
clean:
46
 
        dh_testdir
47
 
        dh_testroot
48
 
        rm -f build-isomd5sum-stamp build-python-pyisomd5sum-stamp
49
 
 
 
27
 
 
28
override_dh_auto_clean:
50
29
        set -e; \
51
30
        for python in $(PYVERS); do \
52
31
                rm -f pyisomd5sum.so.$$python; \
53
32
        done
54
33
        $(MAKE) clean
55
 
 
56
34
        dh_clean 
57
35
 
58
 
install: install-arch install-indep
59
 
install-indep:
60
 
install-arch: install-isomd5sum install-python-pyisomd5sum
61
 
        dh_install -s
62
 
 
63
 
install-isomd5sum:
64
 
        dh_testdir
65
 
        dh_testroot
 
36
override_dh_auto_install:
66
37
        $(MAKE) DESTDIR=$(CURDIR)/debian/isomd5sum install-bin
67
 
 
68
 
install-python-pyisomd5sum:
69
 
        dh_testdir
70
 
        dh_testroot
71
 
        dh_installexamples -ppython-pyisomd5sum testpyisomd5sum.py
72
38
        set -e; \
73
39
        for python in $(PYVERS); do \
74
40
                install -m 0755 -d $(CURDIR)/debian/python-pyisomd5sum/usr/lib/$$python/$(call py_sitename_sh, $$python); \
75
41
                install -m 0644 pyisomd5sum.so.$$python $(CURDIR)/debian/python-pyisomd5sum/usr/lib/$$python/$(call py_sitename_sh, $$python)/pyisomd5sum.so; \
76
42
        done
77
 
 
78
 
binary-common:
79
 
        dh_testdir
80
 
        dh_testroot
81
 
        dh_installdocs
82
 
        dh_installman
83
 
        dh_installchangelogs
84
 
        dh_installman
85
 
        dh_link
86
 
        dh_strip
87
 
        dh_compress 
88
 
        dh_fixperms
89
 
        dh_makeshlibs
90
 
        dh_python2
91
 
        dh_installdeb
92
 
        dh_shlibdeps
93
 
        dh_gencontrol
94
 
        dh_md5sums
95
 
        dh_builddeb
96
 
 
97
 
binary-indep:
98
 
binary-arch: binary-isomd5sum
99
 
binary-isomd5sum: build-isomd5sum build-python-pyisomd5sum install-isomd5sum install-python-pyisomd5sum
100
 
        $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
101
 
 
102
 
binary: binary-arch binary-indep
103
 
.PHONY: build clean binary install binary-arch binary-indep build-arch build-indep install-arch install-indep