Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 620948 | Differences between
and this patch

Collapse All | Expand All

(-)a/config.h.in (-1 / +1 lines)
Lines 79-85 Link Here
79
#undef HAVE_STRING_H
79
#undef HAVE_STRING_H
80
80
81
/* Build systemd-login code */
81
/* Build systemd-login code */
82
#undef HAVE_SYSTEMD
82
#undef HAVE_SYSTEMD_SD_LOGIN_H
83
83
84
/* Define to 1 if you have the <sys/stat.h> header file. */
84
/* Define to 1 if you have the <sys/stat.h> header file. */
85
#undef HAVE_SYS_STAT_H
85
#undef HAVE_SYS_STAT_H
(-)a/configure.ac (-1 / +17 lines)
Lines 254-260 Link Here
254
		    AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
254
		    AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
255
		    [has_systemdsystemunitdir=$with_systemdsystemunitdir],
255
		    [has_systemdsystemunitdir=$with_systemdsystemunitdir],
256
		    [has_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
256
		    [has_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
257
	AC_DEFINE(HAVE_SYSTEMD,1,[Build systemd code])
258
	AC_SUBST([systemdsystemunitdir], [$has_systemdsystemunitdir])
257
	AC_SUBST([systemdsystemunitdir], [$has_systemdsystemunitdir])
259
fi
258
fi
260
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$has_systemdsystemunitdir"])
259
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$has_systemdsystemunitdir"])
Lines 267-272 Link Here
267
AM_CONDITIONAL(ENABLE_OFFLINE_UPDATE, [test x$enable_systemd = xyes -a x$enable_offline_update = xyes])
266
AM_CONDITIONAL(ENABLE_OFFLINE_UPDATE, [test x$enable_systemd = xyes -a x$enable_offline_update = xyes])
268
267
269
dnl ---------------------------------------------------------------------------
268
dnl ---------------------------------------------------------------------------
269
dnl - Use elogind instead of systemd-login
270
dnl ---------------------------------------------------------------------------
271
AC_ARG_ENABLE(elogind, AS_HELP_STRING([--enable-elogind],[enable elogind session tracker]),
272
	      enable_elogind=$enableval,enable_elogind=no)
273
if test x$enable_elogind = xyes; then
274
	PKG_CHECK_MODULES(ELOGIND, [libelogind >= 229.4], [have_elogind=yes], [have_elogind=no])
275
fi
276
277
dnl ---------------------------------------------------------------------------
278
dnl --- Is systemd/sd-login.h, either from systemd or elogind, available?
279
dnl ---------------------------------------------------------------------------
280
if test "x$have_systemd" != "xno" -o "x$have_elogind" != "xno" ; then
281
		AC_DEFINE(HAVE_SYSTEMD_SD_LOGIN_H,1,[Build systemd-login code])
282
fi
283
284
dnl ---------------------------------------------------------------------------
270
dnl - Generate man pages ? (default enabled)
285
dnl - Generate man pages ? (default enabled)
271
dnl ---------------------------------------------------------------------------
286
dnl ---------------------------------------------------------------------------
272
AC_ARG_ENABLE(man_pages, AS_HELP_STRING([--disable-man-pages],[Disable man pages generation]), enable_man_pages=$enableval)
287
AC_ARG_ENABLE(man_pages, AS_HELP_STRING([--disable-man-pages],[Disable man pages generation]), enable_man_pages=$enableval)
Lines 629-634 Link Here
629
        cflags:                    ${CFLAGS}
644
        cflags:                    ${CFLAGS}
630
        cppflags:                  ${CPPFLAGS}
645
        cppflags:                  ${CPPFLAGS}
631
        Able to run locally:       ${enable_local}
646
        Able to run locally:       ${enable_local}
647
        Use elogind:               ${enable_elogind}
632
        Use systemd:               ${enable_systemd}
648
        Use systemd:               ${enable_systemd}
633
        Enable offline update:     ${enable_offline_update}
649
        Enable offline update:     ${enable_offline_update}
634
        Networking stacks:         ${networking_apis}
650
        Networking stacks:         ${networking_apis}
(-)a/src/Makefile.am (+4 lines)
Lines 11-16 Link Here
11
	$(PYTHON_CFLAGS)				\
11
	$(PYTHON_CFLAGS)				\
12
	$(NETWORK_MANAGER_CFLAGS)			\
12
	$(NETWORK_MANAGER_CFLAGS)			\
13
	$(CONNMAN_CFLAGS)				\
13
	$(CONNMAN_CFLAGS)				\
14
	$(ELOGIND_CFLAGS)				\
14
	$(SYSTEMD_CFLAGS)				\
15
	$(SYSTEMD_CFLAGS)				\
15
	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"		\
16
	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"		\
16
	-DBINDIR=\"$(bindir)\"				\
17
	-DBINDIR=\"$(bindir)\"				\
Lines 104-109 Link Here
104
	$(POLKIT_LIBS)					\
105
	$(POLKIT_LIBS)					\
105
	$(GIO_LIBS)					\
106
	$(GIO_LIBS)					\
106
	$(ARCHIVE_LIBS)					\
107
	$(ARCHIVE_LIBS)					\
108
	$(ELOGIND_LIBS)					\
107
	$(SYSTEMD_LIBS)
109
	$(SYSTEMD_LIBS)
108
110
109
packagekit_direct_LDFLAGS =				\
111
packagekit_direct_LDFLAGS =				\
Lines 134-139 Link Here
134
	$(POLKIT_LIBS)					\
136
	$(POLKIT_LIBS)					\
135
	$(GIO_LIBS)					\
137
	$(GIO_LIBS)					\
136
	$(ARCHIVE_LIBS)					\
138
	$(ARCHIVE_LIBS)					\
139
	$(ELOGIND_LIBS)					\
137
	$(SYSTEMD_LIBS)
140
	$(SYSTEMD_LIBS)
138
141
139
packagekitd_LDFLAGS =					\
142
packagekitd_LDFLAGS =					\
Lines 161-166 Link Here
161
	$(POLKIT_LIBS)					\
164
	$(POLKIT_LIBS)					\
162
	$(GIO_LIBS)					\
165
	$(GIO_LIBS)					\
163
	$(ARCHIVE_LIBS)					\
166
	$(ARCHIVE_LIBS)					\
167
	$(ELOGIND_LIBS)					\
164
	$(SYSTEMD_LIBS)
168
	$(SYSTEMD_LIBS)
165
169
166
pk_self_test_CPPFLAGS =					\
170
pk_self_test_CPPFLAGS =					\
(-)a/src/pk-engine.c (-6 / +6 lines)
Lines 98-104 Link Here
98
	guint			 owner_id;
98
	guint			 owner_id;
99
	GDBusNodeInfo		*introspection;
99
	GDBusNodeInfo		*introspection;
100
	GDBusConnection		*connection;
100
	GDBusConnection		*connection;
101
#ifdef HAVE_SYSTEMD
101
#ifdef HAVE_SYSTEMD_SD_LOGIN_H
102
	GDBusProxy		*logind_proxy;
102
	GDBusProxy		*logind_proxy;
103
	gint			 logind_fd;
103
	gint			 logind_fd;
104
#endif
104
#endif
Lines 281-287 Link Here
281
static void
281
static void
282
pk_engine_inhibit (PkEngine *engine)
282
pk_engine_inhibit (PkEngine *engine)
283
{
283
{
284
#ifdef HAVE_SYSTEMD
284
#ifdef HAVE_SYSTEMD_SD_LOGIN_H
285
	g_autoptr(GError) error = NULL;
285
	g_autoptr(GError) error = NULL;
286
	g_autoptr(GUnixFDList) out_fd_list = NULL;
286
	g_autoptr(GUnixFDList) out_fd_list = NULL;
287
	g_autoptr(GVariant) res = NULL;
287
	g_autoptr(GVariant) res = NULL;
Lines 331-337 Link Here
331
static void
331
static void
332
pk_engine_uninhibit (PkEngine *engine)
332
pk_engine_uninhibit (PkEngine *engine)
333
{
333
{
334
#ifdef HAVE_SYSTEMD
334
#ifdef HAVE_SYSTEMD_SD_LOGIN_H
335
	if (engine->priv->logind_fd == 0)
335
	if (engine->priv->logind_fd == 0)
336
		return;
336
		return;
337
	g_debug ("closed logind fd %i", engine->priv->logind_fd);
337
	g_debug ("closed logind fd %i", engine->priv->logind_fd);
Lines 1830-1836 Link Here
1830
	}
1830
	}
1831
}
1831
}
1832
1832
1833
#ifdef HAVE_SYSTEMD
1833
#ifdef HAVE_SYSTEMD_SD_LOGIN_H
1834
/**
1834
/**
1835
 * pk_engine_proxy_logind_cb:
1835
 * pk_engine_proxy_logind_cb:
1836
 **/
1836
 **/
Lines 1872-1878 Link Here
1872
	/* save copy for emitting signals */
1872
	/* save copy for emitting signals */
1873
	engine->priv->connection = g_object_ref (connection);
1873
	engine->priv->connection = g_object_ref (connection);
1874
1874
1875
#ifdef HAVE_SYSTEMD
1875
#ifdef HAVE_SYSTEMD_SD_LOGIN_H
1876
	/* connect to logind */
1876
	/* connect to logind */
1877
	g_dbus_proxy_new (connection,
1877
	g_dbus_proxy_new (connection,
1878
			  G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
1878
			  G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
Lines 2031-2037 Link Here
2031
	if (engine->priv->connection != NULL)
2031
	if (engine->priv->connection != NULL)
2032
		g_object_unref (engine->priv->connection);
2032
		g_object_unref (engine->priv->connection);
2033
2033
2034
#ifdef HAVE_SYSTEMD
2034
#ifdef HAVE_SYSTEMD_SD_LOGIN_H
2035
	/* uninhibit */
2035
	/* uninhibit */
2036
	if (engine->priv->logind_fd != 0)
2036
	if (engine->priv->logind_fd != 0)
2037
		close (engine->priv->logind_fd);
2037
		close (engine->priv->logind_fd);
(-)a/src/pk-dbus.c (-4 / +4 lines)
Lines 27-33 Link Here
27
#include <glib.h>
27
#include <glib.h>
28
#include <gio/gio.h>
28
#include <gio/gio.h>
29
29
30
#ifdef HAVE_SYSTEMD
30
#ifdef HAVE_SYSTEMD_SD_LOGIN_H
31
 #include <systemd/sd-login.h>
31
 #include <systemd/sd-login.h>
32
#endif
32
#endif
33
33
Lines 177-183 Link Here
177
	return cmdline;
177
	return cmdline;
178
}
178
}
179
179
180
#ifdef HAVE_SYSTEMD
180
#ifdef HAVE_SYSTEMD_SD_LOGIN_H
181
/**
181
/**
182
 * pk_dbus_get_session_systemd:
182
 * pk_dbus_get_session_systemd:
183
 **/
183
 **/
Lines 220-226 Link Here
220
pk_dbus_get_session (PkDbus *dbus, const gchar *sender)
220
pk_dbus_get_session (PkDbus *dbus, const gchar *sender)
221
{
221
{
222
	gchar *session = NULL;
222
	gchar *session = NULL;
223
#ifndef HAVE_SYSTEMD
223
#ifndef HAVE_SYSTEMD_SD_LOGIN_H
224
	g_autoptr(GError) error = NULL;
224
	g_autoptr(GError) error = NULL;
225
#endif
225
#endif
226
	guint pid;
226
	guint pid;
Lines 250-256 Link Here
250
	}
250
	}
251
251
252
	/* get session from systemd or ConsoleKit */
252
	/* get session from systemd or ConsoleKit */
253
#ifdef HAVE_SYSTEMD
253
#ifdef HAVE_SYSTEMD_SD_LOGIN_H
254
	session = pk_dbus_get_session_systemd (pid);
254
	session = pk_dbus_get_session_systemd (pid);
255
#else
255
#else
256
	/* get session from ConsoleKit */
256
	/* get session from ConsoleKit */

Return to bug 620948