summaryrefslogtreecommitdiff
path: root/gnome-unstable
diff options
context:
space:
mode:
Diffstat (limited to 'gnome-unstable')
-rw-r--r--gnome-unstable/at-spi2-atk/PKGBUILD34
-rw-r--r--gnome-unstable/at-spi2-atk/at-spi2-atk.install11
-rw-r--r--gnome-unstable/at-spi2-core/PKGBUILD33
-rw-r--r--gnome-unstable/atk/PKGBUILD26
-rw-r--r--gnome-unstable/clutter/PKGBUILD28
-rw-r--r--gnome-unstable/cogl/PKGBUILD28
-rw-r--r--gnome-unstable/dconf/PKGBUILD31
-rw-r--r--gnome-unstable/dconf/dconf.install13
-rw-r--r--gnome-unstable/gcr/PKGBUILD33
-rw-r--r--gnome-unstable/gcr/gcr.install14
-rw-r--r--gnome-unstable/gdk-pixbuf2/PKGBUILD34
-rw-r--r--gnome-unstable/gdk-pixbuf2/gdk-pixbuf2.install11
-rw-r--r--gnome-unstable/glib-networking/PKGBUILD31
-rw-r--r--gnome-unstable/glib-networking/glib-networking.install11
-rw-r--r--gnome-unstable/gtk3/PKGBUILD38
-rw-r--r--gnome-unstable/gtk3/gtk3.install16
-rw-r--r--gnome-unstable/gtk3/settings.ini2
-rw-r--r--gnome-unstable/libsoup/PKGBUILD48
-rw-r--r--gnome-unstable/network-manager-applet/PKGBUILD41
-rw-r--r--gnome-unstable/network-manager-applet/network-manager-applet.install18
-rw-r--r--gnome-unstable/networkmanager-openconnect/PKGBUILD31
-rw-r--r--gnome-unstable/networkmanager-openconnect/networkmanager-openconnect.install16
-rw-r--r--gnome-unstable/networkmanager-openvpn/PKGBUILD31
-rw-r--r--gnome-unstable/networkmanager-openvpn/networkmanager-openvpn.install11
-rw-r--r--gnome-unstable/networkmanager-pptp/PKGBUILD31
-rw-r--r--gnome-unstable/networkmanager-pptp/networkmanager-pptp.install11
-rw-r--r--gnome-unstable/networkmanager-vpnc/PKGBUILD31
-rw-r--r--gnome-unstable/networkmanager-vpnc/networkmanager-vpnc.install11
-rw-r--r--gnome-unstable/networkmanager/NetworkManager.conf2
-rw-r--r--gnome-unstable/networkmanager/PKGBUILD71
-rw-r--r--gnome-unstable/networkmanager/disable_set_hostname.patch19
-rw-r--r--gnome-unstable/networkmanager/dnsmasq-path.patch30
-rw-r--r--gnome-unstable/networkmanager/networkmanager.install9
-rw-r--r--gnome-unstable/networkmanager/systemd-fallback.patch470
-rw-r--r--gnome-unstable/polkit/PKGBUILD36
-rw-r--r--gnome-unstable/polkit/polkit.pam7
-rw-r--r--gnome-unstable/polkit/systemd-fallback.patch1571
-rw-r--r--gnome-unstable/udisks2/PKGBUILD30
-rw-r--r--gnome-unstable/vala/PKGBUILD27
39 files changed, 2946 insertions, 0 deletions
diff --git a/gnome-unstable/at-spi2-atk/PKGBUILD b/gnome-unstable/at-spi2-atk/PKGBUILD
new file mode 100644
index 000000000..34c365780
--- /dev/null
+++ b/gnome-unstable/at-spi2-atk/PKGBUILD
@@ -0,0 +1,34 @@
+# $Id: PKGBUILD 152283 2012-03-06 13:18:21Z heftig $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=at-spi2-atk
+pkgver=2.3.91
+pkgrel=1
+pkgdesc="A GTK+ module that bridges ATK to D-Bus at-spi"
+arch=('i686' 'x86_64')
+url="http://www.gnome.org"
+license=('GPL2')
+depends=('at-spi2-core' 'libx11' 'atk' 'dconf')
+makedepends=('intltool')
+install=at-spi2-atk.install
+options=('!libtool')
+source=(http://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
+sha256sums=('ba00ec5bbf8647d931be13d06f2bd9e8f82f4db61c1a64ee30c78f985d2aaa49')
+
+build() {
+ cd $pkgname-$pkgver
+
+ sed -i -e '/AC_PATH_XTRA/d' configure.ac
+ autoreconf --force --install
+
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --disable-schemas-compile
+ make
+}
+
+package() {
+ cd $pkgname-$pkgver
+ make DESTDIR="$pkgdir" install
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/gnome-unstable/at-spi2-atk/at-spi2-atk.install b/gnome-unstable/at-spi2-atk/at-spi2-atk.install
new file mode 100644
index 000000000..2ef26aaa9
--- /dev/null
+++ b/gnome-unstable/at-spi2-atk/at-spi2-atk.install
@@ -0,0 +1,11 @@
+post_install() {
+ usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ post_install $1
+}
diff --git a/gnome-unstable/at-spi2-core/PKGBUILD b/gnome-unstable/at-spi2-core/PKGBUILD
new file mode 100644
index 000000000..481fcffe0
--- /dev/null
+++ b/gnome-unstable/at-spi2-core/PKGBUILD
@@ -0,0 +1,33 @@
+# $Id: PKGBUILD 152281 2012-03-06 13:17:26Z heftig $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=at-spi2-core
+pkgver=2.3.91
+pkgrel=1
+pkgdesc="Protocol definitions and daemon for D-Bus at-spi"
+arch=('i686' 'x86_64')
+url="http://www.gnome.org"
+license=('GPL2')
+depends=('dbus-core' 'glib2' 'libxtst')
+makedepends=('intltool' 'gobject-introspection')
+options=('!libtool')
+source=(http://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
+sha256sums=('69c249219af00dfa5f58da400efbc881a9f2fcf89c581aac7ff7d3046acd03ad')
+
+build() {
+ cd $pkgname-$pkgver
+
+ sed -i -e '/AC_PATH_XTRA/d' configure.ac
+ autoreconf --force --install
+
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --libexecdir=/usr/lib/at-spi2-core --disable-xevie
+ make
+}
+
+package() {
+ cd $pkgname-$pkgver
+ make DESTDIR="$pkgdir" install
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/gnome-unstable/atk/PKGBUILD b/gnome-unstable/atk/PKGBUILD
new file mode 100644
index 000000000..3e3db148e
--- /dev/null
+++ b/gnome-unstable/atk/PKGBUILD
@@ -0,0 +1,26 @@
+# $Id: PKGBUILD 152280 2012-03-06 13:16:17Z heftig $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgname=atk
+pkgver=2.3.91
+pkgrel=1
+pkgdesc="A library providing a set of interfaces for accessibility"
+arch=(i686 x86_64)
+license=('LGPL')
+depends=('glib2')
+makedepends=('gobject-introspection')
+options=('!libtool')
+source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz)
+url='http://www.gtk.org/'
+sha256sums=('7faaddda8c2fb537ef90c4816d747ca4ec1085350ad3713c3cb904e93cfec463')
+
+build() {
+ cd ${pkgname}-${pkgver}
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd ${pkgname}-${pkgver}
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/gnome-unstable/clutter/PKGBUILD b/gnome-unstable/clutter/PKGBUILD
new file mode 100644
index 000000000..f6638801d
--- /dev/null
+++ b/gnome-unstable/clutter/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 152299 2012-03-06 14:38:58Z ibiru $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: William Rea <sillywilly@gmail.com>
+
+pkgname=clutter
+pkgver=1.9.14
+pkgrel=1
+pkgdesc="A GObject based library for creating fast, visually rich graphical user interfaces"
+arch=('i686' 'x86_64')
+url="http://clutter-project.org/"
+options=('!libtool')
+license=('LGPL')
+depends=('cogl' 'mesa' 'json-glib' 'atk' 'libxi')
+makedepends=('gobject-introspection' 'mesa')
+source=(http://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
+sha256sums=('4a4a4ca92eaf6875318cbdf5b2f173bdcd7adafd94add4cd815770abed02e70c')
+
+build() {
+ cd "$pkgname-$pkgver"
+ ./configure --prefix=/usr --enable-introspection
+ make
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+}
diff --git a/gnome-unstable/cogl/PKGBUILD b/gnome-unstable/cogl/PKGBUILD
new file mode 100644
index 000000000..91fffe2d0
--- /dev/null
+++ b/gnome-unstable/cogl/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 152297 2012-03-06 14:21:16Z ibiru $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=cogl
+pkgver=1.9.8
+pkgrel=1
+pkgdesc="An object oriented GL/GLES Abstraction/Utility Layer"
+arch=('i686' 'x86_64')
+url="http://www.clutter-project.org/"
+license=('GPL2')
+depends=('libdrm' 'libxext' 'libxdamage' 'libxcomposite' 'gdk-pixbuf2' 'pango')
+makedepends=('mesa' 'gobject-introspection')
+options=(!libtool !emptydirs)
+source=(http://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
+sha256sums=('fa3eae9e865c74c2b72a8bfa9f8b859c3458c81d4854c40e4690a85653fdc91e')
+
+build() {
+ cd "$pkgname-$pkgver"
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/gnome-unstable/dconf/PKGBUILD b/gnome-unstable/dconf/PKGBUILD
new file mode 100644
index 000000000..d6912611f
--- /dev/null
+++ b/gnome-unstable/dconf/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 152293 2012-03-06 13:55:03Z ibiru $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=dconf
+pkgver=0.11.5
+pkgrel=1
+pkgdesc="A low-level configuration system."
+arch=(i686 x86_64)
+url="http://live.gnome.org/dconf"
+license=('LGPL2.1')
+depends=('glib2' 'gdk-pixbuf2')
+makedepends=('vala' 'gtk3')
+optdepends=('gtk3: for dconf-editor')
+install=dconf.install
+source=(http://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
+sha256sums=('4f6ffd386b90e85791164794a66860aa16b7ff988f96105ea5ddc15808c776f5')
+
+build() {
+ cd "$pkgname-$pkgver"
+
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --libexecdir=/usr/lib/dconf
+ make
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/gnome-unstable/dconf/dconf.install b/gnome-unstable/dconf/dconf.install
new file mode 100644
index 000000000..75d713d64
--- /dev/null
+++ b/gnome-unstable/dconf/dconf.install
@@ -0,0 +1,13 @@
+post_install() {
+ gio-querymodules /usr/lib/gio/modules
+ glib-compile-schemas /usr/share/glib-2.0/schemas
+ gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor
+}
+
+post_upgrade(){
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/gnome-unstable/gcr/PKGBUILD b/gnome-unstable/gcr/PKGBUILD
new file mode 100644
index 000000000..307992366
--- /dev/null
+++ b/gnome-unstable/gcr/PKGBUILD
@@ -0,0 +1,33 @@
+# $Id: PKGBUILD 152423 2012-03-06 19:08:24Z ibiru $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=gcr
+pkgver=3.3.90
+pkgrel=1
+pkgdesc="A library for bits of crypto UI and parsing"
+arch=(i686 x86_64)
+url="http://www.gnome.org"
+license=('GPL2')
+depends=('dconf' 'desktop-file-utils' 'gtk3' 'hicolor-icon-theme' 'libgcrypt')
+makedepends=('intltool' 'gobject-introspection')
+options=(!libtool)
+install=gcr.install
+source=(http://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
+sha256sums=('d827f1447af270f9e35319502b1001883283758db26b17395b3b6a6063c82301')
+
+build() {
+ cd "$pkgname-$pkgver"
+ ./configure --prefix=/usr \
+ --libexec=/usr/lib/gcr \
+ --disable-static \
+ --disable-update-mime \
+ --disable-schemas-compile
+ make
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/gnome-unstable/gcr/gcr.install b/gnome-unstable/gcr/gcr.install
new file mode 100644
index 000000000..8677671c4
--- /dev/null
+++ b/gnome-unstable/gcr/gcr.install
@@ -0,0 +1,14 @@
+post_install () {
+ glib-compile-schemas /usr/share/glib-2.0/schemas
+ gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor
+ update-mime-database /usr/share/mime &> /dev/null
+ update-desktop-database -q
+}
+
+post_upgrade () {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/gnome-unstable/gdk-pixbuf2/PKGBUILD b/gnome-unstable/gdk-pixbuf2/PKGBUILD
new file mode 100644
index 000000000..aa17d1744
--- /dev/null
+++ b/gnome-unstable/gdk-pixbuf2/PKGBUILD
@@ -0,0 +1,34 @@
+# $Id: PKGBUILD 152274 2012-03-06 13:10:41Z ibiru $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=gdk-pixbuf2
+pkgver=2.25.2
+pkgrel=1
+pkgdesc="An image loading library"
+arch=('i686' 'x86_64')
+url="http://www.gtk.org/"
+license=('GPL2')
+depends=('glib2' 'libpng' 'libtiff' 'libjpeg' 'libx11')
+makedepends=('gtk-doc' 'gobject-introspection')
+options=('!libtool')
+install=gdk-pixbuf2.install
+source=(http://download.gnome.org/sources/gdk-pixbuf/${pkgver%.*}/gdk-pixbuf-$pkgver.tar.xz)
+sha256sums=('e8bc5d7b823b5b8ecdf053225b12a9c26163ab23fcb68f176d3ec36ce96ff931')
+
+build() {
+ cd "gdk-pixbuf-$pkgver"
+
+ ./configure --prefix=/usr \
+ --without-libjasper \
+ --with-x11 \
+ --with-included-loaders=png
+ make
+}
+
+package() {
+ cd "gdk-pixbuf-$pkgver"
+
+ make DESTDIR="$pkgdir" install
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/gnome-unstable/gdk-pixbuf2/gdk-pixbuf2.install b/gnome-unstable/gdk-pixbuf2/gdk-pixbuf2.install
new file mode 100644
index 000000000..9a26e38dc
--- /dev/null
+++ b/gnome-unstable/gdk-pixbuf2/gdk-pixbuf2.install
@@ -0,0 +1,11 @@
+post_install() {
+ /usr/bin/gdk-pixbuf-query-loaders --update-cache
+}
+
+post_upgrade() {
+ post_install
+}
+
+pre_remove() {
+ rm -f /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/loaders.cache
+}
diff --git a/gnome-unstable/glib-networking/PKGBUILD b/gnome-unstable/glib-networking/PKGBUILD
new file mode 100644
index 000000000..5e34eee1d
--- /dev/null
+++ b/gnome-unstable/glib-networking/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 152287 2012-03-06 13:21:11Z ibiru $
+# Maintainer: Jan "heftig" Steffens <jan.steffens@gmail.com>
+
+pkgname=glib-networking
+pkgver=2.31.20
+pkgrel=1
+pkgdesc="Network-related giomodules for glib"
+arch=('i686' 'x86_64')
+url="http://www.gtk.org/"
+license=('GPL2')
+depends=('glib2' 'libproxy' 'gnutls' 'libgcrypt' 'ca-certificates' 'gsettings-desktop-schemas')
+makedepends=('intltool')
+options=('!libtool')
+install=glib-networking.install
+source=(http://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
+sha256sums=('82015c3601840b733d3f79298b49cce3708c064c3139975d56a44017cf162b5f')
+
+build() {
+ cd "$pkgname-$pkgver"
+ ./configure \
+ --prefix=/usr --sysconfdir=/etc \
+ --libexecdir=/usr/lib/glib-networking --disable-static
+ make
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/gnome-unstable/glib-networking/glib-networking.install b/gnome-unstable/glib-networking/glib-networking.install
new file mode 100644
index 000000000..e1b80c438
--- /dev/null
+++ b/gnome-unstable/glib-networking/glib-networking.install
@@ -0,0 +1,11 @@
+post_install() {
+ /usr/bin/gio-querymodules /usr/lib/gio/modules
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/gnome-unstable/gtk3/PKGBUILD b/gnome-unstable/gtk3/PKGBUILD
new file mode 100644
index 000000000..745797518
--- /dev/null
+++ b/gnome-unstable/gtk3/PKGBUILD
@@ -0,0 +1,38 @@
+# $Id: PKGBUILD 152289 2012-03-06 13:35:08Z ibiru $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=gtk3
+pkgver=3.3.18
+pkgrel=1
+pkgdesc="GTK+ is a multi-platform toolkit (v3)"
+arch=('i686' 'x86_64')
+url="http://www.gtk.org/"
+install=gtk3.install
+depends=('atk' 'cairo' 'gtk-update-icon-cache' 'libcups' 'libxcursor' 'libxinerama' 'libxrandr' 'libxi' 'libxcomposite' 'libxdamage' 'pango' 'shared-mime-info' 'colord')
+makedepends=('gobject-introspection')
+options=('!libtool')
+backup=(etc/gtk-3.0/settings.ini)
+license=('LGPL')
+source=(http://ftp.gnome.org/pub/gnome/sources/gtk+/${pkgver%.*}/gtk+-$pkgver.tar.xz
+ settings.ini)
+sha256sums=('c63cc7ff19c28f73c1060f4b6168ef0f6cb359803abb990baa5c5f5a48f31f90'
+ 'c214d3dcdcadda3d642112287524ab3e526ad592b70895c9f3e3733c23701621')
+
+build() {
+ cd "gtk+-$pkgver"
+ CXX=/bin/false ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --enable-gtk2-dependency \
+ --disable-schemas-compile
+ #https://bugzilla.gnome.org/show_bug.cgi?id=655517
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
+ make
+}
+
+package() {
+ cd "gtk+-$pkgver"
+ make DESTDIR="$pkgdir" install
+
+ install -Dm644 "$srcdir/settings.ini" "$pkgdir/etc/gtk-3.0/settings.ini"
+}
diff --git a/gnome-unstable/gtk3/gtk3.install b/gnome-unstable/gtk3/gtk3.install
new file mode 100644
index 000000000..ca20d2865
--- /dev/null
+++ b/gnome-unstable/gtk3/gtk3.install
@@ -0,0 +1,16 @@
+post_install() {
+ /usr/bin/gtk-query-immodules-3.0 --update-cache
+ /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
+}
+
+post_upgrade() {
+ post_install
+}
+
+pre_remove() {
+ rm -f /usr/lib/gtk-3.0/3.0.0/immodules.cache
+}
+
+post_remove() {
+ /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
+}
diff --git a/gnome-unstable/gtk3/settings.ini b/gnome-unstable/gtk3/settings.ini
new file mode 100644
index 000000000..039000d38
--- /dev/null
+++ b/gnome-unstable/gtk3/settings.ini
@@ -0,0 +1,2 @@
+[Settings]
+gtk-fallback-icon-theme = gnome
diff --git a/gnome-unstable/libsoup/PKGBUILD b/gnome-unstable/libsoup/PKGBUILD
new file mode 100644
index 000000000..4b4b5fc0b
--- /dev/null
+++ b/gnome-unstable/libsoup/PKGBUILD
@@ -0,0 +1,48 @@
+# $Id: PKGBUILD 152324 2012-03-06 18:14:19Z ibiru $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgbase=libsoup
+pkgname=('libsoup' 'libsoup-gnome')
+pkgver=2.37.91
+pkgrel=1
+arch=('i686' 'x86_64')
+license=('LGPL')
+makedepends=('glib2' 'libxml2' 'sqlite3' 'libgnome-keyring' 'intltool' 'gobject-introspection' 'glib-networking')
+url="http://www.gnome.org"
+source=(http://ftp.gnome.org/pub/gnome/sources/$pkgbase/${pkgver%.*}/$pkgbase-$pkgver.tar.xz)
+options=('!libtool' '!emptydirs')
+sha256sums=('9faa8abce324c948cd51a5d9cb956d0edc32e996724d9b0d4b2f02d0903939ba')
+
+build() {
+ cd "$pkgbase-$pkgver"
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --localstatedir=/var --disable-static
+ make
+}
+
+package_libsoup() {
+ pkgdesc="GNOME HTTP Library - base library"
+ depends=('glib2' 'libxml2' 'glib-networking')
+
+ cd "$pkgbase-$pkgver"
+ make DESTDIR="$pkgdir" install
+
+ rm -f "$pkgdir"/usr/lib/libsoup-gnome-2.4.*
+ rm -f "$pkgdir/usr/lib/pkgconfig/libsoup-gnome-2.4.pc"
+ rm -rf "$pkgdir/usr/include/libsoup-gnome-2.4"
+ rm -f "$pkgdir/usr/lib/girepository-1.0/SoupGNOME-2.4.typelib"
+}
+
+package_libsoup-gnome() {
+ pkgdesc="GNOME HTTP Library - GNOME libraries"
+ depends=("libsoup=$pkgver" 'libgnome-keyring')
+
+ cd "$pkgbase-$pkgver"
+ make DESTDIR="$pkgdir" install
+
+ rm -f "$pkgdir"/usr/lib/libsoup-2.4.*
+ rm -f "$pkgdir}usr/lib/pkgconfig/libsoup-2.4.pc"
+ rm -rf "$pkgdir/usr/include/libsoup-2.4"
+ rm -rf "$pkgdir/usr/share"
+ rm -f "$pkgdir/usr/lib/girepository-1.0/Soup-2.4.typelib"
+}
diff --git a/gnome-unstable/network-manager-applet/PKGBUILD b/gnome-unstable/network-manager-applet/PKGBUILD
new file mode 100644
index 000000000..1d5357c79
--- /dev/null
+++ b/gnome-unstable/network-manager-applet/PKGBUILD
@@ -0,0 +1,41 @@
+# $Id: PKGBUILD 152315 2012-03-06 16:26:09Z heftig $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+# Contributor: Arjan Timmerman <arjan@archlinux.org>
+# Contributor: Wael Nasreddine <gandalf@siemens-mobiles.org>
+# Contributor: Tor Krill <tor@krill.nu>
+# Contributor: Will Rea <sillywilly@gmail.com>
+
+pkgname=network-manager-applet
+pkgver=0.9.3.995
+pkgrel=1
+pkgdesc="GNOME frontends to NetWorkmanager"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.gnome.org/projects/NetworkManager/"
+depends=('networkmanager' 'libgnome-keyring' 'polkit-gnome' 'gtk3' 'libnotify' 'gnome-icon-theme'
+ 'mobile-broadband-provider-info' 'gconf' 'iso-codes')
+makedepends=('intltool' 'gnome-bluetooth')
+optdepends=('gnome-bluetooth: for PAN/DUN support')
+options=('!libtool' '!emptydirs')
+install=network-manager-applet.install
+source=(http://ftp.gnome.org/pub/GNOME/sources/$pkgname/0.9/$pkgname-$pkgver.tar.xz)
+sha256sums=('1805ecd738818ac852ed4fbf1aab79a25141f40d989106131b2a766d56fa97fa')
+
+build() {
+ cd ${pkgname}-${pkgver}
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --localstatedir=/var \
+ --libexecdir=/usr/lib/networkmanager \
+ --disable-static \
+ --disable-maintainer-mode
+ make
+}
+
+package() {
+ cd ${pkgname}-${pkgver}
+ make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR="${pkgdir}" install
+
+ install -m755 -d "${pkgdir}/usr/share/gconf/schemas"
+ gconf-merge-schema "${pkgdir}/usr/share/gconf/schemas/${pkgname}.schemas" --domain nm-applet ${pkgdir}/etc/gconf/schemas/*.schemas
+ rm -f ${pkgdir}/etc/gconf/schemas/*.schemas
+}
diff --git a/gnome-unstable/network-manager-applet/network-manager-applet.install b/gnome-unstable/network-manager-applet/network-manager-applet.install
new file mode 100644
index 000000000..9922d12b2
--- /dev/null
+++ b/gnome-unstable/network-manager-applet/network-manager-applet.install
@@ -0,0 +1,18 @@
+pkgname=network-manager-applet
+
+post_install() {
+ usr/sbin/gconfpkg --install ${pkgname}
+ gtk-update-icon-cache -f -q -t /usr/share/icons/hicolor
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ usr/sbin/gconfpkg --uninstall ${pkgname}
+}
+
+post_remove() {
+ gtk-update-icon-cache -f -q -t /usr/share/icons/hicolor
+}
diff --git a/gnome-unstable/networkmanager-openconnect/PKGBUILD b/gnome-unstable/networkmanager-openconnect/PKGBUILD
new file mode 100644
index 000000000..e2658fd7f
--- /dev/null
+++ b/gnome-unstable/networkmanager-openconnect/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 152316 2012-03-06 16:26:58Z heftig $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=networkmanager-openconnect
+pkgver=0.9.3.995
+pkgrel=1
+pkgdesc="NetworkManager VPN integration for openconnect"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.gnome.org/projects/NetworkManager/"
+depends=("networkmanager>=${pkgver}" 'openconnect' 'gconf')
+makedepends=('intltool')
+optdepends=('network-manager-applet: GNOME frontends to NetWorkmanager')
+options=('!libtool')
+install=$pkgname.install
+source=(http://ftp.gnome.org/pub/GNOME/sources/NetworkManager-openconnect/0.9/NetworkManager-openconnect-${pkgver}.tar.xz)
+sha256sums=('6ace0f8963f6c8a1ad6e04d8b7cdeffd0cd4fed3e58956cfac4c6a3f3eed7ff9')
+
+build() {
+ cd NetworkManager-openconnect-${pkgver}
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --libexecdir=/usr/lib/networkmanager \
+ --disable-static
+ make
+}
+
+package() {
+ cd NetworkManager-openconnect-${pkgver}
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/gnome-unstable/networkmanager-openconnect/networkmanager-openconnect.install b/gnome-unstable/networkmanager-openconnect/networkmanager-openconnect.install
new file mode 100644
index 000000000..7bd4d44f9
--- /dev/null
+++ b/gnome-unstable/networkmanager-openconnect/networkmanager-openconnect.install
@@ -0,0 +1,16 @@
+pkgname=networkmanager-openconnect
+
+post_install() {
+ getent group nm-openconnect >/dev/null 2>&1 || groupadd -g 104 nm-openconnect
+ getent passwd nm-openconnect > /dev/null 2>&1 || useradd -u 104 -s /sbin/nologin -d / -M -c 'NetworkManager user for OpenConnect' -g nm-openconnect nm-openconnect
+ passwd -l nm-openconnect > /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ getent passwd nm-openconnect >/dev/null 2>&1 && userdel nm-openconnect
+ getent group nm-openconnect >/dev/null 2>&1 && groupdel nm-openconnect
+}
diff --git a/gnome-unstable/networkmanager-openvpn/PKGBUILD b/gnome-unstable/networkmanager-openvpn/PKGBUILD
new file mode 100644
index 000000000..70b1f5771
--- /dev/null
+++ b/gnome-unstable/networkmanager-openvpn/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 152317 2012-03-06 16:27:48Z heftig $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=networkmanager-openvpn
+pkgver=0.9.3.995
+pkgrel=1
+pkgdesc="NetworkManager VPN plugin for OpenVPN"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.gnome.org/projects/NetworkManager/"
+depends=("networkmanager>=${pkgver}" 'openvpn' 'gtk3' 'libgnome-keyring')
+makedepends=('intltool')
+optdepends=('network-manager-applet: GNOME frontends to NetWorkmanager')
+install=networkmanager-openvpn.install
+options=('!libtool')
+source=(http://ftp.gnome.org/pub/GNOME/sources/NetworkManager-openvpn/0.9/NetworkManager-openvpn-${pkgver}.tar.xz)
+sha256sums=('5ede94f377cea8ca5645c86f5de32ea9df7458745c8a41c8004ed38f1b89ab5e')
+
+build() {
+ cd NetworkManager-openvpn-${pkgver}
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --libexecdir=/usr/lib/networkmanager \
+ --disable-static
+ make
+}
+
+package() {
+ cd NetworkManager-openvpn-${pkgver}
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/gnome-unstable/networkmanager-openvpn/networkmanager-openvpn.install b/gnome-unstable/networkmanager-openvpn/networkmanager-openvpn.install
new file mode 100644
index 000000000..931c0517c
--- /dev/null
+++ b/gnome-unstable/networkmanager-openvpn/networkmanager-openvpn.install
@@ -0,0 +1,11 @@
+post_install() {
+ gtk-update-icon-cache -f -q -t /usr/share/icons/hicolor
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ post_install $1
+}
diff --git a/gnome-unstable/networkmanager-pptp/PKGBUILD b/gnome-unstable/networkmanager-pptp/PKGBUILD
new file mode 100644
index 000000000..e7126bf5d
--- /dev/null
+++ b/gnome-unstable/networkmanager-pptp/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 152318 2012-03-06 16:28:41Z heftig $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=networkmanager-pptp
+pkgver=0.9.3.995
+pkgrel=1
+pkgdesc="NetworkManager VPN plugin for pptp "
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.gnome.org/projects/NetworkManager/"
+depends=("networkmanager>=${pkgver}" 'pptpclient' 'gtk3' 'libgnome-keyring')
+makedepends=('intltool')
+optdepends=('network-manager-applet: GNOME frontends to NetWorkmanager')
+options=('!libtool')
+install=networkmanager-pptp.install
+source=(http://ftp.gnome.org/pub/GNOME/sources/NetworkManager-pptp/0.9/NetworkManager-pptp-${pkgver}.tar.xz)
+sha256sums=('422b9930b2d27f5009561f69165156ced5d2a800d1b3954cc8c8d5b40d2d9c15')
+
+build() {
+ cd NetworkManager-pptp-${pkgver}
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --libexecdir=/usr/lib/networkmanager \
+ --disable-static
+ make
+}
+
+package() {
+ cd NetworkManager-pptp-${pkgver}
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/gnome-unstable/networkmanager-pptp/networkmanager-pptp.install b/gnome-unstable/networkmanager-pptp/networkmanager-pptp.install
new file mode 100644
index 000000000..931c0517c
--- /dev/null
+++ b/gnome-unstable/networkmanager-pptp/networkmanager-pptp.install
@@ -0,0 +1,11 @@
+post_install() {
+ gtk-update-icon-cache -f -q -t /usr/share/icons/hicolor
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ post_install $1
+}
diff --git a/gnome-unstable/networkmanager-vpnc/PKGBUILD b/gnome-unstable/networkmanager-vpnc/PKGBUILD
new file mode 100644
index 000000000..8fbacd832
--- /dev/null
+++ b/gnome-unstable/networkmanager-vpnc/PKGBUILD
@@ -0,0 +1,31 @@
+# $Id: PKGBUILD 152319 2012-03-06 16:29:31Z heftig $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=networkmanager-vpnc
+pkgver=0.9.3.995
+pkgrel=1
+pkgdesc="NetworkManager VPN plugin for vpnc"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.gnome.org/projects/NetworkManager/"
+depends=("networkmanager>=${pkgver}" 'vpnc' 'hicolor-icon-theme' 'gtk3' 'libgnome-keyring')
+makedepends=('intltool')
+optdepends=('network-manager-applet: GNOME frontends to NetWorkmanager')
+options=('!libtool')
+install=networkmanager-vpnc.install
+source=(http://ftp.gnome.org/pub/GNOME/sources/NetworkManager-vpnc/0.9/NetworkManager-vpnc-${pkgver}.tar.xz)
+sha256sums=('1e0542aebbe40ced9d68271e990cf1d11b6fd6abeef528c727be58eb0c9e868c')
+
+build() {
+ cd NetworkManager-vpnc-${pkgver}
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --libexecdir=/usr/lib/networkmanager \
+ --disable-static
+ make
+}
+
+package() {
+ cd NetworkManager-vpnc-${pkgver}
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/gnome-unstable/networkmanager-vpnc/networkmanager-vpnc.install b/gnome-unstable/networkmanager-vpnc/networkmanager-vpnc.install
new file mode 100644
index 000000000..931c0517c
--- /dev/null
+++ b/gnome-unstable/networkmanager-vpnc/networkmanager-vpnc.install
@@ -0,0 +1,11 @@
+post_install() {
+ gtk-update-icon-cache -f -q -t /usr/share/icons/hicolor
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ post_install $1
+}
diff --git a/gnome-unstable/networkmanager/NetworkManager.conf b/gnome-unstable/networkmanager/NetworkManager.conf
new file mode 100644
index 000000000..c37b59680
--- /dev/null
+++ b/gnome-unstable/networkmanager/NetworkManager.conf
@@ -0,0 +1,2 @@
+[main]
+plugins=keyfile
diff --git a/gnome-unstable/networkmanager/PKGBUILD b/gnome-unstable/networkmanager/PKGBUILD
new file mode 100644
index 000000000..e16115947
--- /dev/null
+++ b/gnome-unstable/networkmanager/PKGBUILD
@@ -0,0 +1,71 @@
+# $Id: PKGBUILD 152314 2012-03-06 16:24:59Z heftig $
+# Maintainer: Jan de Groot <jgc@archlinxu.org>
+# Contri-butor: Wael Nasreddine <gandalf@siemens-mobiles.org>
+# Contributor: Tor Krill <tor@krill.nu>
+# Contributor: Will Rea <sillywilly@gmail.com>
+# Contributor: Valentine Sinitsyn <e_val@inbox.ru>
+
+pkgname=networkmanager
+pkgver=0.9.3.995
+pkgrel=1
+pkgdesc="Network Management daemon"
+arch=('i686' 'x86_64')
+license=('GPL')
+url="http://www.gnome.org/projects/NetworkManager/"
+depends=('dbus-glib' 'iproute2' 'libnl' 'nss' 'polkit' 'udev' 'wpa_supplicant' 'ppp' 'dhcpcd'
+ 'libsystemd' 'libsoup')
+makedepends=('intltool' 'dhclient' 'iptables' 'gobject-introspection')
+optdepends=('modemmanager: for modem management service'
+ 'dhclient: alternative DHCP/DHCPv6 client'
+ 'iptables: Connection sharing'
+ 'dnsmasq: Connection sharing'
+ 'bluez: Bluetooth support'
+ 'openresolv: openresolv support')
+options=('!libtool')
+backup=('etc/NetworkManager/NetworkManager.conf')
+install=networkmanager.install
+source=(http://ftp.gnome.org/pub/gnome/sources/NetworkManager/0.9/NetworkManager-${pkgver}.tar.xz
+ NetworkManager.conf disable_set_hostname.patch dnsmasq-path.patch systemd-fallback.patch)
+sha256sums=('67b9005190f01e1cd7d91b9cc87f3068255f2a7eae80ccba78c6e5c99df2ae15'
+ '44b048804c7c0b8b3b0c29b8632b6ad613c397d0a1635ec918e10c0fbcdadf21'
+ '25056837ea92e559f09563ed817e3e0cd9333be861b8914e45f62ceaae2e0460'
+ '65124505048cc8396daf0242c9f5d532fa669b4bbca305998c248ab2329490cb'
+ '5e9bbd8a84883037d27a71ea9969d0cb03f09ca238fa733381bcf136bbc340a5')
+
+build() {
+ cd NetworkManager-${pkgver}
+
+ patch -Np1 -i ../disable_set_hostname.patch
+ patch -Np1 -i ../dnsmasq-path.patch
+ patch -Np1 -i ../systemd-fallback.patch
+ AUTOPOINT='intltoolize --automake --copy' autoreconf -f -i
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --libexecdir=/usr/lib/networkmanager \
+ --with-crypto=nss \
+ --with-distro=arch \
+ --with-dhclient=/usr/sbin/dhclient \
+ --with-dhcpcd=/sbin/dhcpcd \
+ --with-iptables=/usr/sbin/iptables \
+ --with-systemdsystemunitdir=/lib/systemd/system \
+ --with-resolvconf=/usr/sbin/resolvconf \
+ --with-session-tracking=systemd \
+ --with-wext=no \
+ --disable-static \
+ --enable-more-warnings=no \
+ --disable-wimax
+
+ make
+}
+
+package() {
+ cd NetworkManager-${pkgver}
+ make DESTDIR="${pkgdir}" install
+
+ install -m644 ../NetworkManager.conf "${pkgdir}/etc/NetworkManager/"
+
+ rm -rf "${pkgdir}/var/run/"
+}
diff --git a/gnome-unstable/networkmanager/disable_set_hostname.patch b/gnome-unstable/networkmanager/disable_set_hostname.patch
new file mode 100644
index 000000000..ee95dd0e1
--- /dev/null
+++ b/gnome-unstable/networkmanager/disable_set_hostname.patch
@@ -0,0 +1,19 @@
+diff -Nur NetworkManager-0.9.0.orig/src/nm-policy.c NetworkManager-0.9.0/src/nm-policy.c
+--- NetworkManager-0.9.0.orig/src/nm-policy.c 2011-08-23 06:41:02.099686450 +0000
++++ NetworkManager-0.9.0/src/nm-policy.c 2011-08-23 06:43:38.227791737 +0000
+@@ -302,6 +302,7 @@
+ return;
+ }
+
++#if 0
+ /* Try automatically determined hostname from the best device's IP config */
+ if (!best4)
+ best4 = get_best_ip4_device (policy->manager, &best_req4);
+@@ -356,6 +357,7 @@
+ }
+ }
+
++#endif
+ /* If no automatically-configured hostname, try using the hostname from
+ * when NM started up.
+ */
diff --git a/gnome-unstable/networkmanager/dnsmasq-path.patch b/gnome-unstable/networkmanager/dnsmasq-path.patch
new file mode 100644
index 000000000..c0e713266
--- /dev/null
+++ b/gnome-unstable/networkmanager/dnsmasq-path.patch
@@ -0,0 +1,30 @@
+diff -u -r NetworkManager-0.9.2.0/src/dns-manager/nm-dns-dnsmasq.c NetworkManager-0.9.2.0-dnsmasq/src/dns-manager/nm-dns-dnsmasq.c
+--- NetworkManager-0.9.2.0/src/dns-manager/nm-dns-dnsmasq.c 2011-10-10 23:38:20.000000000 +0200
++++ NetworkManager-0.9.2.0-dnsmasq/src/dns-manager/nm-dns-dnsmasq.c 2012-03-06 09:07:24.137460927 +0100
+@@ -52,8 +52,11 @@
+ find_dnsmasq (void)
+ {
+ static const char *paths[] = {
++ "/usr/local/bin/dnsmasq",
+ "/usr/local/sbin/dnsmasq",
++ "/usr/bin/dnsmasq",
+ "/usr/sbin/dnsmasq",
++ "/bin/dnsmasq",
+ "/sbin/dnsmasq",
+ NULL
+ };
+diff -u -r NetworkManager-0.9.2.0/src/dnsmasq-manager/nm-dnsmasq-manager.c NetworkManager-0.9.2.0-dnsmasq/src/dnsmasq-manager/nm-dnsmasq-manager.c
+--- NetworkManager-0.9.2.0/src/dnsmasq-manager/nm-dnsmasq-manager.c 2011-04-19 07:06:22.000000000 +0200
++++ NetworkManager-0.9.2.0-dnsmasq/src/dnsmasq-manager/nm-dnsmasq-manager.c 2012-03-06 09:07:58.603851818 +0100
+@@ -170,8 +170,11 @@
+ nm_find_dnsmasq (void)
+ {
+ static const char *dnsmasq_binary_paths[] = {
++ "/usr/local/bin/dnsmasq",
+ "/usr/local/sbin/dnsmasq",
++ "/usr/bin/dnsmasq",
+ "/usr/sbin/dnsmasq",
++ "/bin/dnsmasq",
+ "/sbin/dnsmasq",
+ NULL
+ };
diff --git a/gnome-unstable/networkmanager/networkmanager.install b/gnome-unstable/networkmanager/networkmanager.install
new file mode 100644
index 000000000..de40c17ed
--- /dev/null
+++ b/gnome-unstable/networkmanager/networkmanager.install
@@ -0,0 +1,9 @@
+post_upgrade() {
+ (( $(vercmp 0.8.3 $2) > 0 )) && cat <<MSG
+ATTENTION:
+ /etc/NetworkManager/nm-system-settings.conf has been replaced
+ by /etc/NetworkManager/NetworkManager.conf. Make sure you move
+ any custom settings to the new config file.
+MSG
+ true
+}
diff --git a/gnome-unstable/networkmanager/systemd-fallback.patch b/gnome-unstable/networkmanager/systemd-fallback.patch
new file mode 100644
index 000000000..f5acc9dc6
--- /dev/null
+++ b/gnome-unstable/networkmanager/systemd-fallback.patch
@@ -0,0 +1,470 @@
+diff -u -Nr NetworkManager-0.9.3.995/configure.ac NetworkManager-0.9.3.995-systemd-fallback/configure.ac
+--- NetworkManager-0.9.3.995/configure.ac 2012-03-02 01:05:21.000000000 +0100
++++ NetworkManager-0.9.3.995-systemd-fallback/configure.ac 2012-03-06 16:55:58.294793902 +0100
+@@ -344,7 +344,7 @@
+ case $with_session_tracking in
+ ck|none) ;;
+ systemd)
+- PKG_CHECK_MODULES(SYSTEMD, [libsystemd-login])
++ PKG_CHECK_MODULES(SYSTEMD, [libsystemd-daemon libsystemd-login])
+ ;;
+ *)
+ 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
+@@ -28,6 +28,10 @@
+ #include <glib/gstdio.h>
+ #include <systemd/sd-login.h>
+ #include <stdlib.h>
++#include <systemd/sd-daemon.h>
++#include <sys/stat.h>
++#include <gio/gio.h>
++#include "nm-logging.h"
+
+ #include "nm-session-utils.h"
+ #include "nm-session-monitor.h"
+@@ -107,10 +111,20 @@
+ return source;
+ }
+
++/********************************************************************/
++
++#define CKDB_PATH "/var/run/ConsoleKit/database"
++
+ struct _NMSessionMonitor {
+ GObject parent_instance;
+
+ GSource *sd_source;
++
++ GKeyFile *database;
++ GFileMonitor *database_monitor;
++ time_t database_mtime;
++ GHashTable *sessions_by_uid;
++ GHashTable *sessions_by_user;
+ };
+
+ struct _NMSessionMonitorClass {
+@@ -130,6 +144,215 @@
+
+ /* ---------------------------------------------------------------------------------------------------- */
+
++typedef struct {
++ char *user;
++ uid_t uid;
++ gboolean local;
++ gboolean active;
++} Session;
++
++static void
++session_free (Session *s)
++{
++ g_free (s->user);
++ memset (s, 0, sizeof (Session));
++ g_free (s);
++}
++
++static gboolean
++check_key (GKeyFile *keyfile, const char *group, const char *key, GError **error)
++{
++ if (g_key_file_has_key (keyfile, group, key, error))
++ return TRUE;
++
++ if (!error) {
++ g_set_error (error,
++ NM_SESSION_MONITOR_ERROR,
++ NM_SESSION_MONITOR_ERROR_MALFORMED_DATABASE,
++ "ConsoleKit database " CKDB_PATH " group '%s' had no '%s' key",
++ group, key);
++ }
++ return FALSE;
++}
++
++static Session *
++session_new (GKeyFile *keyfile, const char *group, GError **error)
++{
++ GError *local = NULL;
++ Session *s;
++ const char *uname = NULL;
++
++ s = g_new0 (Session, 1);
++ g_assert (s);
++
++ s->uid = G_MAXUINT; /* paranoia */
++ if (!check_key (keyfile, group, "uid", &local))
++ goto error;
++ s->uid = (uid_t) g_key_file_get_integer (keyfile, group, "uid", &local);
++ if (local)
++ goto error;
++
++ if (!check_key (keyfile, group, "is_active", &local))
++ goto error;
++ s->active = g_key_file_get_boolean (keyfile, group, "is_active", &local);
++ if (local)
++ goto error;
++
++ if (!check_key (keyfile, group, "is_local", &local))
++ goto error;
++ s->local = g_key_file_get_boolean (keyfile, group, "is_local", &local);
++ if (local)
++ goto error;
++
++ if (!nm_session_uid_to_user (s->uid, &uname, error))
++ return FALSE;
++ s->user = g_strdup (uname);
++
++ return s;
++
++error:
++ session_free (s);
++ g_propagate_error (error, local);
++ return NULL;
++}
++
++static void
++session_merge (Session *src, Session *dest)
++{
++ g_return_if_fail (src != NULL);
++ g_return_if_fail (dest != NULL);
++
++ g_warn_if_fail (g_strcmp0 (src->user, dest->user) == 0);
++ g_warn_if_fail (src->uid == dest->uid);
++
++ dest->local = (dest->local || src->local);
++ dest->active = (dest->active || src->active);
++}
++
++/********************************************************************/
++
++static void
++free_database (NMSessionMonitor *self)
++{
++ if (self->database != NULL) {
++ g_key_file_free (self->database);
++ self->database = NULL;
++ }
++
++ g_hash_table_remove_all (self->sessions_by_uid);
++ g_hash_table_remove_all (self->sessions_by_user);
++}
++
++static gboolean
++reload_database (NMSessionMonitor *self, GError **error)
++{
++ struct stat statbuf;
++ char **groups = NULL;
++ gsize len = 0, i;
++ Session *s;
++
++ free_database (self);
++
++ errno = 0;
++ if (stat (CKDB_PATH, &statbuf) != 0) {
++ g_set_error (error,
++ NM_SESSION_MONITOR_ERROR,
++ errno == ENOENT ? NM_SESSION_MONITOR_ERROR_NO_DATABASE : NM_SESSION_MONITOR_ERROR_IO_ERROR,
++ "Error statting file " CKDB_PATH ": %s",
++ strerror (errno));
++ goto error;
++ }
++ self->database_mtime = statbuf.st_mtime;
++
++ self->database = g_key_file_new ();
++ if (!g_key_file_load_from_file (self->database, CKDB_PATH, G_KEY_FILE_NONE, error))
++ goto error;
++
++ groups = g_key_file_get_groups (self->database, &len);
++ if (!groups) {
++ g_set_error_literal (error,
++ NM_SESSION_MONITOR_ERROR,
++ NM_SESSION_MONITOR_ERROR_IO_ERROR,
++ "Could not load groups from " CKDB_PATH "");
++ goto error;
++ }
++
++ for (i = 0; i < len; i++) {
++ Session *found;
++
++ if (!g_str_has_prefix (groups[i], "Session "))
++ continue;
++
++ s = session_new (self->database, groups[i], error);
++ if (!s)
++ goto error;
++
++ found = g_hash_table_lookup (self->sessions_by_user, (gpointer) s->user);
++ if (found) {
++ session_merge (s, found);
++ session_free (s);
++ } else {
++ /* Entirely new user */
++ g_hash_table_insert (self->sessions_by_user, (gpointer) s->user, s);
++ g_hash_table_insert (self->sessions_by_uid, GUINT_TO_POINTER (s->uid), s);
++ }
++ }
++
++ g_strfreev (groups);
++ return TRUE;
++
++error:
++ if (groups)
++ g_strfreev (groups);
++ free_database (self);
++ return FALSE;
++}
++
++static gboolean
++ensure_database (NMSessionMonitor *self, GError **error)
++{
++ gboolean ret = FALSE;
++
++ if (self->database != NULL) {
++ struct stat statbuf;
++
++ errno = 0;
++ if (stat (CKDB_PATH, &statbuf) != 0) {
++ g_set_error (error,
++ NM_SESSION_MONITOR_ERROR,
++ errno == ENOENT ? NM_SESSION_MONITOR_ERROR_NO_DATABASE : NM_SESSION_MONITOR_ERROR_IO_ERROR,
++ "Error statting file " CKDB_PATH " to check timestamp: %s",
++ strerror (errno));
++ goto out;
++ }
++
++ if (statbuf.st_mtime == self->database_mtime) {
++ ret = TRUE;
++ goto out;
++ }
++ }
++
++ ret = reload_database (self, error);
++
++out:
++ return ret;
++}
++
++static void
++on_file_monitor_changed (GFileMonitor * file_monitor,
++ GFile * file,
++ GFile * other_file,
++ GFileMonitorEvent event_type,
++ gpointer user_data)
++{
++ NMSessionMonitor *self = NM_SESSION_MONITOR (user_data);
++
++ /* throw away cache */
++ free_database (self);
++
++ g_signal_emit (self, signals[CHANGED_SIGNAL], 0);
++}
++
+ static gboolean
+ sessions_changed (gpointer user_data)
+ {
+@@ -143,9 +366,50 @@
+ static void
+ nm_session_monitor_init (NMSessionMonitor *monitor)
+ {
+- monitor->sd_source = sd_source_new ();
+- g_source_set_callback (monitor->sd_source, sessions_changed, monitor, NULL);
+- g_source_attach (monitor->sd_source, NULL);
++ if (sd_booted () > 0) {
++ monitor->sd_source = sd_source_new ();
++ g_source_set_callback (monitor->sd_source, sessions_changed, monitor, NULL);
++ g_source_attach (monitor->sd_source, NULL);
++
++ monitor->database_monitor = NULL;
++ monitor->database = NULL;
++ } else {
++ monitor->sd_source = NULL;
++
++ GError *error = NULL;
++ GFile *file;
++
++ /* Sessions-by-user is responsible for destroying the Session objects */
++ monitor->sessions_by_user = g_hash_table_new_full (g_str_hash, g_str_equal,
++ NULL, (GDestroyNotify) session_free);
++ monitor->sessions_by_uid = g_hash_table_new (g_direct_hash, g_direct_equal);
++
++
++ error = NULL;
++ if (!ensure_database (monitor, &error)) {
++ /* Ignore the first error if the CK database isn't found yet */
++ if (g_error_matches (error,
++ NM_SESSION_MONITOR_ERROR,
++ NM_SESSION_MONITOR_ERROR_NO_DATABASE) == FALSE) {
++ nm_log_err (LOGD_CORE, "Error loading " CKDB_PATH ": %s", error->message);
++ }
++ g_error_free (error);
++ }
++
++ error = NULL;
++ file = g_file_new_for_path (CKDB_PATH);
++ monitor->database_monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, &error);
++ g_object_unref (file);
++ if (monitor->database_monitor == NULL) {
++ nm_log_err (LOGD_CORE, "Error monitoring " CKDB_PATH ": %s", error->message);
++ g_error_free (error);
++ } else {
++ g_signal_connect (monitor->database_monitor,
++ "changed",
++ G_CALLBACK (on_file_monitor_changed),
++ monitor);
++ }
++ }
+ }
+
+ static void
+@@ -158,6 +422,12 @@
+ g_source_unref (monitor->sd_source);
+ }
+
++ if (monitor->database_monitor != NULL)
++ g_object_unref (monitor->database_monitor);
++
++ if (monitor->database != NULL)
++ free_database (monitor);
++
+ 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 @@
+ uid_t *out_uid,
+ GError **error)
+ {
+- uid_t uid;
++ if (monitor->sd_source != NULL) {
++ uid_t uid;
+
+- if (!nm_session_user_to_uid (username, &uid, error))
+- return FALSE;
++ if (!nm_session_user_to_uid (username, &uid, error))
++ return FALSE;
+
+- if (out_uid)
+- *out_uid = uid;
++ if (out_uid)
++ *out_uid = uid;
+
+- return nm_session_monitor_uid_has_session (monitor, uid, NULL, error);
++ return nm_session_monitor_uid_has_session (monitor, uid, NULL, error);
++ } else {
++ Session *s;
++
++ if (!ensure_database (monitor, error))
++ return FALSE;
++
++ s = g_hash_table_lookup (monitor->sessions_by_user, (gpointer) username);
++ if (!s) {
++ g_set_error (error,
++ NM_SESSION_MONITOR_ERROR,
++ NM_SESSION_MONITOR_ERROR_UNKNOWN_USER,
++ "No session found for user '%s'",
++ username);
++ return FALSE;
++ }
++
++ if (out_uid)
++ *out_uid = s->uid;
++ return TRUE;
++ }
+ }
+
+ gboolean
+@@ -222,12 +513,31 @@
+ const char *username,
+ GError **error)
+ {
+- uid_t uid;
++ if (monitor->sd_source != NULL) {
++ uid_t uid;
+
+- if (!nm_session_user_to_uid (username, &uid, error))
+- return FALSE;
++ if (!nm_session_user_to_uid (username, &uid, error))
++ return FALSE;
++
++ return nm_session_monitor_uid_active (monitor, uid, error);
++ } else {
++ Session *s;
++
++ if (!ensure_database (monitor, error))
++ return FALSE;
++
++ s = g_hash_table_lookup (monitor->sessions_by_user, (gpointer) username);
++ if (!s) {
++ g_set_error (error,
++ NM_SESSION_MONITOR_ERROR,
++ NM_SESSION_MONITOR_ERROR_UNKNOWN_USER,
++ "No session found for user '%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)
+ {
+- 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;
++ } else {
++ Session *s;
++
++ if (!ensure_database (monitor, error))
++ return FALSE;
++
++ s = g_hash_table_lookup (monitor->sessions_by_uid, GUINT_TO_POINTER (uid));
++ if (!s) {
++ g_set_error (error,
++ NM_SESSION_MONITOR_ERROR,
++ NM_SESSION_MONITOR_ERROR_UNKNOWN_USER,
++ "No session found for uid %d",
++ uid);
++ return FALSE;
++ }
++
++ if (out_user)
++ *out_user = s->user;
++ return TRUE;
++ }
+ }
+
+ gboolean
+@@ -247,5 +578,24 @@
+ uid_t uid,
+ GError **error)
+ {
+- return sd_uid_get_sessions (uid, TRUE, NULL) > 0;
++ if (monitor->sd_source != NULL)
++ return sd_uid_get_sessions (uid, TRUE, NULL) > 0;
++ else {
++ Session *s;
++
++ if (!ensure_database (monitor, error))
++ return FALSE;
++
++ s = g_hash_table_lookup (monitor->sessions_by_uid, GUINT_TO_POINTER (uid));
++ if (!s) {
++ g_set_error (error,
++ NM_SESSION_MONITOR_ERROR,
++ NM_SESSION_MONITOR_ERROR_UNKNOWN_USER,
++ "No session found for uid '%d'",
++ uid);
++ return FALSE;
++ }
++
++ return s->active;
++ }
+ }
diff --git a/gnome-unstable/polkit/PKGBUILD b/gnome-unstable/polkit/PKGBUILD
new file mode 100644
index 000000000..bac254696
--- /dev/null
+++ b/gnome-unstable/polkit/PKGBUILD
@@ -0,0 +1,36 @@
+# $Id: PKGBUILD 152307 2012-03-06 15:17:55Z heftig $
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+
+pkgname=polkit
+pkgver=0.104
+pkgrel=2
+pkgdesc="Application development toolkit for controlling system-wide privileges"
+arch=(i686 x86_64)
+license=('LGPL')
+url="http://www.freedesktop.org/wiki/Software/PolicyKit"
+depends=('glib2' 'pam' 'expat' 'libsystemd')
+makedepends=('intltool' 'gtk-doc' 'gobject-introspection')
+replaces=('policykit')
+options=('!libtool')
+source=(http://hal.freedesktop.org/releases/$pkgname-$pkgver.tar.gz
+ polkit.pam systemd-fallback.patch)
+md5sums=('e380b4c6fb1e7bccf854e92edc0a8ce1'
+ '6564f95878297b954f0572bc1610dd15'
+ '3c89d97a329ab0ea3a9248c68c3ab000')
+
+build() {
+ cd $pkgname-$pkgver
+ patch -Np1 -i ../systemd-fallback.patch
+ autoreconf -f -i
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --localstatedir=/var --libexecdir=/usr/lib/polkit-1 \
+ --disable-static --enable-gtk-doc --enable-systemd
+ make
+}
+
+package() {
+ cd $pkgname-$pkgver
+ make DESTDIR="$pkgdir" install
+
+ install -m644 "$srcdir/polkit.pam" "$pkgdir/etc/pam.d/polkit-1"
+}
diff --git a/gnome-unstable/polkit/polkit.pam b/gnome-unstable/polkit/polkit.pam
new file mode 100644
index 000000000..04f53e0db
--- /dev/null
+++ b/gnome-unstable/polkit/polkit.pam
@@ -0,0 +1,7 @@
+auth requisite pam_nologin.so
+auth required pam_env.so
+auth required pam_unix.so
+account required pam_unix.so
+session required pam_limits.so
+session required pam_unix.so
+password required pam_unix.so
diff --git a/gnome-unstable/polkit/systemd-fallback.patch b/gnome-unstable/polkit/systemd-fallback.patch
new file mode 100644
index 000000000..f89ce10ae
--- /dev/null
+++ b/gnome-unstable/polkit/systemd-fallback.patch
@@ -0,0 +1,1571 @@
+diff -u -rN polkit-0.104/configure.ac polkit-0.104-systemd-fallback/configure.ac
+--- polkit-0.104/configure.ac 2012-01-03 17:25:49.000000000 +0100
++++ polkit-0.104-systemd-fallback/configure.ac 2012-03-06 15:45:55.275860194 +0100
+@@ -160,14 +160,14 @@
+ [enable_systemd=auto])
+ if test "$enable_systemd" != "no"; then
+ PKG_CHECK_MODULES(SYSTEMD,
+- [libsystemd-login],
++ [libsystemd-login libsystemd-daemon],
+ have_systemd=yes,
+ have_systemd=no)
+ if test "$have_systemd" = "yes"; then
+ SESSION_TRACKING=systemd
+ else
+ if test "$enable_systemd" = "yes"; then
+- AC_MSG_ERROR([systemd support requested but libsystemd-login1 library not found])
++ AC_MSG_ERROR([systemd support requested but systemd libraries not found])
+ fi
+ fi
+ fi
+diff -u -rN polkit-0.104/src/polkit/Makefile.am polkit-0.104-systemd-fallback/src/polkit/Makefile.am
+--- polkit-0.104/src/polkit/Makefile.am 2012-01-03 16:03:47.000000000 +0100
++++ polkit-0.104-systemd-fallback/src/polkit/Makefile.am 2012-03-06 15:19:25.108853325 +0100
+@@ -79,15 +79,8 @@
+ polkitimplicitauthorization.c polkitimplicitauthorization.h \
+ polkittemporaryauthorization.c polkittemporaryauthorization.h \
+ polkitpermission.c polkitpermission.h \
+- $(NULL)
+-
+-if HAVE_SYSTEMD
+-libpolkit_gobject_1_la_SOURCES += \
+- polkitunixsession-systemd.c polkitunixsession.h
+-else
+-libpolkit_gobject_1_la_SOURCES += \
+ polkitunixsession.c polkitunixsession.h
+-endif
++ $(NULL)
+
+ libpolkit_gobject_1_la_CFLAGS = \
+ -D_POLKIT_COMPILATION \
+diff -u -rN polkit-0.104/src/polkit/polkitunixsession.c polkit-0.104-systemd-fallback/src/polkit/polkitunixsession.c
+--- polkit-0.104/src/polkit/polkitunixsession.c 2011-10-18 19:02:27.000000000 +0200
++++ polkit-0.104-systemd-fallback/src/polkit/polkitunixsession.c 2012-03-06 15:17:29.829788021 +0100
+@@ -23,12 +23,18 @@
+ # include "config.h"
+ #endif
+
++#include <stdlib.h>
+ #include <string.h>
+ #include "polkitunixsession.h"
+ #include "polkitsubject.h"
+ #include "polkiterror.h"
+ #include "polkitprivate.h"
+
++#ifdef HAVE_SYSTEMD
++# include <systemd/sd-daemon.h>
++# include <systemd/sd-login.h>
++#endif
++
+ /**
+ * SECTION:polkitunixsession
+ * @title: PolkitUnixSession
+@@ -364,34 +370,44 @@
+ PolkitUnixSession *session = POLKIT_UNIX_SESSION (subject);
+ GDBusConnection *connection;
+ GVariant *result;
+- gboolean ret;
+-
+- ret = FALSE;
++ gboolean ret = FALSE;
+
+- connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, cancellable, error);
+- if (connection == NULL)
+- goto out;
+-
+- result = g_dbus_connection_call_sync (connection,
+- "org.freedesktop.ConsoleKit", /* name */
+- session->session_id, /* object path */
+- "org.freedesktop.ConsoleKit.Session", /* interface name */
+- "GetUser", /* method */
+- NULL, /* parameters */
+- G_VARIANT_TYPE ("(u)"),
+- G_DBUS_CALL_FLAGS_NONE,
+- -1,
+- cancellable,
+- error);
+- if (result == NULL)
+- goto out;
++#ifdef HAVE_SYSTEMD
++ uid_t uid;
++
++ if (sd_booted () > 0)
++ {
++ if (sd_session_get_uid (session->session_id, &uid) == 0)
++ ret = TRUE;
++ }
++ else
++#endif
++ {
++ connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, cancellable, error);
++ if (connection == NULL)
++ goto out;
++
++ result = g_dbus_connection_call_sync (connection,
++ "org.freedesktop.ConsoleKit", /* name */
++ session->session_id, /* object path */
++ "org.freedesktop.ConsoleKit.Session", /* interface name */
++ "GetUser", /* method */
++ NULL, /* parameters */
++ G_VARIANT_TYPE ("(u)"),
++ G_DBUS_CALL_FLAGS_NONE,
++ -1,
++ cancellable,
++ error);
++ if (result == NULL)
++ goto out;
+
+- ret = TRUE;
+- g_variant_unref (result);
++ ret = TRUE;
++ g_variant_unref (result);
+
+- out:
+- if (connection != NULL)
+- g_object_unref (connection);
++ out:
++ if (connection != NULL)
++ g_object_unref (connection);
++ }
+ return ret;
+ }
+
+@@ -470,12 +486,9 @@
+ GError **error)
+ {
+ PolkitUnixSession *session = POLKIT_UNIX_SESSION (initable);
+- GDBusConnection *connection;
++ GDBusConnection *connection = NULL;
+ GVariant *result;
+- gboolean ret;
+-
+- connection = NULL;
+- ret = FALSE;
++ gboolean ret = FALSE;
+
+ if (session->session_id != NULL)
+ {
+@@ -484,33 +497,56 @@
+ goto out;
+ }
+
+- connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, cancellable, error);
+- if (connection == NULL)
+- goto out;
++#ifdef HAVE_SYSTEMD
++ char *s;
++
++ if (sd_booted () > 0)
++ {
++ if (sd_pid_get_session (session->pid, &s) == 0)
++ {
++ session->session_id = g_strdup (s);
++ free (s);
++ ret = TRUE;
++ goto out;
++ }
++
++ g_set_error (error,
++ POLKIT_ERROR,
++ POLKIT_ERROR_FAILED,
++ "No session for pid %d",
++ (gint) session->pid);
++ }
++ else
++#endif
++ {
++ connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, cancellable, error);
++ if (connection == NULL)
++ goto out;
++
++ result = g_dbus_connection_call_sync (connection,
++ "org.freedesktop.ConsoleKit", /* name */
++ "/org/freedesktop/ConsoleKit/Manager", /* object path */
++ "org.freedesktop.ConsoleKit.Manager", /* interface name */
++ "GetSessionForUnixProcess", /* method */
++ g_variant_new ("(u)", session->pid), /* parameters */
++ G_VARIANT_TYPE ("(o)"),
++ G_DBUS_CALL_FLAGS_NONE,
++ -1,
++ cancellable,
++ error);
++ if (result == NULL)
++ goto out;
+
+- result = g_dbus_connection_call_sync (connection,
+- "org.freedesktop.ConsoleKit", /* name */
+- "/org/freedesktop/ConsoleKit/Manager", /* object path */
+- "org.freedesktop.ConsoleKit.Manager", /* interface name */
+- "GetSessionForUnixProcess", /* method */
+- g_variant_new ("(u)", session->pid), /* parameters */
+- G_VARIANT_TYPE ("(o)"),
+- G_DBUS_CALL_FLAGS_NONE,
+- -1,
+- cancellable,
+- error);
+- if (result == NULL)
+- goto out;
++ g_variant_get (result, "(o)", &session->session_id);
++ g_variant_unref (result);
+
+- g_variant_get (result, "(o)", &session->session_id);
+- g_variant_unref (result);
++ ret = TRUE;
++ }
+
+- ret = TRUE;
+
+ out:
+ if (connection != NULL)
+ g_object_unref (connection);
+-
+ return ret;
+ }
+
+diff -u -rN polkit-0.104/src/polkit/polkitunixsession-systemd.c polkit-0.104-systemd-fallback/src/polkit/polkitunixsession-systemd.c
+--- polkit-0.104/src/polkit/polkitunixsession-systemd.c 2012-01-03 16:03:47.000000000 +0100
++++ polkit-0.104-systemd-fallback/src/polkit/polkitunixsession-systemd.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,481 +0,0 @@
+-/*
+- * Copyright (C) 2011 Red Hat, Inc.
+- *
+- * This library is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU Lesser General Public
+- * License as published by the Free Software Foundation; either
+- * version 2 of the License, or (at your option) any later version.
+- *
+- * This library is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- * Lesser General Public License for more details.
+- *
+- * You should have received a copy of the GNU Lesser General
+- * Public License along with this library; if not, write to the
+- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+- * Boston, MA 02111-1307, USA.
+- *
+- * Author: Matthias Clasen
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-# include "config.h"
+-#endif
+-
+-#include <string.h>
+-#include "polkitunixsession.h"
+-#include "polkitsubject.h"
+-#include "polkiterror.h"
+-#include "polkitprivate.h"
+-
+-#include <systemd/sd-login.h>
+-
+-/**
+- * SECTION:polkitunixsession
+- * @title: PolkitUnixSession
+- * @short_description: Unix sessions
+- *
+- * An object that represents an user session.
+- *
+- * The session id is an opaque string obtained from ConsoleKit.
+- */
+-
+-/**
+- * PolkitUnixSession:
+- *
+- * The #PolkitUnixSession struct should not be accessed directly.
+- */
+-struct _PolkitUnixSession
+-{
+- GObject parent_instance;
+-
+- gchar *session_id;
+-
+- gint pid;
+-};
+-
+-struct _PolkitUnixSessionClass
+-{
+- GObjectClass parent_class;
+-};
+-
+-enum
+-{
+- PROP_0,
+- PROP_SESSION_ID,
+- PROP_PID,
+-};
+-
+-static void subject_iface_init (PolkitSubjectIface *subject_iface);
+-static void initable_iface_init (GInitableIface *initable_iface);
+-static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface);
+-
+-G_DEFINE_TYPE_WITH_CODE (PolkitUnixSession, polkit_unix_session, G_TYPE_OBJECT,
+- G_IMPLEMENT_INTERFACE (POLKIT_TYPE_SUBJECT, subject_iface_init)
+- G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)
+- G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init)
+- );
+-
+-static void
+-polkit_unix_session_init (PolkitUnixSession *session)
+-{
+-}
+-
+-static void
+-polkit_unix_session_finalize (GObject *object)
+-{
+- PolkitUnixSession *session = POLKIT_UNIX_SESSION (object);
+-
+- g_free (session->session_id);
+-
+- if (G_OBJECT_CLASS (polkit_unix_session_parent_class)->finalize != NULL)
+- G_OBJECT_CLASS (polkit_unix_session_parent_class)->finalize (object);
+-}
+-
+-static void
+-polkit_unix_session_get_property (GObject *object,
+- guint prop_id,
+- GValue *value,
+- GParamSpec *pspec)
+-{
+- PolkitUnixSession *session = POLKIT_UNIX_SESSION (object);
+-
+- switch (prop_id)
+- {
+- case PROP_SESSION_ID:
+- g_value_set_string (value, session->session_id);
+- break;
+-
+- default:
+- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+- break;
+- }
+-}
+-
+-static void
+-polkit_unix_session_set_property (GObject *object,
+- guint prop_id,
+- const GValue *value,
+- GParamSpec *pspec)
+-{
+- PolkitUnixSession *session = POLKIT_UNIX_SESSION (object);
+-
+- switch (prop_id)
+- {
+- case PROP_SESSION_ID:
+- polkit_unix_session_set_session_id (session, g_value_get_string (value));
+- break;
+-
+- case PROP_PID:
+- session->pid = g_value_get_int (value);
+- break;
+-
+- default:
+- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+- break;
+- }
+-}
+-
+-static void
+-polkit_unix_session_class_init (PolkitUnixSessionClass *klass)
+-{
+- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+-
+- gobject_class->finalize = polkit_unix_session_finalize;
+- gobject_class->get_property = polkit_unix_session_get_property;
+- gobject_class->set_property = polkit_unix_session_set_property;
+-
+- /**
+- * PolkitUnixSession:session-id:
+- *
+- * The UNIX session id.
+- */
+- g_object_class_install_property (gobject_class,
+- PROP_SESSION_ID,
+- g_param_spec_string ("session-id",
+- "Session ID",
+- "The UNIX session ID",
+- NULL,
+- G_PARAM_CONSTRUCT |
+- G_PARAM_READWRITE |
+- G_PARAM_STATIC_NAME |
+- G_PARAM_STATIC_BLURB |
+- G_PARAM_STATIC_NICK));
+-
+-
+- /**
+- * PolkitUnixSession:pid:
+- *
+- * The UNIX process id to look up the session.
+- */
+- g_object_class_install_property (gobject_class,
+- PROP_PID,
+- g_param_spec_int ("pid",
+- "Process ID",
+- "Process ID to use for looking up the session",
+- 0,
+- G_MAXINT,
+- 0,
+- G_PARAM_CONSTRUCT_ONLY |
+- G_PARAM_WRITABLE |
+- G_PARAM_STATIC_NAME |
+- G_PARAM_STATIC_BLURB |
+- G_PARAM_STATIC_NICK));
+-
+-}
+-
+-/**
+- * polkit_unix_session_get_session_id:
+- * @session: A #PolkitUnixSession.
+- *
+- * Gets the session id for @session.
+- *
+- * Returns: The session id for @session. Do not free this string, it
+- * is owned by @session.
+- **/
+-const gchar *
+-polkit_unix_session_get_session_id (PolkitUnixSession *session)
+-{
+- g_return_val_if_fail (POLKIT_IS_UNIX_SESSION (session), NULL);
+- return session->session_id;
+-}
+-
+-/**
+- * polkit_unix_session_set_session_id:
+- * @session: A #PolkitUnixSession.
+- * @session_id: The session id.
+- *
+- * Sets the session id for @session to @session_id.
+- **/
+-void
+-polkit_unix_session_set_session_id (PolkitUnixSession *session,
+- const gchar *session_id)
+-{
+- g_return_if_fail (POLKIT_IS_UNIX_SESSION (session));
+- /*g_return_if_fail (session_id != NULL);*/
+- g_free (session->session_id);
+- session->session_id = g_strdup (session_id);
+-}
+-
+-/**
+- * polkit_unix_session_new:
+- * @session_id: The session id.
+- *
+- * Creates a new #PolkitUnixSession for @session_id.
+- *
+- * Returns: (transfer full): A #PolkitUnixSession. Free with g_object_unref().
+- **/
+-PolkitSubject *
+-polkit_unix_session_new (const gchar *session_id)
+-{
+- return POLKIT_SUBJECT (g_object_new (POLKIT_TYPE_UNIX_SESSION,
+- "session-id", session_id,
+- NULL));
+-}
+-
+-/**
+- * polkit_unix_session_new_for_process:
+- * @pid: The process id of the process to get the session for.
+- * @cancellable: (allow-none): A #GCancellable or %NULL.
+- * @callback: A #GAsyncReadyCallback to call when the request is satisfied
+- * @user_data: The data to pass to @callback.
+- *
+- * Asynchronously creates a new #PolkitUnixSession object for the
+- * process with process id @pid.
+- *
+- * When the operation is finished, @callback will be invoked in the
+- * <link linkend="g-main-context-push-thread-default">thread-default
+- * main loop</link> of the thread you are calling this method
+- * from. You can then call
+- * polkit_unix_session_new_for_process_finish() to get the result of
+- * the operation.
+- *
+- * This method constructs the object asynchronously, for the synchronous and blocking version
+- * use polkit_unix_session_new_for_process_sync().
+- **/
+-void
+-polkit_unix_session_new_for_process (gint pid,
+- GCancellable *cancellable,
+- GAsyncReadyCallback callback,
+- gpointer user_data)
+-{
+- g_async_initable_new_async (POLKIT_TYPE_UNIX_SESSION,
+- G_PRIORITY_DEFAULT,
+- cancellable,
+- callback,
+- user_data,
+- "pid", pid,
+- NULL);
+-}
+-
+-/**
+- * polkit_unix_session_new_for_process_finish:
+- * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to polkit_unix_session_new_for_process().
+- * @error: (allow-none): Return location for error.
+- *
+- * Finishes constructing a #PolkitSubject for a process id.
+- *
+- * Returns: (transfer full) (allow-none): A #PolkitUnixSession for the @pid passed to
+- * polkit_unix_session_new_for_process() or %NULL if @error is
+- * set. Free with g_object_unref().
+- **/
+-PolkitSubject *
+-polkit_unix_session_new_for_process_finish (GAsyncResult *res,
+- GError **error)
+-{
+- GObject *object;
+- GObject *source_object;
+-
+- source_object = g_async_result_get_source_object (res);
+- g_assert (source_object != NULL);
+-
+- object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
+- res,
+- error);
+- g_object_unref (source_object);
+-
+- if (object != NULL)
+- return POLKIT_SUBJECT (object);
+- else
+- return NULL;
+-}
+-
+-
+-/**
+- * polkit_unix_session_new_for_process_sync:
+- * @pid: The process id of the process to get the session for.
+- * @cancellable: (allow-none): A #GCancellable or %NULL.
+- * @error: (allow-none): Return location for error.
+- *
+- * Creates a new #PolkitUnixSession for the process with process id @pid.
+- *
+- * This is a synchronous call - the calling thread is blocked until a
+- * reply is received. For the asynchronous version, see
+- * polkit_unix_session_new_for_process().
+- *
+- * Returns: (allow-none) (transfer full): A #PolkitUnixSession for
+- * @pid or %NULL if @error is set. Free with g_object_unref().
+- **/
+-PolkitSubject *
+-polkit_unix_session_new_for_process_sync (gint pid,
+- GCancellable *cancellable,
+- GError **error)
+-{
+- return POLKIT_SUBJECT (g_initable_new (POLKIT_TYPE_UNIX_SESSION,
+- cancellable,
+- error,
+- "pid", pid,
+- NULL));
+-}
+-
+-static guint
+-polkit_unix_session_hash (PolkitSubject *subject)
+-{
+- PolkitUnixSession *session = POLKIT_UNIX_SESSION (subject);
+-
+- return g_str_hash (session->session_id);
+-}
+-
+-static gboolean
+-polkit_unix_session_equal (PolkitSubject *a,
+- PolkitSubject *b)
+-{
+- PolkitUnixSession *session_a;
+- PolkitUnixSession *session_b;
+-
+- session_a = POLKIT_UNIX_SESSION (a);
+- session_b = POLKIT_UNIX_SESSION (b);
+-
+- return g_strcmp0 (session_a->session_id, session_b->session_id) == 0;
+-}
+-
+-static gchar *
+-polkit_unix_session_to_string (PolkitSubject *subject)
+-{
+- PolkitUnixSession *session = POLKIT_UNIX_SESSION (subject);
+-
+- return g_strdup_printf ("unix-session:%s", session->session_id);
+-}
+-
+-static gboolean
+-polkit_unix_session_exists_sync (PolkitSubject *subject,
+- GCancellable *cancellable,
+- GError **error)
+-{
+- PolkitUnixSession *session = POLKIT_UNIX_SESSION (subject);
+- gboolean ret;
+- uid_t uid;
+-
+- ret = FALSE;
+-
+- if (!sd_session_get_uid (session->session_id, &uid))
+- ret = FALSE;
+-
+- return ret;
+-}
+-
+-static void
+-exists_in_thread_func (GSimpleAsyncResult *res,
+- GObject *object,
+- GCancellable *cancellable)
+-{
+- GError *error;
+- error = NULL;
+- if (!polkit_unix_session_exists_sync (POLKIT_SUBJECT (object),
+- cancellable,
+- &error))
+- {
+- g_simple_async_result_set_from_error (res, error);
+- g_error_free (error);
+- }
+-}
+-
+-static void
+-polkit_unix_session_exists (PolkitSubject *subject,
+- GCancellable *cancellable,
+- GAsyncReadyCallback callback,
+- gpointer user_data)
+-{
+- GSimpleAsyncResult *simple;
+-
+- g_return_if_fail (POLKIT_IS_UNIX_SESSION (subject));
+-
+- simple = g_simple_async_result_new (G_OBJECT (subject),
+- callback,
+- user_data,
+- polkit_unix_session_exists);
+- g_simple_async_result_run_in_thread (simple,
+- exists_in_thread_func,
+- G_PRIORITY_DEFAULT,
+- cancellable);
+- g_object_unref (simple);
+-}
+-
+-static gboolean
+-polkit_unix_session_exists_finish (PolkitSubject *subject,
+- GAsyncResult *res,
+- GError **error)
+-{
+- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
+- gboolean ret;
+-
+- g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == polkit_unix_session_exists);
+-
+- ret = FALSE;
+-
+- if (g_simple_async_result_propagate_error (simple, error))
+- goto out;
+-
+- ret = g_simple_async_result_get_op_res_gboolean (simple);
+-
+- out:
+- return ret;
+-}
+-
+-static void
+-subject_iface_init (PolkitSubjectIface *subject_iface)
+-{
+- subject_iface->hash = polkit_unix_session_hash;
+- subject_iface->equal = polkit_unix_session_equal;
+- subject_iface->to_string = polkit_unix_session_to_string;
+- subject_iface->exists = polkit_unix_session_exists;
+- subject_iface->exists_finish = polkit_unix_session_exists_finish;
+- subject_iface->exists_sync = polkit_unix_session_exists_sync;
+-}
+-
+-static gboolean
+-polkit_unix_session_initable_init (GInitable *initable,
+- GCancellable *cancellable,
+- GError **error)
+-{
+- PolkitUnixSession *session = POLKIT_UNIX_SESSION (initable);
+- gboolean ret;
+-
+- ret = FALSE;
+-
+- if (session->session_id != NULL)
+- {
+- /* already set, nothing to do */
+- ret = TRUE;
+- goto out;
+- }
+-
+- if (!sd_pid_get_session (session->pid, &session->session_id))
+- ret = TRUE;
+-
+-out:
+- return ret;
+-}
+-
+-static void
+-initable_iface_init (GInitableIface *initable_iface)
+-{
+- initable_iface->init = polkit_unix_session_initable_init;
+-}
+-
+-static void
+-async_initable_iface_init (GAsyncInitableIface *async_initable_iface)
+-{
+- /* use default implementation to run GInitable code in a thread */
+-}
+diff -u -rN polkit-0.104/src/polkitbackend/Makefile.am polkit-0.104-systemd-fallback/src/polkitbackend/Makefile.am
+--- polkit-0.104/src/polkitbackend/Makefile.am 2012-01-03 16:03:47.000000000 +0100
++++ polkit-0.104-systemd-fallback/src/polkitbackend/Makefile.am 2012-03-06 15:44:15.380014886 +0100
+@@ -41,15 +41,8 @@
+ polkitbackendconfigsource.h polkitbackendconfigsource.c \
+ polkitbackendactionlookup.h polkitbackendactionlookup.c \
+ polkitbackendlocalauthorizationstore.h polkitbackendlocalauthorizationstore.c \
+- $(NULL)
+-
+-if HAVE_SYSTEMD
+-libpolkit_backend_1_la_SOURCES += \
+- polkitbackendsessionmonitor.h polkitbackendsessionmonitor-systemd.c
+-else
+-libpolkit_backend_1_la_SOURCES += \
+ polkitbackendsessionmonitor.h polkitbackendsessionmonitor.c
+-endif
++ $(NULL)
+
+ libpolkit_backend_1_la_CFLAGS = \
+ -D_POLKIT_COMPILATION \
+diff -u -rN polkit-0.104/src/polkitbackend/polkitbackendsessionmonitor.c polkit-0.104-systemd-fallback/src/polkitbackend/polkitbackendsessionmonitor.c
+--- polkit-0.104/src/polkitbackend/polkitbackendsessionmonitor.c 2011-10-18 19:02:27.000000000 +0200
++++ polkit-0.104-systemd-fallback/src/polkitbackend/polkitbackendsessionmonitor.c 2012-03-06 15:43:49.353562242 +0100
+@@ -26,6 +26,12 @@
+ #include <string.h>
+ #include <glib/gstdio.h>
+
++#ifdef HAVE_SYSTEMD
++# include <systemd/sd-daemon.h>
++# include <systemd/sd-login.h>
++# include <stdlib.h>
++#endif
++
+ #include <polkit/polkit.h>
+ #include "polkitbackendsessionmonitor.h"
+
+@@ -39,6 +45,88 @@
+ * The #PolkitBackendSessionMonitor class is a utility class to track and monitor sessions.
+ */
+
++#ifdef HAVE_SYSTEMD
++typedef struct
++{
++ GSource source;
++ GPollFD pollfd;
++ sd_login_monitor *monitor;
++} SdSource;
++
++static gboolean
++sd_source_prepare (GSource *source,
++ gint *timeout)
++{
++ *timeout = -1;
++ return FALSE;
++}
++
++static gboolean
++sd_source_check (GSource *source)
++{
++ SdSource *sd_source = (SdSource *)source;
++
++ return sd_source->pollfd.revents != 0;
++}
++
++static gboolean
++sd_source_dispatch (GSource *source,
++ GSourceFunc callback,
++ gpointer user_data)
++
++{
++ SdSource *sd_source = (SdSource *)source;
++ gboolean ret;
++
++ g_warn_if_fail (callback != NULL);
++
++ ret = (*callback) (user_data);
++
++ sd_login_monitor_flush (sd_source->monitor);
++
++ return ret;
++}
++
++static void
++sd_source_finalize (GSource *source)
++{
++ SdSource *sd_source = (SdSource*)source;
++
++ sd_login_monitor_unref (sd_source->monitor);
++}
++
++static GSourceFuncs sd_source_funcs = {
++ sd_source_prepare,
++ sd_source_check,
++ sd_source_dispatch,
++ sd_source_finalize
++};
++
++static GSource *
++sd_source_new (void)
++{
++ GSource *source;
++ SdSource *sd_source;
++ int ret;
++
++ source = g_source_new (&sd_source_funcs, sizeof (SdSource));
++ sd_source = (SdSource *)source;
++
++ if ((ret = sd_login_monitor_new (NULL, &sd_source->monitor)) < 0)
++ {
++ g_printerr ("Error getting login monitor: %d", ret);
++ }
++ else
++ {
++ sd_source->pollfd.fd = sd_login_monitor_get_fd (sd_source->monitor);
++ sd_source->pollfd.events = G_IO_IN;
++ g_source_add_poll (source, &sd_source->pollfd);
++ }
++
++ return source;
++}
++#endif /* HAVE_SYSTEMD */
++
+ struct _PolkitBackendSessionMonitor
+ {
+ GObject parent_instance;
+@@ -48,6 +136,10 @@
+ GKeyFile *database;
+ GFileMonitor *database_monitor;
+ time_t database_mtime;
++
++#ifdef HAVE_SYSTEMD
++ GSource *sd_source;
++#endif
+ };
+
+ struct _PolkitBackendSessionMonitorClass
+@@ -162,6 +254,18 @@
+ g_signal_emit (monitor, signals[CHANGED_SIGNAL], 0);
+ }
+
++#ifdef HAVE_SYSTEMD
++static gboolean
++sessions_changed (gpointer user_data)
++{
++ PolkitBackendSessionMonitor *monitor = POLKIT_BACKEND_SESSION_MONITOR (user_data);
++
++ g_signal_emit (monitor, signals[CHANGED_SIGNAL], 0);
++
++ return TRUE;
++}
++#endif
++
+ static void
+ polkit_backend_session_monitor_init (PolkitBackendSessionMonitor *monitor)
+ {
+@@ -176,31 +280,47 @@
+ g_error_free (error);
+ }
+
+- error = NULL;
+- if (!ensure_database (monitor, &error))
+- {
+- g_printerr ("Error loading " CKDB_PATH ": %s", error->message);
+- g_error_free (error);
+- }
++#ifdef HAVE_SYSTEMD
++ monitor->sd_source = NULL;
++
++ if (sd_booted () > 0)
++ {
++ monitor->sd_source = sd_source_new ();
++ g_source_set_callback (monitor->sd_source, sessions_changed, monitor, NULL);
++ g_source_attach (monitor->sd_source, NULL);
+
+- error = NULL;
+- file = g_file_new_for_path (CKDB_PATH);
+- monitor->database_monitor = g_file_monitor_file (file,
+- G_FILE_MONITOR_NONE,
+- NULL,
+- &error);
+- g_object_unref (file);
+- if (monitor->database_monitor == NULL)
+- {
+- g_printerr ("Error monitoring " CKDB_PATH ": %s", error->message);
+- g_error_free (error);
++ monitor->database = NULL;
++ monitor->database_monitor = NULL;
+ }
+ else
++#endif
+ {
+- g_signal_connect (monitor->database_monitor,
+- "changed",
+- G_CALLBACK (on_file_monitor_changed),
+- monitor);
++ error = NULL;
++ if (!ensure_database (monitor, &error))
++ {
++ g_printerr ("Error loading " CKDB_PATH ": %s", error->message);
++ g_error_free (error);
++ }
++
++ error = NULL;
++ file = g_file_new_for_path (CKDB_PATH);
++ monitor->database_monitor = g_file_monitor_file (file,
++ G_FILE_MONITOR_NONE,
++ NULL,
++ &error);
++ g_object_unref (file);
++ if (monitor->database_monitor == NULL)
++ {
++ g_printerr ("Error monitoring " CKDB_PATH ": %s", error->message);
++ g_error_free (error);
++ }
++ else
++ {
++ g_signal_connect (monitor->database_monitor,
++ "changed",
++ G_CALLBACK (on_file_monitor_changed),
++ monitor);
++ }
+ }
+ }
+
+@@ -212,6 +332,14 @@
+ if (monitor->system_bus != NULL)
+ g_object_unref (monitor->system_bus);
+
++#ifdef HAVE_SYSTEMD
++ if (monitor->sd_source != NULL)
++ {
++ g_source_destroy (monitor->sd_source);
++ g_source_unref (monitor->sd_source);
++ }
++#endif
++
+ if (monitor->database_monitor != NULL)
+ g_object_unref (monitor->database_monitor);
+
+@@ -328,22 +456,38 @@
+ }
+ else if (POLKIT_IS_UNIX_SESSION (subject))
+ {
+- if (!ensure_database (monitor, error))
++#ifdef HAVE_SYSTEMD
++ if (monitor->sd_source != NULL)
+ {
+- g_prefix_error (error, "Error getting user for session: Error ensuring CK database at " CKDB_PATH ": ");
+- goto out;
++ if (sd_session_get_uid (polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (subject)), &uid) < 0)
++ {
++ g_set_error (error,
++ POLKIT_ERROR,
++ POLKIT_ERROR_FAILED,
++ "Error getting uid for session");
++ goto out;
++ }
+ }
+-
+- group = g_strdup_printf ("Session %s", polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (subject)));
+- local_error = NULL;
+- uid = g_key_file_get_integer (monitor->database, group, "uid", &local_error);
+- if (local_error != NULL)
++ else
++#endif
+ {
+- g_propagate_prefixed_error (error, local_error, "Error getting uid using " CKDB_PATH ": ");
++ if (!ensure_database (monitor, error))
++ {
++ g_prefix_error (error, "Error getting user for session: Error ensuring CK database at " CKDB_PATH ": ");
++ goto out;
++ }
++
++ group = g_strdup_printf ("Session %s", polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (subject)));
++ local_error = NULL;
++ uid = g_key_file_get_integer (monitor->database, group, "uid", &local_error);
++ if (local_error != NULL)
++ {
++ g_propagate_prefixed_error (error, local_error, "Error getting uid using " CKDB_PATH ": ");
++ g_free (group);
++ goto out;
++ }
+ g_free (group);
+- goto out;
+ }
+- g_free (group);
+
+ ret = polkit_unix_user_new (uid);
+ }
+@@ -373,29 +517,46 @@
+
+ if (POLKIT_IS_UNIX_PROCESS (subject))
+ {
+- const gchar *session_id;
+- GVariant *result;
+- result = g_dbus_connection_call_sync (monitor->system_bus,
+- "org.freedesktop.ConsoleKit",
+- "/org/freedesktop/ConsoleKit/Manager",
+- "org.freedesktop.ConsoleKit.Manager",
+- "GetSessionForUnixProcess",
+- g_variant_new ("(u)", polkit_unix_process_get_pid (POLKIT_UNIX_PROCESS (subject))),
+- G_VARIANT_TYPE ("(o)"),
+- G_DBUS_CALL_FLAGS_NONE,
+- -1, /* timeout_msec */
+- NULL, /* GCancellable */
+- error);
+- if (result == NULL)
+- goto out;
+- g_variant_get (result, "(&o)", &session_id);
+- session = polkit_unix_session_new (session_id);
+- g_variant_unref (result);
++#ifdef HAVE_SYSTEMD
++ if (monitor->sd_source != NULL)
++ {
++ gchar *session_id;
++ pid_t pid;
++
++ pid = polkit_unix_process_get_pid (POLKIT_UNIX_PROCESS (subject));
++ if (sd_pid_get_session (pid, &session_id) < 0)
++ goto out;
++
++ session = polkit_unix_session_new (session_id);
++ free (session_id);
++ }
++ else
++#endif
++ {
++ const gchar *session_id;
++ GVariant *result;
++ result = g_dbus_connection_call_sync (monitor->system_bus,
++ "org.freedesktop.ConsoleKit",
++ "/org/freedesktop/ConsoleKit/Manager",
++ "org.freedesktop.ConsoleKit.Manager",
++ "GetSessionForUnixProcess",
++ g_variant_new ("(u)", polkit_unix_process_get_pid (POLKIT_UNIX_PROCESS (subject))),
++ G_VARIANT_TYPE ("(o)"),
++ G_DBUS_CALL_FLAGS_NONE,
++ -1, /* timeout_msec */
++ NULL, /* GCancellable */
++ error);
++ if (result == NULL)
++ goto out;
++ g_variant_get (result, "(&o)", &session_id);
++ session = polkit_unix_session_new (session_id);
++ g_variant_unref (result);
++ }
+ }
+ else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
+ {
+ guint32 pid;
+- const gchar *session_id;
++ gchar *session_id;
+ GVariant *result;
+
+ result = g_dbus_connection_call_sync (monitor->system_bus,
+@@ -414,22 +575,35 @@
+ g_variant_get (result, "(u)", &pid);
+ g_variant_unref (result);
+
+- result = g_dbus_connection_call_sync (monitor->system_bus,
+- "org.freedesktop.ConsoleKit",
+- "/org/freedesktop/ConsoleKit/Manager",
+- "org.freedesktop.ConsoleKit.Manager",
+- "GetSessionForUnixProcess",
+- g_variant_new ("(u)", pid),
+- G_VARIANT_TYPE ("(o)"),
+- G_DBUS_CALL_FLAGS_NONE,
+- -1, /* timeout_msec */
+- NULL, /* GCancellable */
+- error);
+- if (result == NULL)
+- goto out;
+- g_variant_get (result, "(&o)", &session_id);
+- session = polkit_unix_session_new (session_id);
+- g_variant_unref (result);
++#ifdef HAVE_SYSTEMD
++ if (monitor->sd_source != NULL)
++ {
++ if (sd_pid_get_session (pid, &session_id) < 0)
++ goto out;
++
++ session = polkit_unix_session_new (session_id);
++ free (session_id);
++ }
++ else
++#endif
++ {
++ result = g_dbus_connection_call_sync (monitor->system_bus,
++ "org.freedesktop.ConsoleKit",
++ "/org/freedesktop/ConsoleKit/Manager",
++ "org.freedesktop.ConsoleKit.Manager",
++ "GetSessionForUnixProcess",
++ g_variant_new ("(u)", pid),
++ G_VARIANT_TYPE ("(o)"),
++ G_DBUS_CALL_FLAGS_NONE,
++ -1, /* timeout_msec */
++ NULL, /* GCancellable */
++ error);
++ if (result == NULL)
++ goto out;
++ g_variant_get (result, "(&o)", &session_id);
++ session = polkit_unix_session_new (session_id);
++ g_variant_unref (result);
++ }
+ }
+ else
+ {
+@@ -490,7 +664,22 @@
+ polkit_backend_session_monitor_is_session_local (PolkitBackendSessionMonitor *monitor,
+ PolkitSubject *session)
+ {
+- return get_boolean (monitor, session, "is_local");
++#ifdef HAVE_SYSTEMD
++ if (monitor->sd_source != NULL)
++ {
++ char *seat;
++
++ if (!sd_session_get_seat (polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (session)), &seat))
++ {
++ free (seat);
++ return TRUE;
++ }
++
++ return FALSE;
++ }
++ else
++#endif
++ return get_boolean (monitor, session, "is_local");
+ }
+
+
+@@ -498,6 +687,11 @@
+ polkit_backend_session_monitor_is_session_active (PolkitBackendSessionMonitor *monitor,
+ PolkitSubject *session)
+ {
+- return get_boolean (monitor, session, "is_active");
++#ifdef HAVE_SYSTEMD
++ if (monitor->sd_source != NULL)
++ return sd_session_is_active (polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (session)));
++ else
++#endif
++ return get_boolean (monitor, session, "is_active");
+ }
+
+diff -u -rN polkit-0.104/src/polkitbackend/polkitbackendsessionmonitor-systemd.c polkit-0.104-systemd-fallback/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
+--- polkit-0.104/src/polkitbackend/polkitbackendsessionmonitor-systemd.c 2012-01-03 16:03:47.000000000 +0100
++++ polkit-0.104-systemd-fallback/src/polkitbackend/polkitbackendsessionmonitor-systemd.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,414 +0,0 @@
+-/*
+- * Copyright (C) 2011 Red Hat, Inc.
+- *
+- * This library is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU Lesser General Public
+- * License as published by the Free Software Foundation; either
+- * version 2 of the License, or (at your option) any later version.
+- *
+- * This library is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- * Lesser General Public License for more details.
+- *
+- * You should have received a copy of the GNU Lesser General
+- * Public License along with this library; if not, write to the
+- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+- * Boston, MA 02111-1307, USA.
+- *
+- * Author: Matthias Clasen
+- */
+-
+-#include "config.h"
+-#include <errno.h>
+-#include <pwd.h>
+-#include <grp.h>
+-#include <string.h>
+-#include <glib/gstdio.h>
+-#include <systemd/sd-login.h>
+-#include <stdlib.h>
+-
+-#include <polkit/polkit.h>
+-#include "polkitbackendsessionmonitor.h"
+-
+-/* <internal>
+- * SECTION:polkitbackendsessionmonitor
+- * @title: PolkitBackendSessionMonitor
+- * @short_description: Monitor sessions
+- *
+- * The #PolkitBackendSessionMonitor class is a utility class to track and monitor sessions.
+- */
+-
+-typedef struct
+-{
+- GSource source;
+- GPollFD pollfd;
+- sd_login_monitor *monitor;
+-} SdSource;
+-
+-static gboolean
+-sd_source_prepare (GSource *source,
+- gint *timeout)
+-{
+- *timeout = -1;
+- return FALSE;
+-}
+-
+-static gboolean
+-sd_source_check (GSource *source)
+-{
+- SdSource *sd_source = (SdSource *)source;
+-
+- return sd_source->pollfd.revents != 0;
+-}
+-
+-static gboolean
+-sd_source_dispatch (GSource *source,
+- GSourceFunc callback,
+- gpointer user_data)
+-
+-{
+- SdSource *sd_source = (SdSource *)source;
+- gboolean ret;
+-
+- g_warn_if_fail (callback != NULL);
+-
+- ret = (*callback) (user_data);
+-
+- sd_login_monitor_flush (sd_source->monitor);
+-
+- return ret;
+-}
+-
+-static void
+-sd_source_finalize (GSource *source)
+-{
+- SdSource *sd_source = (SdSource*)source;
+-
+- sd_login_monitor_unref (sd_source->monitor);
+-}
+-
+-static GSourceFuncs sd_source_funcs = {
+- sd_source_prepare,
+- sd_source_check,
+- sd_source_dispatch,
+- sd_source_finalize
+-};
+-
+-static GSource *
+-sd_source_new (void)
+-{
+- GSource *source;
+- SdSource *sd_source;
+- int ret;
+-
+- source = g_source_new (&sd_source_funcs, sizeof (SdSource));
+- sd_source = (SdSource *)source;
+-
+- if ((ret = sd_login_monitor_new (NULL, &sd_source->monitor)) < 0)
+- {
+- g_printerr ("Error getting login monitor: %d", ret);
+- }
+- else
+- {
+- sd_source->pollfd.fd = sd_login_monitor_get_fd (sd_source->monitor);
+- sd_source->pollfd.events = G_IO_IN;
+- g_source_add_poll (source, &sd_source->pollfd);
+- }
+-
+- return source;
+-}
+-
+-struct _PolkitBackendSessionMonitor
+-{
+- GObject parent_instance;
+-
+- GDBusConnection *system_bus;
+-
+- GSource *sd_source;
+-};
+-
+-struct _PolkitBackendSessionMonitorClass
+-{
+- GObjectClass parent_class;
+-
+- void (*changed) (PolkitBackendSessionMonitor *monitor);
+-};
+-
+-
+-enum
+-{
+- CHANGED_SIGNAL,
+- LAST_SIGNAL,
+-};
+-
+-static guint signals[LAST_SIGNAL] = {0};
+-
+-G_DEFINE_TYPE (PolkitBackendSessionMonitor, polkit_backend_session_monitor, G_TYPE_OBJECT);
+-
+-/* ---------------------------------------------------------------------------------------------------- */
+-
+-static gboolean
+-sessions_changed (gpointer user_data)
+-{
+- PolkitBackendSessionMonitor *monitor = POLKIT_BACKEND_SESSION_MONITOR (user_data);
+-
+- g_signal_emit (monitor, signals[CHANGED_SIGNAL], 0);
+-
+- return TRUE;
+-}
+-
+-
+-static void
+-polkit_backend_session_monitor_init (PolkitBackendSessionMonitor *monitor)
+-{
+- GError *error;
+-
+- error = NULL;
+- monitor->system_bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
+- if (monitor->system_bus == NULL)
+- {
+- g_printerr ("Error getting system bus: %s", error->message);
+- g_error_free (error);
+- }
+-
+- monitor->sd_source = sd_source_new ();
+- g_source_set_callback (monitor->sd_source, sessions_changed, monitor, NULL);
+- g_source_attach (monitor->sd_source, NULL);
+-}
+-
+-static void
+-polkit_backend_session_monitor_finalize (GObject *object)
+-{
+- PolkitBackendSessionMonitor *monitor = POLKIT_BACKEND_SESSION_MONITOR (object);
+-
+- if (monitor->system_bus != NULL)
+- g_object_unref (monitor->system_bus);
+-
+- if (monitor->sd_source != NULL)
+- {
+- g_source_destroy (monitor->sd_source);
+- g_source_unref (monitor->sd_source);
+- }
+-
+- if (G_OBJECT_CLASS (polkit_backend_session_monitor_parent_class)->finalize != NULL)
+- G_OBJECT_CLASS (polkit_backend_session_monitor_parent_class)->finalize (object);
+-}
+-
+-static void
+-polkit_backend_session_monitor_class_init (PolkitBackendSessionMonitorClass *klass)
+-{
+- GObjectClass *gobject_class;
+-
+- gobject_class = G_OBJECT_CLASS (klass);
+-
+- gobject_class->finalize = polkit_backend_session_monitor_finalize;
+-
+- /**
+- * PolkitBackendSessionMonitor::changed:
+- * @monitor: A #PolkitBackendSessionMonitor
+- *
+- * Emitted when something changes.
+- */
+- signals[CHANGED_SIGNAL] = g_signal_new ("changed",
+- POLKIT_BACKEND_TYPE_SESSION_MONITOR,
+- G_SIGNAL_RUN_LAST,
+- G_STRUCT_OFFSET (PolkitBackendSessionMonitorClass, changed),
+- NULL, /* accumulator */
+- NULL, /* accumulator data */
+- g_cclosure_marshal_VOID__VOID,
+- G_TYPE_NONE,
+- 0);
+-}
+-
+-PolkitBackendSessionMonitor *
+-polkit_backend_session_monitor_new (void)
+-{
+- PolkitBackendSessionMonitor *monitor;
+-
+- monitor = POLKIT_BACKEND_SESSION_MONITOR (g_object_new (POLKIT_BACKEND_TYPE_SESSION_MONITOR, NULL));
+-
+- return monitor;
+-}
+-
+-/* ---------------------------------------------------------------------------------------------------- */
+-
+-GList *
+-polkit_backend_session_monitor_get_sessions (PolkitBackendSessionMonitor *monitor)
+-{
+- /* TODO */
+- return NULL;
+-}
+-
+-/* ---------------------------------------------------------------------------------------------------- */
+-
+-/**
+- * polkit_backend_session_monitor_get_user:
+- * @monitor: A #PolkitBackendSessionMonitor.
+- * @subject: A #PolkitSubject.
+- * @error: Return location for error.
+- *
+- * Gets the user corresponding to @subject or %NULL if no user exists.
+- *
+- * Returns: %NULL if @error is set otherwise a #PolkitUnixUser that should be freed with g_object_unref().
+- */
+-PolkitIdentity *
+-polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor *monitor,
+- PolkitSubject *subject,
+- GError **error)
+-{
+- PolkitIdentity *ret;
+- guint32 uid;
+-
+- ret = NULL;
+-
+- if (POLKIT_IS_UNIX_PROCESS (subject))
+- {
+- uid = polkit_unix_process_get_uid (POLKIT_UNIX_PROCESS (subject));
+- if ((gint) uid == -1)
+- {
+- g_set_error (error,
+- POLKIT_ERROR,
+- POLKIT_ERROR_FAILED,
+- "Unix process subject does not have uid set");
+- goto out;
+- }
+- ret = polkit_unix_user_new (uid);
+- }
+- else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
+- {
+- GVariant *result;
+-
+- result = g_dbus_connection_call_sync (monitor->system_bus,
+- "org.freedesktop.DBus",
+- "/org/freedesktop/DBus",
+- "org.freedesktop.DBus",
+- "GetConnectionUnixUser",
+- g_variant_new ("(s)", polkit_system_bus_name_get_name (POLKIT_SYSTEM_BUS_NAME (subject))),
+- G_VARIANT_TYPE ("(u)"),
+- G_DBUS_CALL_FLAGS_NONE,
+- -1, /* timeout_msec */
+- NULL, /* GCancellable */
+- error);
+- if (result == NULL)
+- goto out;
+- g_variant_get (result, "(u)", &uid);
+- g_variant_unref (result);
+-
+- ret = polkit_unix_user_new (uid);
+- }
+- else if (POLKIT_IS_UNIX_SESSION (subject))
+- {
+-
+- if (sd_session_get_uid (polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (subject)), &uid) < 0)
+- {
+- g_set_error (error,
+- POLKIT_ERROR,
+- POLKIT_ERROR_FAILED,
+- "Error getting uid for session");
+- goto out;
+- }
+-
+- ret = polkit_unix_user_new (uid);
+- }
+-
+- out:
+- return ret;
+-}
+-
+-/**
+- * polkit_backend_session_monitor_get_session_for_subject:
+- * @monitor: A #PolkitBackendSessionMonitor.
+- * @subject: A #PolkitSubject.
+- * @error: Return location for error.
+- *
+- * Gets the session corresponding to @subject or %NULL if no session exists.
+- *
+- * Returns: %NULL if @error is set otherwise a #PolkitUnixSession that should be freed with g_object_unref().
+- */
+-PolkitSubject *
+-polkit_backend_session_monitor_get_session_for_subject (PolkitBackendSessionMonitor *monitor,
+- PolkitSubject *subject,
+- GError **error)
+-{
+- PolkitSubject *session;
+-
+- session = NULL;
+-
+- if (POLKIT_IS_UNIX_PROCESS (subject))
+- {
+- gchar *session_id;
+- pid_t pid;
+-
+- pid = polkit_unix_process_get_pid (POLKIT_UNIX_PROCESS (subject));
+- if (sd_pid_get_session (pid, &session_id) < 0)
+- goto out;
+-
+- session = polkit_unix_session_new (session_id);
+- free (session_id);
+- }
+- else if (POLKIT_IS_SYSTEM_BUS_NAME (subject))
+- {
+- guint32 pid;
+- gchar *session_id;
+- GVariant *result;
+-
+- result = g_dbus_connection_call_sync (monitor->system_bus,
+- "org.freedesktop.DBus",
+- "/org/freedesktop/DBus",
+- "org.freedesktop.DBus",
+- "GetConnectionUnixProcessID",
+- g_variant_new ("(s)", polkit_system_bus_name_get_name (POLKIT_SYSTEM_BUS_NAME (subject))),
+- G_VARIANT_TYPE ("(u)"),
+- G_DBUS_CALL_FLAGS_NONE,
+- -1, /* timeout_msec */
+- NULL, /* GCancellable */
+- error);
+- if (result == NULL)
+- goto out;
+- g_variant_get (result, "(u)", &pid);
+- g_variant_unref (result);
+-
+- if (sd_pid_get_session (pid, &session_id) < 0)
+- goto out;
+-
+- session = polkit_unix_session_new (session_id);
+- free (session_id);
+- }
+- else
+- {
+- g_set_error (error,
+- POLKIT_ERROR,
+- POLKIT_ERROR_NOT_SUPPORTED,
+- "Cannot get user for subject of type %s",
+- g_type_name (G_TYPE_FROM_INSTANCE (subject)));
+- }
+-
+- out:
+-
+- return session;
+-}
+-
+-gboolean
+-polkit_backend_session_monitor_is_session_local (PolkitBackendSessionMonitor *monitor,
+- PolkitSubject *session)
+-{
+- char *seat;
+-
+- if (!sd_session_get_seat (polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (session)), &seat))
+- {
+- free (seat);
+- return TRUE;
+- }
+-
+- return FALSE;
+-}
+-
+-
+-gboolean
+-polkit_backend_session_monitor_is_session_active (PolkitBackendSessionMonitor *monitor,
+- PolkitSubject *session)
+-{
+- return sd_session_is_active (polkit_unix_session_get_session_id (POLKIT_UNIX_SESSION (session)));
+-}
+-
diff --git a/gnome-unstable/udisks2/PKGBUILD b/gnome-unstable/udisks2/PKGBUILD
new file mode 100644
index 000000000..0bbf3c109
--- /dev/null
+++ b/gnome-unstable/udisks2/PKGBUILD
@@ -0,0 +1,30 @@
+# $Id: PKGBUILD 152271 2012-03-06 12:56:19Z ibiru $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgname=udisks2
+pkgver=1.93.0
+pkgrel=1
+pkgdesc="Disk Management Service, version 2"
+arch=('i686' 'x86_64')
+url="http://www.freedesktop.org/wiki/Software/udisks"
+license=('GPL2')
+depends=('glib2' 'udev' 'polkit' 'libatasmart' 'eject')
+makedepends=('intltool' 'docbook-xsl' 'gobject-introspection')
+optdepends=('parted: partition management'
+ 'gptfdisk: GUID partition table support')
+options=(!libtool)
+source=(http://udisks.freedesktop.org/releases/udisks-$pkgver.tar.bz2)
+sha256sums=('e2264d06bbf5399d243b0f91628881fa1d95d1a512b2af26f5ab074caf6327d7')
+
+build() {
+ cd "udisks-$pkgver"
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --with-systemdsystemunitdir=/lib/systemd/system \
+ --localstatedir=/var --disable-static
+ make
+}
+
+package() {
+ cd "udisks-$pkgver"
+ make DESTDIR="$pkgdir" install
+}
diff --git a/gnome-unstable/vala/PKGBUILD b/gnome-unstable/vala/PKGBUILD
new file mode 100644
index 000000000..84d3cf5bd
--- /dev/null
+++ b/gnome-unstable/vala/PKGBUILD
@@ -0,0 +1,27 @@
+# $Id: PKGBUILD 152291 2012-03-06 13:41:57Z ibiru $
+# Maintainer : Ionut Biru <ibiru@archlinux.org>
+# Contributor: Timm Preetz <timm@preetz.us>
+
+pkgname=vala
+pkgver=0.15.2
+pkgrel=1
+pkgdesc="Compiler for the GObject type system"
+arch=('i686' 'x86_64')
+url="http://live.gnome.org/Vala"
+license=('LGPL')
+depends=('glib2')
+makedepends=('libxslt')
+options=('!libtool')
+source=(http://ftp.gnome.org/pub/gnome/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
+sha256sums=('1cc5d62714c2e4297cb458d11372f581f0e65070ed3b0e88133ce3db0cfee13c')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ ./configure --prefix=/usr --enable-vapigen
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+}