summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: 6d9ed87c53561e612f70723c4cd13d3ff81db507 (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
52
53
54
55
56
#!/usr/bin/make -f
SHELL = /bin/sh -e

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -g -Wall
export DPKG_GENSYMBOLS_CHECK_LEVEL = 4

# Fast version of dpkg/architecture.mk defining all vars in one go
ifeq (${DEB_HOST_MULTIARCH},)
   $(foreach d, $(shell dpkg-architecture | sed 's/=/?=/'), $(eval export $d))
endif
include /usr/share/dpkg/buildflags.mk
V := $(if $(filter terse, ${DEB_BUILD_OPTIONS}),,1)
WAF := PYTHONHASHSEED=1 ./buildtools/bin/waf \
	$(patsubst parallel=%,-j%,$(filter parallel=%,${DEB_BUILD_OPTIONS}))

DESTDIR = ${CURDIR}/debian/tmp

build-arch build-indep build \
install-indep install-arch install \
binary-arch binary-indep binary \
: %:
	dh $@

override_dh_auto_configure: bin/config-stamp
bin/config-stamp:
	CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
	    ${WAF} -j1 -C configure \
		--prefix=/usr \
		--libdir=/usr/lib/${DEB_HOST_MULTIARCH} \
		--disable-rpath --disable-rpath-install \
		--bundled-libraries=NONE \
		--disable-python \
	    && touch $@

override_dh_auto_build: bin/config-stamp
	${WAF} build $(if $V,-v)
	# Waf should be doing this..
	ar cr bin/libtevent.a bin/default/*.o

override_dh_auto_test:
ifeq (,$(filter nocheck,${DEB_BUILD_OPTIONS}))
# for some weird reason, salsa-ci run build with fd#0 *closed*(!) and the test fail
	${WAF} test </dev/null
endif

override_dh_auto_install:
	${WAF} install --destdir=${DESTDIR}
	cp bin/libtevent.a ${DESTDIR}/usr/lib/${DEB_HOST_MULTIARCH}

clean:
	# see also debian/clean
	dh_clean bin/ compile_commands.json

get-packaged-orig-source:
	./debian/build-orig.sh