summaryrefslogtreecommitdiff
path: root/debian/rules
blob: af4ddef978dcb593886440be9f2ff6d705be1cb4 (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
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
95
96
97
98
99
#!/usr/bin/make -f
# Copyright © 2002,2003 Colin Walters <walters@verbum.org>
# Copyright © 2003 Daniel Stone <daniels@debian.org>
# Copyright © 2006 Sjoerd Simons <sjoerd@debian.org>
# Copyright © 2011 Michael Biebl <biebl@debian.org>

%:
	dh $@ --builddirectory=build --with autoreconf --parallel

libdbusN := $(shell sed -rn 's/Package:[[:space:]]*(libdbus-[0-9-]+)[[:space:]]*$$/\1/p' debian/control | head -n 1)

multiarch := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
cflags := $(shell dpkg-buildflags --get CFLAGS)
ldflags := $(shell dpkg-buildflags --get LDFLAGS)
ldflags += -Wl,--as-needed

include /usr/share/hardening-includes/hardening.make
cflags += $(HARDENING_CFLAGS)
ldflags += $(HARDENING_LDFLAGS)

common_configure_flags := \
		--disable-libaudit \
		--libexecdir=\$${prefix}/lib/dbus-1.0 \
		--htmldir=\$${prefix}/share/doc/dbus \
		--with-systemdsystemunitdir=/lib/systemd/system \
		CFLAGS="$(cflags)" LDFLAGS="$(ldflags)"

override_dh_auto_configure:
	dh_auto_configure \
		-- \
		$(common_configure_flags) \
		--enable-xml-docs \
		--enable-doxygen-docs
	dh_auto_configure \
		--builddirectory=build-debug \
		-- \
		$(common_configure_flags) \
		--disable-xml-docs \
		--disable-doxygen-docs \
		--enable-asserts \
		--enable-checks \
		--enable-tests \
		--enable-verbose-mode \
		--prefix=/usr/lib/$(multiarch)/dbus-1.0/debug-build

override_dh_auto_build:
	dh_auto_build
	dh_auto_build --builddirectory=build-debug
	# work around fd.o #36156
	xsltproc -o build/doc/dbus.devhelp doc/doxygen_to_devhelp.xsl build/doc/api/xml/index.xml

override_dh_auto_test:
	dh_auto_test
	make -C build-debug -k check || echo "Tests failed, ignoring for now"

override_dh_auto_install:
	dh_auto_install
	make -C build-debug install-exec DESTDIR=$(CURDIR)/debian/tmp

override_dh_link:
	dh_link -plibdbus-1-dev lib/$$(basename $$(readlink debian/tmp/usr/lib/libdbus-1.so)) usr/lib/libdbus-1.so
	dh_link --remaining-packages

# jquery.js isn't actually used at the moment, and is an embedded code copy
override_dh_install:
	rm -f debian/tmp/usr/share/doc/dbus/api/jquery.js
	dh_install -Xlibdbus-1.la --list-missing
	install -m 644 -D debian/dbus-Xsession debian/dbus-x11/etc/X11/Xsession.d/75dbus_dbus-launch

override_dh_installinit:
	dh_installinit -pdbus -r -- start 12 2 3 4 5 .

# we don't want docs for the debug symbols, just symlink to the library docs
override_dh_installdocs:
	dh_installdocs -pdbus-1-dbg --link-doc=$(libdbusN)
	dh_installdocs --remaining-packages --all AUTHORS NEWS README

override_dh_strip:
	dh_strip --dbg-package=dbus-1-dbg

override_dh_makeshlibs:
	dh_makeshlibs -V

override_dh_autoreconf:
	mv INSTALL INSTALL.orig
	dh_autoreconf
	mv INSTALL.orig INSTALL

override_dh_autoreconf_clean:
	dh_autoreconf_clean -XINSTALL

override_dh_auto_clean:
	dh_auto_clean
	dh_auto_clean --builddirectory=build-debug
	rm -f build/test/data/valid-config-files/session.conf
	rm -f build/test/data/valid-config-files/system.conf
	rm -f build-debug/test/data/valid-config-files/session.conf
	rm -f build-debug/test/data/valid-config-files/system.conf
	rm -f dbus.devhelp