commit: b45cf2cef04aa3ed96828848b61664560aad1e08
Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 18 08:37:45 2014 +0000
Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Tue Nov 18 08:37:45 2014 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/betagarden.git;a=commit;h=b45cf2ce
sys-apps/dbus: Import tree changes
Package-Manager: portage-2.2.14
---
sys-apps/dbus/ChangeLog | 8 +
sys-apps/dbus/dbus-9999.ebuild | 226 ++++++++++++++--------
sys-apps/dbus/files/80-dbus | 13 ++
sys-apps/dbus/files/{dbus.init-1.0 => dbus.initd} | 9 +-
4 files changed, 174 insertions(+), 82 deletions(-)
diff --git a/sys-apps/dbus/ChangeLog b/sys-apps/dbus/ChangeLog
new file mode 100644
index 0000000..fd5332c
--- /dev/null
+++ b/sys-apps/dbus/ChangeLog
@@ -0,0 +1,8 @@
+# ChangeLog for sys-apps/dbus
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+ 18 Nov 2014; Justin Lecher <[email protected]> dbus-9999.ebuild,
+ +files/80-dbus, -files/dbus.init-1.0, +files/dbus.initd:
+ Import tree changes
+
diff --git a/sys-apps/dbus/dbus-9999.ebuild b/sys-apps/dbus/dbus-9999.ebuild
index 05f0316..15b9c5b 100644
--- a/sys-apps/dbus/dbus-9999.ebuild
+++ b/sys-apps/dbus/dbus-9999.ebuild
@@ -1,42 +1,47 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
-EAPI=4
-inherit autotools eutils multilib flag-o-matic python systemd virtualx git-2
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+inherit autotools eutils git-r3 linux-info flag-o-matic multilib-minimal
python-any-r1 systemd virtualx user
DESCRIPTION="A message bus system, a simple way for applications to talk to
each other"
HOMEPAGE="http://dbus.freedesktop.org/"
+SRC_URI=""
EGIT_REPO_URI="git://anongit.freedesktop.org/${PN}/${PN}"
-LICENSE="|| ( GPL-2 AFL-2.1 )"
+LICENSE="|| ( AFL-2.1 GPL-2 )"
SLOT="0"
KEYWORDS=""
-IUSE="debug doc selinux static-libs test X"
+IUSE="debug doc selinux static-libs systemd test X"
-RDEPEND=">=dev-libs/expat-2
+CDEPEND=">=dev-libs/expat-2
selinux? (
- sec-policy/selinux-dbus
sys-libs/libselinux
)
+ systemd? ( sys-apps/systemd:0= )
X? (
x11-libs/libX11
x11-libs/libXt
- )"
-DEPEND="${RDEPEND}
- virtual/pkgconfig
- doc? (
- app-doc/doxygen
- app-text/docbook-xml-dtd:4.1.2
- app-text/xmlto
)
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${CDEPEND}
+ app-text/xmlto
+ app-text/docbook-xml-dtd:4.4
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
test? (
>=dev-libs/glib-2.24
- dev-lang/python:2.7
+ ${PYTHON_DEPS}
)"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-dbus )
+"
-# out of sources build directory
-BD=${WORKDIR}/${P}-build
# out of sources build dir for make check
TBD=${WORKDIR}/${P}-tests-build
@@ -44,10 +49,11 @@ pkg_setup() {
enewgroup messagebus
enewuser messagebus -1 -1 -1 messagebus
- # FIXME: Test suite fails with Python 3.2 (last checked: 1.4.20)
- if use test; then
- python_set_active_version 2
- python_pkg_setup
+ use test && python-any-r1_pkg_setup
+
+ if use kernel_linux; then
+ CONFIG_CHECK="~EPOLL"
+ linux-info_pkg_setup
fi
}
@@ -58,77 +64,108 @@ src_prepare() {
-e '/"dispatch"/d' \
bus/test-main.c || die
- # epatch "${FILESDIR}"/${PN}-1.4.0-asneeded.patch
+ epatch_user
# required for asneeded patch but also for bug 263909, cross-compile so
# don't remove eautoreconf
eautoreconf
}
-src_configure() {
- local myconf
+multilib_src_configure() {
+ local docconf myconf
# so we can get backtraces from apps
- append-flags -rdynamic
+ case ${CHOST} in
+ *-mingw*)
+ # error: unrecognized command line option '-rdynamic'
wrt #488036
+ ;;
+ *)
+ append-flags -rdynamic
+ ;;
+ esac
# libaudit is *only* used in DBus wrt SELinux support, so disable it, if
# not on an SELinux profile.
myconf=(
+ --localstatedir="${EPREFIX}/var"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
+ $(use_enable static-libs static)
+ $(use_enable debug verbose-mode)
--disable-asserts
--disable-checks
- --disable-embedded-tests
- --disable-modular-tests
- $(use_with X x)
- $(use_enable debug verbose-mode)
- $(use_enable kernel_linux inotify)
- $(use_enable kernel_FreeBSD kqueue)
$(use_enable selinux)
$(use_enable selinux libaudit)
- $(use_enable static-libs static)
- --enable-shared
- --with-xml=expat
- --with-system-pid-file=/var/run/dbus.pid
- --with-system-socket=/var/run/dbus/system_bus_socket
- --with-session-socket-dir=/tmp
+ $(use_enable kernel_linux inotify)
+ $(use_enable kernel_FreeBSD kqueue)
+ $(use_enable systemd)
+ --disable-embedded-tests
+ --disable-modular-tests
+ $(use_enable debug stats)
+ --with-session-socket-dir="${EPREFIX}"/tmp
+ --with-system-pid-file="${EPREFIX}"/var/run/dbus.pid
+ --with-system-socket="${EPREFIX}"/var/run/dbus/system_bus_socket
--with-dbus-user=messagebus
+ $(use_with X x)
"$(systemd_with_unitdir)"
- --localstatedir=/var
- --docdir=/usr/share/doc/${PF}
- --htmldir=/usr/share/doc/${PF}/html
)
- mkdir "${BD}"
- cd "${BD}"
- einfo "Running configure in ${BD}"
- ECONF_SOURCE="${S}" econf "${myconf[@]}" \
- $(use_enable doc doxygen-docs) \
- $(use_enable doc xml-docs)
+ if [[ ${CHOST} == *-darwin* ]]; then
+ myconf+=(
+ --enable-launchd
+
--with-launchd-agent-dir="${EPREFIX}"/Library/LaunchAgents
+ )
+ fi
+
+ if multilib_is_native_abi; then
+ docconf=(
+ --enable-xml-docs
+ $(use_enable doc doxygen-docs)
+ )
+ else
+ docconf=(
+ --disable-xml-docs
+ --disable-doxygen-docs
+ )
+ myconf+=(
+ --disable-selinux
+ --disable-libaudit
+ --disable-systemd
+ --without-x
+ )
+ fi
+
+ einfo "Running configure in ${BUILD_DIR}"
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" "${docconf[@]}"
- if use test; then
+ if multilib_is_native_abi && use test; then
mkdir "${TBD}"
cd "${TBD}"
einfo "Running configure in ${TBD}"
ECONF_SOURCE="${S}" econf "${myconf[@]}" \
+ $(use_enable test asserts) \
$(use_enable test checks) \
$(use_enable test embedded-tests) \
- $(use_enable test asserts) \
$(has_version dev-libs/dbus-glib && echo
--enable-modular-tests)
fi
}
-src_compile() {
- # after the compile, it uses a selinuxfs interface to
- # check if the SELinux policy has the right support
- use selinux && addwrite /selinux/access
-
- cd "${BD}"
- einfo "Running make in ${BD}"
- emake
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ # after the compile, it uses a selinuxfs interface to
+ # check if the SELinux policy has the right support
+ use selinux && addwrite /selinux/access
- if use test; then
- cd "${TBD}"
- einfo "Running make in ${TBD}"
+ einfo "Running make in ${BUILD_DIR}"
emake
+
+ if multilib_is_native_abi && use test; then
+ cd "${TBD}"
+ einfo "Running make in ${TBD}"
+ emake
+ fi
+ else
+ emake -C dbus libdbus-1.la
fi
}
@@ -137,7 +174,18 @@ src_test() {
DBUS_VERBOSE=1 Xemake -j1 check
}
-src_install() {
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake DESTDIR="${D}" install-pkgconfigDATA
+ emake DESTDIR="${D}" -C dbus \
+ install-libLTLIBRARIES install-dbusincludeHEADERS \
+ install-nodist_dbusarchincludeHEADERS
+ fi
+}
+
+multilib_src_install_all() {
newinitd "${FILESDIR}"/dbus.initd dbus
if use X; then
@@ -150,33 +198,57 @@ src_install() {
# needs to exist for dbus sessions to launch
keepdir /usr/share/dbus-1/services
- keepdir /etc/dbus-1/system.d
- keepdir /etc/dbus-1/session.d
- keepdir /var/lib/dbus # See pkg_postinst() for symlink creation
+ keepdir /etc/dbus-1/{session,system}.d
+ # machine-id symlink from pkg_postinst()
+ keepdir /var/lib/dbus
+ # let the init script create the /var/run/dbus directory
+ rm -rf "${ED}"/var/run
dodoc AUTHORS ChangeLog HACKING NEWS README doc/TODO
-
- cd "${BD}"
- emake DESTDIR="${D}" install
-
- find "${ED}" -type f -name '*.la' -exec rm -f {} +
+ prune_libtool_files --all
}
pkg_postinst() {
- elog "To start the D-Bus system-wide messagebus by default"
- elog "you should add it to the default runlevel :"
- elog "\`rc-update add dbus default\`"
- elog
+ if [ "$(rc-config list default | grep dbus)" = "" ] ; then
+ elog "To start the D-Bus system-wide messagebus by default"
+ elog "you should add it to the default runlevel :"
+ elog "\`rc-update add dbus default\`"
+ elog
+ fi
+
elog "Some applications require a session bus in addition to the system"
elog "bus. Please see \`man dbus-launch\` for more information."
elog
- ewarn "You must restart D-Bus \`/etc/init.d/dbus restart\` to run"
- ewarn "the new version of the daemon."
- ewarn "Don't do this while X is running because it will restart your X
as well."
+
+ if [ "$(rc-status | grep dbus | grep started)" ] ; then
+ elog "You can restart D-Bus \`/etc/init.d/dbus restart\` to run"
+ elog "the new version of the daemon."
+ fi
# Ensure unique id is generated and put it in /etc wrt #370451 but
symlink
# for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
# dependencies with hardcoded paths (although the known ones got fixed
already)
- dbus-uuidgen --ensure="${EROOT}"/etc/machine-id
- ln -sf "${EROOT}"/etc/machine-id "${EROOT}"/var/lib/dbus/machine-id
+ dbus-uuidgen --ensure="${EROOT%/}"/etc/machine-id
+ ln -sf "${EROOT%/}"/etc/machine-id "${EROOT%/}"/var/lib/dbus/machine-id
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ local plist="org.freedesktop.dbus-session.plist"
+ elog
+ elog
+ elog "For MacOS/Darwin we now ship launchd support for dbus."
+ elog "This enables autolaunch of dbus at session login and
makes"
+ elog "dbus usable under MacOS/Darwin."
+ elog
+ elog "The launchd plist file ${plist} has been"
+ elog "installed in ${EPREFIX}/Library/LaunchAgents."
+ elog "For it to be used, you will have to do all of the
following:"
+ elog " + cd ~/Library/LaunchAgents"
+ elog " + ln -s ${EPREFIX}/Library/LaunchAgents/${plist}"
+ elog " + logout and log back in"
+ elog
+ elog "If your application needs a proper
DBUS_SESSION_BUS_ADDRESS"
+ elog "specified and refused to start otherwise, then export the"
+ elog "the following to your environment:"
+ elog "
DBUS_SESSION_BUS_ADDRESS=\"launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET\""
+ fi
}
diff --git a/sys-apps/dbus/files/80-dbus b/sys-apps/dbus/files/80-dbus
new file mode 100644
index 0000000..5593e2c
--- /dev/null
+++ b/sys-apps/dbus/files/80-dbus
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# launches a session dbus instance
+
+dbuslaunch="`which dbus-launch 2>/dev/null`"
+if [ -n "$dbuslaunch" ] && [ -x "$dbuslaunch" ] && [ -z
"$DBUS_SESSION_BUS_ADDRESS" ]; then
+ if [ -n "$command" ]; then
+ command="$dbuslaunch --exit-with-session $command"
+ else
+ eval `$dbuslaunch --sh-syntax --exit-with-session`
+ fi
+fi
+
diff --git a/sys-apps/dbus/files/dbus.init-1.0 b/sys-apps/dbus/files/dbus.initd
similarity index 86%
rename from sys-apps/dbus/files/dbus.init-1.0
rename to sys-apps/dbus/files/dbus.initd
index e96ea05..798d4aa 100644
--- a/sys-apps/dbus/files/dbus.init-1.0
+++ b/sys-apps/dbus/files/dbus.initd
@@ -1,9 +1,9 @@
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/dbus/files/dbus.init-1.0,v 1.4
2007/04/04 13:35:25 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/dbus/files/dbus.initd,v 1.1
2011/11/05 13:56:10 ssuominen Exp $
-opts="reload"
+extra_started_commands="reload"
depend() {
need localmount
@@ -12,8 +12,7 @@ depend() {
start() {
ebegin "Starting D-BUS system messagebus"
-
- /usr/bin/dbus-uuidgen --ensure
+ /usr/bin/dbus-uuidgen --ensure=/etc/machine-id
# We need to test if /var/run/dbus exists, since script will fail if it
does not
[ ! -e /var/run/dbus ] && mkdir /var/run/dbus