summaryrefslogtreecommitdiffstats
path: root/rules/dbus.make
blob: 173be794395400f0e626913dc0889b1084efc850 (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# -*-makefile-*-
#
# Copyright (C) 2006 by Roland Hostettler
#               2008, 2009 by Marc Kleine-Budde <mkl@pengutronix.de>
#               2010 Tim Sander <tim.sander@hbm.com>
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_DBUS) += dbus

#
# Paths and names
#
DBUS_VERSION	:= 1.4.10
DBUS_MD5	:= 402a2f8102bedbe236e2891b2b0f31c2
DBUS		:= dbus-$(DBUS_VERSION)
DBUS_SUFFIX	:= tar.gz
DBUS_URL	:= http://dbus.freedesktop.org/releases/dbus/$(DBUS).$(DBUS_SUFFIX)
DBUS_SOURCE	:= $(SRCDIR)/$(DBUS).$(DBUS_SUFFIX)
DBUS_DIR	:= $(BUILDDIR)/$(DBUS)
DBUS_LICENSE	:= AFLv2.1, GPLv2+

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

$(DBUS_SOURCE):
	@$(call targetinfo)
	@$(call get, DBUS)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

DBUS_PATH := PATH=$(CROSS_PATH)
DBUS_ENV := $(CROSS_ENV)

#
# autoconf
#
DBUS_AUTOCONF := \
	$(CROSS_AUTOCONF_USR) \
	--enable-silent-rules \
	--disable-tests \
	--disable-ansi \
	--disable-verbose-mode \
	--disable-asserts \
	--disable-checks \
	--disable-xml-docs \
	--disable-doxygen-docs \
	--disable-compiler-coverage \
	--enable-abstract-sockets=yes \
	--disable-libaudit \
	--disable-dnotify \
	--disable-inotify \
	--disable-kqueue \
	--disable-console-owner-file \
	--disable-userdb-cache \
	--with-dbus-user=$(PTXCONF_DBUS_USER)

ifdef PTXCONF_DBUS_XML_EXPAT
DBUS_AUTOCONF += --with-xml=expat
endif
ifdef PTXCONF_DBUS_XML_LIBXML2
DBUS_AUTOCONF += --with-xml=libxml
endif

ifdef PTXCONF_DBUS_SELINUX
DBUS_AUTOCONF += --enable-selinux
else
DBUS_AUTOCONF += --disable-selinux
endif

ifdef PTXCONF_DBUS_X
DBUS_AUTOCONF += --with-x=$(SYSROOT)/usr
else
DBUS_AUTOCONF += --without-x
endif

ifdef PTXCONF_DBUS_SYSTEMD_UNIT
DBUS_AUTOCONF += --with-systemdsystemunitdir=/lib/systemd/system
else
DBUS_AUTOCONF += --without-systemdsystemunitdir
endif

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

$(STATEDIR)/dbus.targetinstall:
	@$(call targetinfo)

	@$(call install_init, dbus)
	@$(call install_fixup, dbus,PRIORITY,optional)
	@$(call install_fixup, dbus,SECTION,base)
	@$(call install_fixup, dbus,AUTHOR,"Roland Hostettler <r.hostettler@gmx.ch>")
	@$(call install_fixup, dbus,DESCRIPTION,missing)

	@$(call install_copy, dbus, 0, 0, 0755, -, \
		/usr/bin/dbus-daemon)
	@$(call install_copy, dbus, 0, 0, 0755, -, \
		/usr/bin/dbus-cleanup-sockets)
	@$(call install_copy, dbus, 0, 0, 0755, -, \
		/usr/bin/dbus-launch)
	@$(call install_copy, dbus, 0, 0, 0755, -, \
		/usr/bin/dbus-monitor)
	@$(call install_copy, dbus, 0, 0, 0755, -, \
		/usr/bin/dbus-send)
	@$(call install_copy, dbus, 0, 0, 0755, -, \
		/usr/bin/dbus-uuidgen)
	@$(call install_copy, dbus, 0, 104, 4754, -, \
		/usr/libexec/dbus-daemon-launch-helper)

	@$(call install_lib, dbus, 0, 0, 0644, libdbus-1)

	@$(call install_alternative, dbus, 0, 0, 0755, \
		/etc/rc.once.d/dbus)

#	#
#	# create system.d and event.d directories, which are used by the configuration and startup files
#	#
	@$(call install_copy, dbus, 0, 0, 0755, /etc/dbus-1/system.d/)
	@$(call install_copy, dbus, 0, 0, 0755, /etc/dbus-1/event.d/)

#	#
#	# create session.d directory, which is needed to launch a session bus
#	#
	@$(call install_copy, dbus, 0, 0, 0755, /etc/dbus-1/session.d/)

#	#
#	# install /etc/dbus-1/system.conf config file
#	#
ifdef PTXCONF_DBUS_SYSTEM_CONF
	@$(call install_alternative, dbus, 0, 0, 0644, /etc/dbus-1/system.conf)
	@$(call install_replace, dbus, /etc/dbus-1/system.conf, @DBUS_USER@, $(PTXCONF_DBUS_USER))
endif

#	#
#	# instal /etc/dbus-1/session.conf config file
#	#
ifdef PTXCONF_DBUS_SESSION_CONF
	@$(call install_alternative, dbus, 0, 0, 0644, /etc/dbus-1/session.conf)
endif

#	#
#	# busybox init: start script
#	#

ifdef PTXCONF_INITMETHOD_BBINIT
ifdef PTXCONF_DBUS_STARTSCRIPT
	@$(call install_alternative, dbus, 0, 0, 0755, /etc/init.d/dbus)

ifneq ($(call remove_quotes,$(PTXCONF_DBUS_BBINIT_LINK)),)
	@$(call install_link, dbus, \
		../init.d/dbus, \
		/etc/rc.d/$(PTXCONF_DBUS_BBINIT_LINK))
endif
endif
endif
ifdef PTXCONF_DBUS_SYSTEMD_UNIT
	@$(call install_copy, dbus, 0, 0, 0644, -, \
		/lib/systemd/system/dbus.socket)
	@$(call install_link, dbus, ../dbus.socket, \
		/lib/systemd/system/sockets.target.wants/dbus.socket)
	@$(call install_link, dbus, ../dbus.socket, \
		/lib/systemd/system/dbus.target.wants/dbus.socket)

	@$(call install_copy, dbus, 0, 0, 0644, -, \
		/lib/systemd/system/dbus.service)
	@$(call install_link, dbus, ../dbus.service, \
		/lib/systemd/system/multi-user.target.wants/dbus.service)
endif

ifdef PTXCONF_INITMETHOD_UPSTART
ifdef PTXCONF_DBUS_STARTSCRIPT
	@$(call install_alternative, dbus, 0, 0, 0644, /etc/init/dbus.conf)
endif
endif

	@$(call install_finish, dbus)

	@$(call touch)

# vim: syntax=make