File: rules

package info (click to toggle)
redland-bindings 1.0.17.1+dfsg-1.3
  • links: PTS
  • area: main
  • in suites: buster, sid, stretch
  • size: 6,048 kB
  • ctags: 5,466
  • sloc: ansic: 39,669; sh: 11,176; ruby: 2,378; python: 2,310; perl: 2,171; makefile: 430; php: 61
file content (73 lines) | stat: -rwxr-xr-x 2,275 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
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1

# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


# main packaging script based on dh7 syntax
%:
	dh $@ --with python2 --with ruby --with autoreconf --with autotools-dev --fail-missing

export PERL := perl
export RUBY := ruby

# Python versions from constraints in X-Python-Version in debian/control
PYVERS= $(shell pyversions -r)
# Default python
PYDEF= $(shell pyversions -d)

# Perl vendorarch gets dynamic with 5.20
PERL_ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-release \
		--with-perl-makemaker-args="INSTALLDIRS=vendor" \

	for python in $(PYVERS); do \
	  cp -a python $$python; \
	done

override_dh_auto_build:
	dh_auto_build -Dperl
	dh_auto_build -Druby
	for python in $(PYVERS); do \
	  pylib=$$($$python -c 'from distutils import sysconfig; print sysconfig.get_python_lib()'); \
          PYTHON=$$(echo $$python | sed "s/$(PYDEF)/python/"); \
	  PYTHON=$$PYTHON dh_auto_build -D$$python -- pythondir=$$pylib PYTHON_INCLUDES=-I/usr/include/$$python; \
	done

override_dh_auto_clean:
	dh_auto_clean -Dperl
	dh_auto_clean -Dpython
	for python in $(PYVERS); do \
	  rm -rf $$python; \
	done
	dh_auto_clean -Druby
	dh_auto_clean

override_dh_auto_install:
	dh_auto_install -Dperl
	mkdir -p $(CURDIR)/debian/tmp/usr/share/perl5
	mv $(CURDIR)/debian/tmp$(PERL_ARCHLIB)/RDF $(CURDIR)/debian/tmp/usr/share/perl5/RDF

	dh_auto_install -Druby

	for python in $(PYVERS); do \
	  pylib=$$($$python -c 'from distutils import sysconfig; print sysconfig.get_python_lib()'); \
          PYTHON=$$(echo $$python | sed "s/$(PYDEF)/python/"); \
	  PYTHON=$$PYTHON dh_auto_install -D$$python -- pythondir=$$pylib PYTHON_INCLUDES=-I/usr/include/$$python; \
	done