summaryrefslogtreecommitdiff
path: root/community-testing/acpitool
diff options
context:
space:
mode:
Diffstat (limited to 'community-testing/acpitool')
-rw-r--r--community-testing/acpitool/PKGBUILD32
-rw-r--r--community-testing/acpitool/linux-3.0.patch18
-rw-r--r--community-testing/acpitool/sysfs-battery.patch50
3 files changed, 100 insertions, 0 deletions
diff --git a/community-testing/acpitool/PKGBUILD b/community-testing/acpitool/PKGBUILD
new file mode 100644
index 000000000..d9b079988
--- /dev/null
+++ b/community-testing/acpitool/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 57685 2011-11-01 09:10:22Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: Gerhard Brauer <gerhard.brauer@web.de>
+# Contributor: Milosz Piglas <archeofuture@gmail.com>
+
+pkgname=acpitool
+pkgver=0.5.1
+pkgrel=4
+pkgdesc="ACPI client - replacement for apm tool"
+url="http://sourceforge.net/projects/acpitool/"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=('gcc-libs')
+source=(http://downloads.sourceforge.net/sourceforge/acpitool/acpitool-$pkgver.tar.bz2
+ linux-3.0.patch
+ sysfs-battery.patch)
+md5sums=('9e4ec55201be0be71ffbc56d38b42b57'
+ 'eb149edb32be6cdf20a7d16beb3e9f70'
+ '8211c37dbf888b76388699b7c6098503')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ patch -p1 <$srcdir/linux-3.0.patch
+ patch -p1 <$srcdir/sysfs-battery.patch
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make prefix="$pkgdir/usr" install
+}
diff --git a/community-testing/acpitool/linux-3.0.patch b/community-testing/acpitool/linux-3.0.patch
new file mode 100644
index 000000000..ba454a0c2
--- /dev/null
+++ b/community-testing/acpitool/linux-3.0.patch
@@ -0,0 +1,18 @@
+diff -wbBur acpitool-0.5.1/src/acpitool.cpp acpitool-0.5.1.my/src/acpitool.cpp
+--- acpitool-0.5.1/src/acpitool.cpp 2009-08-13 23:37:48.000000000 +0400
++++ acpitool-0.5.1.my/src/acpitool.cpp 2011-08-11 21:53:17.000000000 +0400
+@@ -205,8 +205,12 @@
+ Kernel_24 = 1;
+ Kernel_26 = 0;
+ }
+-
+- if(strncmp(str,"2.6",3)==0)
++ else if(strncmp(str,"2.6",3)==0)
++ {
++ Kernel_24 = 0;
++ Kernel_26 = 1;
++ }
++ else
+ {
+ Kernel_24 = 0;
+ Kernel_26 = 1;
diff --git a/community-testing/acpitool/sysfs-battery.patch b/community-testing/acpitool/sysfs-battery.patch
new file mode 100644
index 000000000..11a58ecc5
--- /dev/null
+++ b/community-testing/acpitool/sysfs-battery.patch
@@ -0,0 +1,50 @@
+diff -wbBur acpitool-0.5.1/src/battery.cpp acpitool-0.5.1.my/src/battery.cpp
+--- acpitool-0.5.1/src/battery.cpp 2009-08-13 23:42:43.000000000 +0400
++++ acpitool-0.5.1.my/src/battery.cpp 2011-11-01 13:07:20.000000000 +0400
+@@ -781,45 +781,7 @@
+
+ int Count_Batteries_ProcFS()
+ {
+- DIR *battery_dir;
+- char *name, *dirname;
+- int t = 0;
+-
+- dirname = "/proc/acpi/battery/";
+- battery_dir = opendir(dirname);
+- if(battery_dir)
+- {
+- struct dirent **namelist;
+- int n = 0;
+-
+- n = scandir(dirname, &namelist, 0, alphasort);
+- if(n<0)
+- t = -1;
+- else
+- {
+- while(n--)
+- {
+- name = namelist[n]->d_name;
+- // skip . and .. //
+- if (!strcmp (".", name) || !strcmp ("..", name))
+- {
+- // do nothing
+- }
+- else
+- {
+- t++;
+- }
+- free(namelist[n]);
+- }
+- free(namelist);
+- }
+- }
+- else
+- {
+- t = 0;
+- }
+- closedir(battery_dir);
+- return t;
++ return 0;
+ }
+
+