File: rules

package info (click to toggle)
python-omniorb 4.2.2-0.2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,464 kB
  • sloc: cpp: 15,517; python: 11,020; sh: 2,576; makefile: 106
file content (132 lines) | stat: -rwxr-xr-x 3,325 bytes parent folder | download
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode. 
#export DH_VERBOSE=1

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  confflags += --build $(DEB_HOST_GNU_TYPE)
else
  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

# CFLAGS is not honoured by the omniORB build system.
CC  ?= gcc
CXX ?= g++

ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  CC  += -O2
  CXX += -O2
endif

PYVERS := $(shell pyversions -vr debian/control)

CONFIGURE = \
	CC="$(CC)" CXX="$(CXX)" ../configure $(confflags) \
		--prefix=/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		--with-omniorb=/usr \
		--with-openssl=/usr

autotools-update-stamp:
	cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub bin/scripts
	touch $@

build-%/config.status: autotools-update-stamp
	dh_testdir
	-mkdir build-$*
	cd build-$* && $(CONFIGURE) PYTHON=/usr/bin/python$*

dbg-build-%/config.status: autotools-update-stamp
	dh_testdir
	-mkdir build-dbg-$*
	cd build-dbg-$* && $(CONFIGURE) PYTHON=/usr/bin/python$*-dbg

build: build-arch build-indep
build-arch:	build-stamp
build-indep: build-stamp
build-stamp: $(PYVERS:%=build-stamp-%) $(PYVERS:%=build-dbg-stamp-%)
	touch $@

build-stamp-%: build-%/config.status
	dh_testdir
	$(MAKE) -C build-$*
	touch $@

build-dbg-stamp-%: dbg-build-%/config.status
	dh_testdir
	$(MAKE) -C build-dbg-$*
	touch $@

clean:
	dh_testdir
	dh_testroot
	-rm -rf build*
	-rm -f *-stamp
	find . -name "*.pyc" -delete
	-rm bin/scripts/config.guess bin/scripts/config.sub
	rm -rf debian/tmp-dbg
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	set -e; \
	for v in $(PYVERS); do \
	  echo "================ $$v ==================="; \
	  $(MAKE) -C build-dbg-$$v install DESTDIR=$(CURDIR)/debian/tmp-dbg; \
	  echo "================ $$v ==================="; \
	  $(MAKE) -C build-$$v install DESTDIR=$(CURDIR)/debian/tmp; \
	done
	find . -name "*.pyc" -exec rm {} \;
	find debian/tmp* -name '_omni*.so*'
	for i in $$(find debian/tmp-dbg -name '_omni*._d.so*'); do \
	  echo "Renaming $$i ..."; \
	  dst=$$(echo $$i | sed 's,tmp-dbg,tmp,;s/\._d\.so/_d.so/'); \
	  mv $$i $$dst; \
	done
	find debian/tmp -name '_omni*.so*'
	dh_install --sourcedir=debian/tmp
	dh_missing --list-missing

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installexamples -i
	dh_installchangelogs update.log -i
	dh_python2 -i
	dh_link -i
	dh_compress -i -X.pdf
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a
	dh_installchangelogs update.log -a
	dh_python2 -a
	dh_strip -ppython-omniorb --dbg-package=python-omniorb-dbg
	dh_link -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure