summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 7095ef19605d8e2ab16b63aa272705c759749336 (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
#!/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

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

override_dh_auto_build:
	dh_auto_build
	PYTHONHASHSEED=0 pydoctor --introspect-c-modules --project-name=subvertpy --make-html --docformat=restructuredtext --add-package subvertpy

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