File: rules

package info (click to toggle)
gearman-interface 0.13.2-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,484 kB
  • ctags: 1,534
  • sloc: sh: 10,756; ansic: 6,769; python: 260; makefile: 126; ruby: 45
file content (71 lines) | stat: -rwxr-xr-x 2,425 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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

export AUTOMAKE = automake-1.11
export ACLOCAL = aclocal-1.11

PYVERS=$(shell pyversions -vs)
PY3VERS=$(shell py3versions -vs)

%:
	dh $@ --with=python2 --with=python3 --with=autoreconf

override_dh_build:: build-python-all build-python3-all

build-python-all: build-swig $(PYVERS:%=build-python%)
	touch $@

build-python3-all: build-swig $(PY3VERS:%=build-python3%)
	touch $@

build-swig:
	dh_build
	touch $@

build-python%:
	cd python && python$* setup.py build
	touch $@

build-python3%:
	cd python3 && python$* setup.py build
	touch $@

override_dh_install:: build $(PYVERS:%=install-python2%) $(PY3VERS:%=install-python3%)
install-python2%:
	cd python && python$* setup.py install --install-layout=deb --root $(CURDIR)/debian/python-gearman.libgearman
	find $(CURDIR)/debian/python-gearman.libgearman -name '__init__.py' -delete

install-python3%:
	cd python3 && python$* setup.py install --install-layout=deb --root $(CURDIR)/debian/python3-gearman.libgearman

override_dh_auto_configure::
	dh_auto_configure -- --without-ruby --without-lua
	# These get rm'd by make clean, but its better this way as
	# There won't be any complaints about ignoring the deletion since we'll rename these back in clean
	[ -f python/libgearman.c.orig ] || [ -f python/libgearman.c ] && mv -f python/libgearman.c python/libgearman.c.orig || true
	[ -f python3/libgearman.c.orig ] || [ -f python3/libgearman.c ] && mv -f python3/libgearman.c python3/libgearman.c.orig || true
	rm -f python/libgearman.c
	rm -f python3/libgearman.c

override_dh_clean::
	dh_clean
	rm -f build-python*
	rm -f build-swig
	rm -rf .deps/
	rm -f python/debian
	rm -rf python/ez_setup.pyc
	rm -rf python/build/
	rm -rf python3/gearman/_libgearman*so
	rm -rf python3/gearman/__pycache__
	rm -rf python/python_libgearman.egg-info/
	rm -rf python3/build/
	[ ! -f python/libgearman.c.orig ] || mv -f python/libgearman.c.orig python/libgearman.c
	[ ! -f python3/libgearman.c.orig ] || mv -f python3/libgearman.c.orig python3/libgearman.c