File: rules

package info (click to toggle)
graph-tool 2.98%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,324 kB
  • sloc: cpp: 87,937; python: 31,476; makefile: 952; xml: 101; sh: 42
file content (94 lines) | stat: -rwxr-xr-x 2,715 bytes parent folder | download | duplicates (3)
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
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS= hardening=+all optimize=+lto
export DEB_CXXFLAGS_STRIP=-O2

export VERSION_COMMENT=\"(Debian $(DEB_VERSION))\"


DEB_BUILD_MULTIARCH ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)

PY3DOTVERSION=$(shell py3versions -dv)
PY3DOTLESSVERSION=$(shell py3versions -dv | sed -e 's@\.@@')

DEB_PYTHON_VERSION=$(PY3DOTVERSION)
DEB_PYTHON_SITE_PKG=/usr/lib/python$(PY3DOTVERSION)/dist-packages

BUILDDIR=_BUILD

ifeq (ppc64el,$(DEB_HOST_ARCH))
export DEB_CFLAGS_MAINT_APPEND=-mlong-double-80
endif

##ifneq (,$(filter $(DEB_HOST_ARCH), mips64el))
##CPPFLAGS += -mxgot --param ggc-min-expand=10
##endif

MEM_PER_CPU = 13000
NCPUS := $(or $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS))),$(shell nproc))
NJOBS := $(shell awk -vn=$(NCPUS) -vm=$(MEM_PER_CPU) '/^(MemAvail|SwapFree)/ { mt += $$2 } \
  END { n2 = int(mt/1024/m); print (n==1 || n2<=1) ? 1 : (n2<=n ? n2 : n) }' /proc/meminfo)

default:
	@uscan --no-conf --dehs --report || true

%:
	dh $@ --with python3 --builddirectory=$(BUILDDIR)

override_dh_auto_configure:
	## see d/patches/upstream-fix-autotools-automake-doc-missing.patch
	cp -vprd -t doc debian/adhoc/provide/doc/*
	PYTHON_VERSION=$(DEB_PYTHON_VERSION) \
	PYTHON_SITE_PKG=$(DEB_PYTHON_SITE_PKG) \
		dh_auto_configure -- \
			--with-sparsehash-prefix=google \
			--with-boost-python=boost_python$(PY3DOTLESSVERSION)

override_dh_auto_build:
	sh debian/show-mem-swap-nproc
	dh_auto_build --max-parallel=$(NJOBS)

override_dh_auto_test:
	true

override_dh_auto_install:
	dh_auto_install
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	@echo "TEST STARTED" `date -u`
	$(RM) $(BUILDDIR)/test.png
	PYTHONPATH=$(CURDIR)/debian/tmp/$(DEB_PYTHON_SITE_PKG) \
		python3 -c "\
from graph_tool.all import *; \
show_config(); \
g = random_graph(10, lambda: 5, directed=False); \
graph_draw(g, output='$(BUILDDIR)/test.png'); \
"
	@echo "TEST ENDED" `date -u`
endif

override_dh_install:
	dh_install -X.la

execute_after_dh_python3-arch:
	sed -i \
			-e 's|/lib/python'$(DEB_PYTHON_VERSION)'/dist-packages/graph_tool/|/lib/python3/dist-packages/graph_tool/|g' \
			-e 's|-I/usr/include ||g' \
		$(CURDIR)/debian/python3-graph-tool/usr/lib/$(DEB_BUILD_MULTIARCH)/pkgconfig/graph-tool-py$(DEB_PYTHON_VERSION).pc

override_dh_installchangelogs:
	dh_installchangelogs --keep ChangeLog

override_dh_missing:
	dh_missing -X.la --list-missing

override_dh_dwz:
	dh_dwz --no-dwz-multifile -Xlibgraph_tool_core -Xlibgraph_tool_inference

execute_before_dh_gencontrol:
	dh_numpy3

override_dh_clean:
	find debian/adhoc/provide/doc/ -type f | sed 's@debian/adhoc/provide/@@g' | xargs rm -vf
	dh_clean