File: rules

package info (click to toggle)
liblicense 0.8.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 6,428 kB
  • ctags: 868
  • sloc: sh: 9,739; ansic: 8,315; makefile: 859; xml: 178; cpp: 111; ruby: 41; python: 39
file content (84 lines) | stat: -rwxr-xr-x 2,192 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
#!/usr/bin/make -f

PYVERS=$(shell pyversions -vr)
DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
XP=xsltproc -''-nonet

# 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)

%:
	dh $@ --with python2

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

CONFIGURE=../configure --host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		--enable-debug-code \
		--disable-ruby \
		CFLAGS="$(CFLAGS)" \
		LDFLAGS="-Wl,--as-needed -ldl"

# shared library versions, option 1
#version=1.0.0
#major=1
# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
version=`ls src/.libs/lib*.so.* | \
 awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
major=`ls src/.libs/lib*.so.* | \
 awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`

override_dh_auto_configure:
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	cp -f /usr/share/misc/config.guess config.guess
endif
	mkdir build-nopy
	cd build-nopy; \
		$(CONFIGURE) --disable-python; \
		cd ..
	set -e && for x in $(PYVERS); do \
		mkdir build-$$x; \
		cd build-$$x; \
		$(CONFIGURE) PYTHON=/usr/bin/python$$x; \
		cd ..; \
	done


license.1: debian/manpage.xml
	$(XP) $(DB2MAN) $<

override_dh_auto_build: license.1
	$(MAKE) -C build-nopy
	set -e && for x in $(PYVERS); do \
		$(MAKE) -C build-$$x; \
	done

override_dh_auto_install:
	set -e && for x in $(PYVERS); do \
		$(MAKE) -C build-$$x DESTDIR=$(CURDIR)/debian/tmp install; \
	done
	$(MAKE) -C build-nopy DESTDIR=$(CURDIR)/debian/tmp install

override_dh_auto_clean:
	rm -rf build-nopy
	set -e && for x in $(PYVERS); do \
		rm -rf build-$$x; \
	done
	rm -fv config.guess \
		config.sub \
		license.1
	dh_auto_clean