summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 0f17915217ee96e77e92dbda56eed147f3a9e056 (plain)
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
#!/usr/bin/make -f

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

# Get the supported Python versions
PYVERS = $(shell pyversions -r -v)
PY3VERS = $(shell py3versions -r -v)

# Callable functions to determine the correct PYTHONPATH
pythonpath = $$(ls -d $(CURDIR)/build/lib.*-$(1))

export PYBUILD_NAME=subvertpy
export HOME=$(CURDIR)/nonexistent

export PYTHONPATH = debian/fake-python-path

%:
	CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
	LDFLAGS="$(LDFLAGS)" dh $* --with python2,python3 --buildsystem=pybuild

override_dh_auto_configure:
	mkdir -p debian/fake-python-path
	[ ! -d /usr/lib/python2.7/dist-packages/cachecontrol ] && \
	[ -d /usr/lib/python3/dist-packages/cachecontrol ] && \
	ln -s /usr/lib/python3/dist-packages/cachecontrol debian/fake-python-path/cachecontrol || \
	true
	dh_auto_configure

override_dh_auto_build:
	dh_auto_build
	PYTHONHASHSEED=0 $(MAKE) pydoctor

override_dh_auto_install:
	dh_auto_install
	mkdir -p debian/python3-subvertpy/usr/share/doc/python3-subvertpy \
	         debian/python-subvertpy/usr/share/doc/python-subvertpy
	cp -a apidocs debian/python-subvertpy/usr/share/doc/python-subvertpy/api
	cp -a apidocs debian/python3-subvertpy/usr/share/doc/python3-subvertpy/api
	mv debian/python3-subvertpy/usr/bin/subvertpy-fast-export \
	   debian/python3-subvertpy/usr/bin/subvertpy3-fast-export
	mv debian/python-subvertpy/usr/bin/subvertpy-fast-export \
	   debian/python-subvertpy/usr/bin/subvertpy2-fast-export

override_dh_strip:
	dh_strip -p python-subvertpy --dbgsym-migration='python-subvertpy-dbg (<< 0.9.3-1)'
	dh_strip -p python3-subvertpy