summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorStar Brilliant2016-10-05 22:16:01 +0800
committerStar Brilliant2016-10-05 22:16:01 +0800
commita05700c62e7a4947fc5630ca05f0f490277b658d (patch)
treef90f7e4eeaa543969cb1be48993edd475acbc749
downloadaur-a05700c62e7a4947fc5630ca05f0f490277b658d.tar.gz
Initial commit
-rw-r--r--.SRCINFO30
-rw-r--r--0001-Add-a-critical-action-Ignore.patch50
-rw-r--r--PKGBUILD50
3 files changed, 130 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..33dfb2e8bbef
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,30 @@
+# Generated by mksrcinfo v8
+# Wed Oct 5 14:15:54 UTC 2016
+pkgbase = upower-nocritical
+ pkgdesc = Abstraction for enumerating power devices, listening to device events and querying history and statistics (With a patch to disable low battery action)
+ pkgver = 0.99.4+12+g402640b
+ pkgrel = 1
+ url = http://upower.freedesktop.org
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = intltool
+ makedepends = docbook-xsl
+ makedepends = gobject-introspection
+ makedepends = python2
+ makedepends = git
+ makedepends = gtk-doc
+ depends = systemd
+ depends = libusb
+ depends = libimobiledevice
+ depends = libgudev
+ provides = upower
+ conflicts = upower
+ backup = etc/UPower/UPower.conf
+ source = git://anongit.freedesktop.org/upower#commit=402640bee016472bf61c7a4ad9e5fac9790ea1bf
+ source = 0001-Add-a-critical-action-Ignore.patch
+ md5sums = SKIP
+ md5sums = 69fbeb7e5906a59fd39f702d01f83815
+
+pkgname = upower-nocritical
+
diff --git a/0001-Add-a-critical-action-Ignore.patch b/0001-Add-a-critical-action-Ignore.patch
new file mode 100644
index 000000000000..6575a9b12e4f
--- /dev/null
+++ b/0001-Add-a-critical-action-Ignore.patch
@@ -0,0 +1,50 @@
+From 1ba6e724dabf3a91e59b871750e22d420a4b1238 Mon Sep 17 00:00:00 2001
+From: Star Brilliant <m13253@hotmail.com>
+Date: Wed, 5 Oct 2016 22:02:36 +0800
+Subject: [PATCH] Add a critical action: Ignore
+
+---
+ etc/UPower.conf | 3 ++-
+ src/linux/up-backend.c | 5 +++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/etc/UPower.conf b/etc/UPower.conf
+index e2c6a69..2bda528 100644
+--- a/etc/UPower.conf
++++ b/etc/UPower.conf
+@@ -88,7 +88,8 @@ TimeAction=120
+ # PowerOff
+ # Hibernate
+ # HybridSleep
++# Ignore
+ #
+ # If HybridSleep isn't available, Hibernate will be used
+ # If Hibernate isn't available, PowerOff will be used
+-CriticalPowerAction=HybridSleep
++CriticalPowerAction=Ignore
+diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c
+index 2ba201a..ade64e9 100644
+--- a/src/linux/up-backend.c
++++ b/src/linux/up-backend.c
+@@ -392,6 +392,7 @@ up_backend_get_critical_action (UpBackend *backend)
+ { "HybridSleep", "CanHybridSleep" },
+ { "Hibernate", "CanHibernate" },
+ { "PowerOff", NULL },
++ { "Ignore", NULL },
+ };
+ guint i = 0;
+ char *action;
+@@ -447,6 +448,10 @@ up_backend_take_action (UpBackend *backend)
+ method = up_backend_get_critical_action (backend);
+ g_assert (method != NULL);
+
++ if (g_strcmp0 (method, "Ignore") == 0) {
++ return;
++ }
++
+ /* Take action */
+ g_debug ("About to call logind method %s", method);
+ g_dbus_proxy_call (backend->priv->logind_proxy,
+--
+2.10.0
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..27342fe4ed7d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# Contributor: Jan de Groot <jgc@archlinux.org>
+# Maintainer: Star Brilliant <m13253@hotmail.com>
+
+pkgname=upower-nocritical
+_pkgname=upower
+pkgver=0.99.4+12+g402640b
+pkgrel=1
+pkgdesc="Abstraction for enumerating power devices, listening to device events and querying history and statistics (With a patch to disable low battery action)"
+arch=('i686' 'x86_64')
+url="http://upower.freedesktop.org"
+license=('GPL')
+depends=('systemd' 'libusb' 'libimobiledevice' 'libgudev')
+makedepends=('intltool' 'docbook-xsl' 'gobject-introspection' 'python2' 'git' 'gtk-doc')
+provides=('upower')
+conflicts=('upower')
+backup=('etc/UPower/UPower.conf')
+_commit=402640bee016472bf61c7a4ad9e5fac9790ea1bf
+source=(git://anongit.freedesktop.org/upower#commit=$_commit
+ 0001-Add-a-critical-action-Ignore.patch)
+md5sums=('SKIP'
+ '69fbeb7e5906a59fd39f702d01f83815')
+
+pkgver() {
+ cd $_pkgname
+ git describe --tags | sed -e 's/UPOWER_//' -e 's/_/\./g' -e 's/-/+/g'
+}
+
+prepare() {
+ cd $_pkgname
+ patch -p1 < "$srcdir/0001-Add-a-critical-action-Ignore.patch"
+}
+
+build() {
+ cd $_pkgname
+
+ NOCONFIGURE=1 ./autogen.sh
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --libexecdir=/usr/lib/$_pkgname \
+ --disable-static
+ make
+}
+
+package() {
+ cd $_pkgname
+ make DESTDIR="$pkgdir" install
+}