-# TODO: Vala binding (BR: vala >= 0.17.1.24)
#
# Conditional build
%bcond_without systemd # use systemd for session tracking instead of ConsoleKit (fallback to ConsoleKit on runtime)
+%bcond_without vala # Vala API
%bcond_with wimax # enable wimax support
-
+#
Summary: Network Manager for GNOME
Summary(pl.UTF-8): Zarządca sieci dla GNOME
Name: NetworkManager
-Version: 0.9.6.0
+Version: 0.9.6.4
Release: 1
Epoch: 2
License: GPL v2+
Group: Networking/Admin
Source0: http://ftp.gnome.org/pub/GNOME/sources/NetworkManager/0.9/%{name}-%{version}.tar.xz
-# Source0-md5: 85f9ed7fe08533a33c5117488f81e7ac
+# Source0-md5: 54ca5200edeb5155086ced43d00b0cad
Source1: %{name}.conf
Source2: %{name}.upstart
Source3: %{name}.tmpfiles
BuildRequires: tar >= 1:1.22
BuildRequires: udev-devel
BuildRequires: udev-glib-devel >= 1:147
+%{?with_vala:BuildRequires: vala >= 2:0.17.1.24}
%{?with_wimax:BuildRequires: wimax-devel >= 1.5.1}
BuildRequires: xz
Requires(post,preun): /sbin/chkconfig
%description static -l pl.UTF-8
Statyczne biblioteki Network Managera.
+%package -n vala-NetworkManager
+Summary: Vala API for NetworkManager libraries
+Summary(pl.UTF-8): API języka Vala do bibliotek NetworkManagera
+Group: Development/Libraries
+Requires: %{name}-devel = %{epoch}:%{version}-%{release}
+Requires: vala >= 2:0.17.1.24
+
+%description -n vala-NetworkManager
+Vala API for NetworkManager libraries.
+
+%description -n vala-NetworkManager -l pl.UTF-8
+API języka Vala do bibliotek NetworkManagera.
+
%prep
%setup -q
%patch0 -p1
--with-dist-version=%{version}-%{release} \
--with-docs \
%{__enable_disable wimax} \
- --enable-static
+ --enable-static \
+ %{!?with_vala:--disable-vala}
%{__make}
%{_libdir}/libnm-util.a
%{_libdir}/libnm-glib.a
%{_libdir}/libnm-glib-vpn.a
+
+%if %{with vala}
+%files -n vala-NetworkManager
+%defattr(644,root,root,755)
+%{_datadir}/vala/vapi/libnm-glib.deps
+%{_datadir}/vala/vapi/libnm-glib.vapi
+%{_datadir}/vala/vapi/libnm-util.deps
+%{_datadir}/vala/vapi/libnm-util.vapi
+%endif
;;
*)
AC_MSG_ERROR(--with-session-tracking must be one of [none, ck, systemd])
-diff -u -Nr NetworkManager-0.9.3.995/src/nm-session-monitor-systemd.c NetworkManager-0.9.3.995-systemd-fallback/src/nm-session-monitor-systemd.c
---- NetworkManager-0.9.3.995/src/nm-session-monitor-systemd.c 2012-02-27 16:57:16.000000000 +0100
-+++ NetworkManager-0.9.3.995-systemd-fallback/src/nm-session-monitor-systemd.c 2012-03-06 16:55:01.285264295 +0100
+--- NetworkManager-0.9.6.4/src/nm-session-monitor-systemd.c.orig 2012-09-12 22:37:01.000000000 +0200
++++ NetworkManager-0.9.6.4/src/nm-session-monitor-systemd.c 2012-11-01 08:58:24.084129513 +0100
@@ -28,6 +28,10 @@
#include <glib/gstdio.h>
#include <systemd/sd-login.h>
#include "nm-session-utils.h"
#include "nm-session-monitor.h"
-@@ -107,10 +111,20 @@
+@@ -108,10 +112,20 @@
return source;
}
};
struct _NMSessionMonitorClass {
-@@ -130,6 +144,215 @@
+@@ -131,6 +145,215 @@
/* ---------------------------------------------------------------------------------------------------- */
static gboolean
sessions_changed (gpointer user_data)
{
-@@ -143,9 +366,50 @@
+@@ -144,9 +367,50 @@
static void
nm_session_monitor_init (NMSessionMonitor *monitor)
{
}
static void
-@@ -158,6 +422,12 @@
+@@ -159,6 +423,12 @@
g_source_unref (monitor->sd_source);
}
if (G_OBJECT_CLASS (nm_session_monitor_parent_class)->finalize != NULL)
G_OBJECT_CLASS (nm_session_monitor_parent_class)->finalize (object);
}
-@@ -206,15 +476,36 @@
+@@ -207,15 +477,36 @@
uid_t *out_uid,
GError **error)
{
}
gboolean
-@@ -222,12 +513,31 @@
+@@ -223,12 +514,31 @@
const char *username,
GError **error)
{
- return FALSE;
+ if (!nm_session_user_to_uid (username, &uid, error))
+ return FALSE;
-+
+
+- return nm_session_monitor_uid_active (monitor, uid, error);
+ return nm_session_monitor_uid_active (monitor, uid, error);
+ } else {
+ Session *s;
+ username);
+ return FALSE;
+ }
-
-- return nm_session_monitor_uid_active (monitor, uid, error);
++
+ return s->active;
+ }
}
gboolean
-@@ -236,10 +546,31 @@
- const char **out_user,
- GError **error)
+@@ -239,16 +549,37 @@
{
+ int ret;
+
- if (!nm_session_uid_to_user (uid, out_user, error))
- return FALSE;
+ if (monitor->sd_source != NULL) {
+ if (!nm_session_uid_to_user (uid, out_user, error))
+ return FALSE;
-- return sd_uid_get_sessions (uid, FALSE, NULL) > 0;
-+ return sd_uid_get_sessions (uid, FALSE, NULL) > 0;
+- ret = sd_uid_get_sessions (uid, FALSE, NULL) > 0;
+- if (ret < 0) {
+- nm_log_warn (LOGD_CORE, "Failed to get systemd sessions for uid %d: %d",
+- uid, ret);
+- return FALSE;
++ ret = sd_uid_get_sessions (uid, FALSE, NULL) > 0;
++ if (ret < 0) {
++ nm_log_warn (LOGD_CORE, "Failed to get systemd sessions for uid %d: %d",
++ uid, ret);
++ return FALSE;
++ }
++ return ret > 0 ? TRUE : FALSE;
+ } else {
+ Session *s;
+
+ if (out_user)
+ *out_user = s->user;
+ return TRUE;
-+ }
+ }
+- return ret > 0 ? TRUE : FALSE;
}
gboolean
-@@ -247,5 +578,24 @@
- uid_t uid,
- GError **error)
+@@ -258,11 +589,30 @@
{
-- return sd_uid_get_sessions (uid, TRUE, NULL) > 0;
-+ if (monitor->sd_source != NULL)
-+ return sd_uid_get_sessions (uid, TRUE, NULL) > 0;
-+ else {
+ int ret;
+
+- ret = sd_uid_get_sessions (uid, TRUE, NULL) > 0;
+- if (ret < 0) {
+- nm_log_warn (LOGD_CORE, "Failed to get active systemd sessions for uid %d: %d",
+- uid, ret);
+- return FALSE;
++ if (monitor->sd_source != NULL) {
++ ret = sd_uid_get_sessions (uid, TRUE, NULL) > 0;
++ if (ret < 0) {
++ nm_log_warn (LOGD_CORE, "Failed to get active systemd sessions for uid %d: %d",
++ uid, ret);
++ return FALSE;
++ }
++ return ret > 0 ? TRUE : FALSE;
++ } else {
+ Session *s;
+
+ if (!ensure_database (monitor, error))
+ }
+
+ return s->active;
-+ }
+ }
+- return ret > 0 ? TRUE : FALSE;
}