From 867c8c7fa01f9292305a725612f87d98f5155830 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Thu, 14 Feb 2013 05:23:34 +0100
Subject: [PATCH 1/9] mutter: update to 3.6.3.

---
 srcpkgs/mutter/mutter-devel.template |  4 ----
 srcpkgs/mutter/template              | 12 ++++--------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/srcpkgs/mutter/mutter-devel.template b/srcpkgs/mutter/mutter-devel.template
index 5af1ec254f7..dee2376f593 100644
--- a/srcpkgs/mutter/mutter-devel.template
+++ b/srcpkgs/mutter/mutter-devel.template
@@ -3,10 +3,6 @@
 depends="gsettings-desktop-schemas>=3.6.0 gtk+3-devel>=3.6.0
  clutter-devel>=1.12 libX11-devel mutter-${version}_${revision}"
 short_desc="${sourcepkg} - development files"
-long_desc="${long_desc}
-
- This package contains files for development, headers, static libs, etc."
-
 noarch=yes
 
 do_install() {
diff --git a/srcpkgs/mutter/template b/srcpkgs/mutter/template
index 2e59d2679b5..38867bab351 100644
--- a/srcpkgs/mutter/template
+++ b/srcpkgs/mutter/template
@@ -1,6 +1,6 @@
 # Template file for 'mutter'
 pkgname=mutter
-version=3.6.2
+version=3.6.3
 revision=1
 subpackages="mutter-devel"
 build_style=gnu-configure
@@ -13,11 +13,7 @@ makedepends="pkg-config intltool gnome-doc-utils gobject-introspection
 fulldepends="zenity>=3.6.0 desktop-file-utils gsettings-desktop-schemas>=3.6.0"
 short_desc="Lightweight GTK+3 window manager"
 maintainer="Juan RP <xtraeme@gmail.com>"
+homepage="http://www.gnome.org"
+license="GPL-2"
 distfiles="${GNOME_SITE}/$pkgname/3.6/$pkgname-$version.tar.xz"
-checksum=924f47681c972c3e8da610608c6aef35e61f52b338b5690e5721ed7ef8c2befc
-long_desc="
- Mutter is a small window manager, using GTK+ and Clutter to do everything.
-
- Mutter is the clutter-based evolution of Metacity, which, as the author says,
- is a 'Boring window manager for the adult in you. Many window managers are
- like Marshmallow Froot Loops; Metacity is like Cheerios.'"
+checksum=aa1d558210d58f9a835a7e718a6b6eb8318ac8fb276c43234c47b1efde755c86

From 08fc6a1e4dacdcf63f1a30161a5ca811d3d3d68f Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Thu, 14 Feb 2013 05:35:40 +0100
Subject: [PATCH 2/9] mutter: remove dup build deps and obsolete configure
 args.

---
 srcpkgs/mutter/template | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/mutter/template b/srcpkgs/mutter/template
index 38867bab351..0ed25f8d309 100644
--- a/srcpkgs/mutter/template
+++ b/srcpkgs/mutter/template
@@ -4,13 +4,11 @@ version=3.6.3
 revision=1
 subpackages="mutter-devel"
 build_style=gnu-configure
-configure_args="--disable-scrollkeeper --disable-schemas-compile
- --disable-static"
+configure_args="--disable-schemas-compile --disable-static"
 makedepends="pkg-config intltool gnome-doc-utils gobject-introspection
  gtk+3-devel>=3.6.0_2 startup-notification-devel libcanberra-devel
- clutter-devel>=1.12 libgirepository-devel json-glib-devel libffi-devel
- gsettings-desktop-schemas-devel>=3.6.0"
-fulldepends="zenity>=3.6.0 desktop-file-utils gsettings-desktop-schemas>=3.6.0"
+ clutter-devel>=1.12 gsettings-desktop-schemas-devel>=3.6.0"
+fulldepends="zenity>=3.6.0 desktop-file-utils"
 short_desc="Lightweight GTK+3 window manager"
 maintainer="Juan RP <xtraeme@gmail.com>"
 homepage="http://www.gnome.org"

From 1492393e25c10fc7e50cb834b299d3f96204b813 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Thu, 14 Feb 2013 05:45:19 +0100
Subject: [PATCH 3/9] gnome-shell: update to 3.6.3.

---
 srcpkgs/gnome-shell/template | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/srcpkgs/gnome-shell/template b/srcpkgs/gnome-shell/template
index 4f629a8e4c3..3d639cfe7d3 100644
--- a/srcpkgs/gnome-shell/template
+++ b/srcpkgs/gnome-shell/template
@@ -1,30 +1,23 @@
 # Template file for 'gnome-shell'
 pkgname=gnome-shell
-version=3.6.2
+version=3.6.3
 revision=1
 build_style=gnu-configure
 configure_args="--disable-schemas-compile --with-systemd"
 depends="caribou pulseaudio mesa-demos desktop-file-utils"
 makedepends="pkg-config intltool gnome-doc-utils gobject-introspection
  json-glib-devel>=0.14.0 startup-notification-devel network-manager-applet-devel
- folks-devel gnome-menus-devel>=3.6.0 gnome-desktop-devel>=3.6.0 gcr-devel>=3.6.0
- cogl-devel>=1.12 clutter-devel>=1.12 gnome-bluetooth-devel>=3.6.0 mutter-devel>=3.6.0
+ folks-devel gnome-menus-devel>=3.6.0 gnome-desktop-devel>=3.6.0
+ clutter-devel>=1.12 gnome-bluetooth-devel>=3.6.0 mutter-devel>=3.6.0
  gjs-devel telepathy-logger-devel libcanberra-devel polkit-devel libcroco-devel
- pulseaudio-devel libgnome-keyring-devel>=3.6.0 libgudev-devel
- gst-plugins-base1-devel systemd-devel"
-fulldepends="gir-freedesktop"
+ pulseaudio-devel libgudev-devel gst-plugins-base1-devel systemd-devel"
+fulldepends="gir-freedesktop gnome-control-center>=3.6.0"
 short_desc="GNOME core user interface"
 maintainer="Juan RP <xtraeme@gmail.com>"
 homepage="http://live.gnome.org/GnomeShell"
 license="GPL-2"
 distfiles="${GNOME_SITE}/$pkgname/3.6/$pkgname-$version.tar.xz"
-checksum=86cff93ade1bf6a67ebd339c017d567c7dc849ff8b256a3803306f44c24b44f0
-long_desc="
- GNOME Shell provides core user interface functions for the GNOME 3 desktop,
- like switching to windows and launching applications. GNOME Shell takes
- advantage of the capabilities of modern graphics hardware and introduces
- innovative user interface concepts to provide a visually attractive and
- easy to use experience."
+checksum=05b2341a0f84835644881743873d3eaccaed12f00aa7b424d876780e81723db2
 
 post_install() {
 	rm -rf ${DESTDIR}/usr/share/gtk-doc

From f868d49104ec77ad131da3ccb2d211042ac58846 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Thu, 14 Feb 2013 05:48:10 +0100
Subject: [PATCH 4/9] nginx: update to 1.2.7.

---
 srcpkgs/nginx/template | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/nginx/template b/srcpkgs/nginx/template
index 91778db797c..8d45de83018 100644
--- a/srcpkgs/nginx/template
+++ b/srcpkgs/nginx/template
@@ -1,17 +1,14 @@
 # Template file for 'nginx'
 pkgname=nginx
-version=1.2.6
+version=1.2.7
 revision=1
 makedepends="pcre-devel>=8.30 openssl-devel"
-short_desc="A high performance web server and a reverse proxy server"
+short_desc="A high performance web and reverse proxy server"
 maintainer="Juan RP <xtraeme@gmail.com>"
 license="Simplified BSD"
 homepage="http://nginx.org"
 distfiles="http://nginx.org/download/nginx-$version.tar.gz"
-checksum=0510af71adac4b90484ac8caf3b8bd519a0f7126250c2799554d7a751a2db388
-long_desc="
- Sed, the GNU Stream Editor, copies the named files (standard input default)
- to the standard output, edited according to a script of commands."
+checksum=2457a878943fb409ec4fcb46b43af222d06a584f93228e17a4f02b0e7bfc9de3
 
 conf_files="
 /etc/nginx/fastcgi.conf

From c6919edaa9621ab297c2013260a275e154abe1b0 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Thu, 14 Feb 2013 06:01:52 +0100
Subject: [PATCH 5/9] postfix: update to 2.10.0.

---
 srcpkgs/postfix/template | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/postfix/template b/srcpkgs/postfix/template
index 199a28301c1..293fa0cf681 100644
--- a/srcpkgs/postfix/template
+++ b/srcpkgs/postfix/template
@@ -1,6 +1,6 @@
 # Template file for 'postfix'
 pkgname=postfix
-version=2.9.5
+version=2.10.0
 revision=1
 makedepends="perl openssl-devel db-devel pcre-devel>=8.30 libsasl-devel
  libldap-devel libmysqlclient-devel>=5.5.27 postgresql-libs-devel sqlite-devel"
@@ -9,13 +9,7 @@ maintainer="Juan RP <xtraeme@gmail.com>"
 license="IBM Public License 1.0, BSD-alike"
 homepage="http://www.postfix.org/"
 distfiles="ftp://ftp.porcupine.org/mirrors/postfix-release/official/$pkgname-$version.tar.gz"
-checksum=590381cc0705a6d3fd2279760e79aff625adab6000cb895cf5336ae6a11ee6e4
-long_desc="
- It is Wietse Venema's mail server that started life at IBM research as an
- alternative to the widely-used Sendmail program.
-
- Postfix attempts to be fast, easy to administer, and secure. The outside has
- a definite Sendmail-ish flavor, but the inside is completely different."
+checksum=4a42a6029af418cbd4a8668b4f8c7e1ea9975cbe9756df760649c0a941bfeb7b
 
 conf_files="
 /etc/postfix/access
@@ -55,7 +49,6 @@ system_groups="postdrop"
 provides="smtp-server-0"
 replaces="smtp-server>=0"
 
-
 do_build() {
 	make makefiles DEBUG='' CCARGS=' \
 		-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl \

From a1cda96b29abb9a532d3b1a3676a4d00d32d9fdc Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Thu, 14 Feb 2013 06:57:10 +0100
Subject: [PATCH 6/9] powertop: merge some patches for bugfixes from Fedora.

---
 .../powertop-2.0-always-create-params.patch   |  34 ++++
 ...owertop-2.2-fix-crash-on-readonly-fs.patch |  41 +++++
 .../patches/powertop-2.2-gpu-wiggle-fix.patch |  11 ++
 .../powertop-2.2-reduce-syscalls.patch        | 149 ++++++++++++++++++
 .../patches/powertop-2.2-version-fix.patch    |  34 ++++
 srcpkgs/powertop/template                     |   2 +-
 6 files changed, 270 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/powertop/patches/powertop-2.0-always-create-params.patch
 create mode 100644 srcpkgs/powertop/patches/powertop-2.2-fix-crash-on-readonly-fs.patch
 create mode 100644 srcpkgs/powertop/patches/powertop-2.2-gpu-wiggle-fix.patch
 create mode 100644 srcpkgs/powertop/patches/powertop-2.2-reduce-syscalls.patch
 create mode 100644 srcpkgs/powertop/patches/powertop-2.2-version-fix.patch

diff --git a/srcpkgs/powertop/patches/powertop-2.0-always-create-params.patch b/srcpkgs/powertop/patches/powertop-2.0-always-create-params.patch
new file mode 100644
index 00000000000..44b8ad3a786
--- /dev/null
+++ b/srcpkgs/powertop/patches/powertop-2.0-always-create-params.patch
@@ -0,0 +1,34 @@
+--- src/parameters/persistent.cpp.orig	2012-05-04 18:03:54.000000000 +0200
++++ src/parameters/persistent.cpp	2012-05-16 21:29:24.785390730 +0200
+@@ -129,9 +129,6 @@ void save_parameters(const char *filenam
+ 
+ //	printf("result size is %i, #parameters is %i \n", (int)past_results.size(), (int)all_parameters.parameters.size());
+ 
+-	if (!global_power_valid())
+-		return;
+-
+ 	pathname = get_param_directory(filename);
+ 
+ 	file.open(pathname, ios::out);
+@@ -140,12 +137,15 @@ void save_parameters(const char *filenam
+ 		return;
+ 	}
+ 
+-	map<string, int>::iterator it;
+-
+-	for (it = param_index.begin(); it != param_index.end(); it++) {
+-		int index;
+-		index = it->second;
+-		file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n";
++	if (global_power_valid())
++	{
++		map<string, int>::iterator it;
++
++		for (it = param_index.begin(); it != param_index.end(); it++) {
++			int index;
++			index = it->second;
++			file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n";
++		}
+ 	}
+ 	file.close();
+ }
diff --git a/srcpkgs/powertop/patches/powertop-2.2-fix-crash-on-readonly-fs.patch b/srcpkgs/powertop/patches/powertop-2.2-fix-crash-on-readonly-fs.patch
new file mode 100644
index 00000000000..573ceb321c5
--- /dev/null
+++ b/srcpkgs/powertop/patches/powertop-2.2-fix-crash-on-readonly-fs.patch
@@ -0,0 +1,41 @@
+From bd72b4433fec358801afebf3f02ab899b1745c5f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
+Date: Wed, 28 Nov 2012 16:31:38 +0100
+Subject: [PATCH] report: fixed crash when writing report to RO filesystem
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
+---
+ src/report/report.cpp | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/src/report/report.cpp b/src/report/report.cpp
+index 51bc6a7..c018bb1 100644
+--- src/report/report.cpp
++++ src/report/report.cpp
+@@ -183,13 +183,16 @@ void init_report_output(char *filename_str, int iterations)
+ 
+ void finish_report_output(void)
+ {
+-	fprintf(stderr, _("PowerTOP outputing using base filename %s\n"), reportout.filename);
+ 	if (reporttype == REPORT_OFF)
+ 		return;
+ 
+ 	report.finish_report();
+-	fputs(report.get_result(), reportout.report_file);
+-	fdatasync(fileno(reportout.report_file));
+-	fclose(reportout.report_file);
++	if (reportout.report_file)
++	{
++		fprintf(stderr, _("PowerTOP outputing using base filename %s\n"), reportout.filename);
++		fputs(report.get_result(), reportout.report_file);
++		fdatasync(fileno(reportout.report_file));
++		fclose(reportout.report_file);
++	}
+ 	report.clear_result();
+ }
+-- 
+1.7.11.7
+
diff --git a/srcpkgs/powertop/patches/powertop-2.2-gpu-wiggle-fix.patch b/srcpkgs/powertop/patches/powertop-2.2-gpu-wiggle-fix.patch
new file mode 100644
index 00000000000..6c549a88a6a
--- /dev/null
+++ b/srcpkgs/powertop/patches/powertop-2.2-gpu-wiggle-fix.patch
@@ -0,0 +1,11 @@
+diff --git a/src/cpu/intel_cpus.h b/src/cpu/intel_cpus.h
+index 1949af1..752e8d0 100644
+--- src/cpu/intel_cpus.h
++++ src/cpu/intel_cpus.h
+@@ -158,5 +158,6 @@ public:
+ 	virtual char *  fill_cstate_line(int line_nr, char *buffer, const char *separator);
+ 	virtual int	has_pstate_level(int level) { return 0; };
+ 	virtual int	has_pstates(void) { return 0; };
++	virtual void	wiggle(void) { };
+ 
+ };
diff --git a/srcpkgs/powertop/patches/powertop-2.2-reduce-syscalls.patch b/srcpkgs/powertop/patches/powertop-2.2-reduce-syscalls.patch
new file mode 100644
index 00000000000..ffe9c151562
--- /dev/null
+++ b/srcpkgs/powertop/patches/powertop-2.2-reduce-syscalls.patch
@@ -0,0 +1,149 @@
+From 63b20549280e606e5e73d5c9fe701c79a5abc6cf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
+Date: Wed, 12 Dec 2012 16:19:56 +0100
+Subject: [PATCH] Reduced number of useless 'open' syscalls
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There are called many useless 'open' syscalls that always fail, like:
+  open("/sys/devices/system/cpu/uevent/cpufreq/scaling_governor", O_RDONLY) = -1 ENOTDIR (Not a directory)
+This patch filters them to 'likely' patterns, like e.g.:
+/sys/devices/system/cpu/cpuX/cpufreq/scaling_governor, where X is string
+starting with digit. For match cases it will add only small overhead.
+
+Originally reported as:
+https://bugzilla.redhat.com/show_bug.cgi?id=886185
+
+Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
+---
+ src/devices/alsa.cpp       |  2 +-
+ src/devices/backlight.cpp  |  2 ++
+ src/devlist.cpp            |  3 ++-
+ src/tuning/cpufreq.cpp     | 11 ++++++-----
+ src/tuning/tuningsysfs.cpp |  5 +----
+ 5 files changed, 12 insertions(+), 11 deletions(-)
+
+diff --git a/src/devices/alsa.cpp b/src/devices/alsa.cpp
+index 4f5d3f9..33a52f5 100644
+--- src/devices/alsa.cpp
++++ src/devices/alsa.cpp
+@@ -167,7 +167,7 @@ void create_all_alsa(void)
+ 		entry = readdir(dir);
+ 		if (!entry)
+ 			break;
+-		if (entry->d_name[0] == '.')
++		if (strncmp(entry->d_name, "hwC", 3) != 0)
+ 			continue;
+ 		sprintf(filename, "/sys/class/sound/card0/%s/power_on_acct", entry->d_name);
+ 
+diff --git a/src/devices/backlight.cpp b/src/devices/backlight.cpp
+index b8c9147..03aa5bc 100644
+--- src/devices/backlight.cpp
++++ src/devices/backlight.cpp
+@@ -90,6 +90,8 @@ static int dpms_screen_on(void)
+ 		if (!entry)
+ 			break;
+ 
++		if (strncmp(entry->d_name, "card", 4) != 0)
++			continue;
+ 		sprintf(filename, "/sys/class/drm/card0/%s/enabled", entry->d_name);
+ 		file.open(filename, ios::in);
+ 		if (!file)
+diff --git a/src/devlist.cpp b/src/devlist.cpp
+index de5abff..633a568 100644
+--- src/devlist.cpp
++++ src/devlist.cpp
+@@ -37,6 +37,7 @@
+ #include <sys/types.h>
+ #include <dirent.h>
+ #include <string.h>
++#include <ctype.h>
+ 
+ using namespace std;
+ 
+@@ -117,7 +118,7 @@ void collect_open_devices(void)
+ 			entry2 = readdir(dir2);
+ 			if (!entry2)
+ 				break;
+-			if (entry2->d_name[0] == '.')
++			if (!isdigit(entry2->d_name[0]))
+ 				continue;
+ 			sprintf(filename, "/proc/%s/fd/%s", entry->d_name, entry2->d_name);
+ 			memset(link, 0, 4096);
+diff --git a/src/tuning/cpufreq.cpp b/src/tuning/cpufreq.cpp
+index df245ad..e870559 100644
+--- src/tuning/cpufreq.cpp
++++ src/tuning/cpufreq.cpp
+@@ -36,6 +36,7 @@
+ #include <dirent.h>
+ #include <errno.h>
+ #include <sys/stat.h>
++#include <ctype.h>
+ 
+ #include "../lib.h"
+ #include "cpufreq.h"
+@@ -72,7 +73,7 @@ int cpufreq_tunable::good_bad(void)
+ 		return ret;
+ 
+ 	while ((dirent = readdir(dir))) {
+-		if (dirent->d_name[0]=='.')
++		if (strncmp(dirent->d_name, "cpu", 3) != 0 || !isdigit(dirent->d_name[3]))
+ 			continue;
+ 		sprintf(filename, "/sys/devices/system/cpu/%s/cpufreq/scaling_governor", dirent->d_name);
+ 		file = fopen(filename, "r");
+@@ -123,7 +124,7 @@ void cpufreq_tunable::toggle(void)
+ 			return;
+ 
+ 		while ((dirent = readdir(dir))) {
+-			if (dirent->d_name[0]=='.')
++			if (strncmp(dirent->d_name, "cpu", 3) != 0 || !isdigit(dirent->d_name[3]))
+ 				continue;
+ 			sprintf(filename, "/sys/devices/system/cpu/%s/cpufreq/scaling_governor", dirent->d_name);
+ 			file = fopen(filename, "w");
+@@ -141,7 +142,7 @@ void cpufreq_tunable::toggle(void)
+ 		return;
+ 
+ 	while ((dirent = readdir(dir))) {
+-		if (dirent->d_name[0]=='.')
++		if (strncmp(dirent->d_name, "cpu", 3) != 0 || !isdigit(dirent->d_name[3]))
+ 			continue;
+ 		sprintf(filename, "/sys/devices/system/cpu/%s/cpufreq/scaling_governor", dirent->d_name);
+ 		file = fopen(filename, "w");
+@@ -171,7 +172,7 @@ const char *cpufreq_tunable::toggle_script(void) {
+ 			return NULL;
+ 
+ 		while ((dirent = readdir(dir))) {
+-			if (dirent->d_name[0]=='.')
++			if (strncmp(dirent->d_name, "cpu", 3) != 0 || !isdigit(dirent->d_name[3]))
+ 				continue;
+ 			sprintf(filename, "/sys/devices/system/cpu/%s/cpufreq/scaling_governor", dirent->d_name);
+ 			if (stat(filename, &statbuf) == -1)
+@@ -189,7 +190,7 @@ const char *cpufreq_tunable::toggle_script(void) {
+ 		return NULL;
+ 
+ 	while ((dirent = readdir(dir))) {
+-		if (dirent->d_name[0]=='.')
++		if (strncmp(dirent->d_name, "cpu", 3) != 0 || !isdigit(dirent->d_name[3]))
+ 			continue;
+ 		sprintf(filename, "/sys/devices/system/cpu/%s/cpufreq/scaling_governor", dirent->d_name);
+ 		if (stat(filename, &statbuf) == -1)
+diff --git a/src/tuning/tuningsysfs.cpp b/src/tuning/tuningsysfs.cpp
+index 33d3786..ec1ca6b 100644
+--- src/tuning/tuningsysfs.cpp
++++ src/tuning/tuningsysfs.cpp
+@@ -131,10 +131,7 @@ void add_sata_tunables(void)
+ 		if (!entry)
+ 			break;
+ 
+-                if (strcmp(entry->d_name, ".") == 0)
+-                        continue;
+-
+-		if (strcmp(entry->d_name, "..") == 0)
++		if (entry->d_name[0] == '.')
+ 			continue;
+ 
+ 		sprintf(filename, "/sys/class/scsi_host/%s/link_power_management_policy", entry->d_name);
+-- 
+1.7.11.7
+
diff --git a/srcpkgs/powertop/patches/powertop-2.2-version-fix.patch b/srcpkgs/powertop/patches/powertop-2.2-version-fix.patch
new file mode 100644
index 00000000000..1021d085d35
--- /dev/null
+++ b/srcpkgs/powertop/patches/powertop-2.2-version-fix.patch
@@ -0,0 +1,34 @@
+From: Namhyung Kim <namhyung@gmail.com>
+To: powertop@lists.01.org
+Date: Sun, 18 Nov 2012 00:42:47 +0900
+Message-Id: <1353166967-24095-1-git-send-email-namhyung@gmail.com>
+Subject: [Powertop] [PATCH] Use PACKAGE_VERSION for POWERTOP_VERSION
+
+It was missed to update POWERTOP_VERSION macro so that the
+new v2.2 release still shows v2.1 string on the header of
+ncurses window.  Convert to use PACKAGE_VERSION macro which
+set by autotools to the AC_INIT version so that it cannot
+be missed anymore.
+
+Signed-off-by: Namhyung Kim <namhyung@gmail.com>
+---
+ src/lib.h |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/lib.h b/src/lib.h
+index 8cf4632..209421a 100644
+--- src/lib.h
++++ src/lib.h
+@@ -35,8 +35,8 @@
+ 
+ #define _(STRING)    gettext(STRING)
+ 
+-#define POWERTOP_VERSION "v2.1"
+-#define POWERTOP_SHORT_VERSION "2.1"
++#define POWERTOP_VERSION "v"PACKAGE_VERSION
++#define POWERTOP_SHORT_VERSION PACKAGE_VERSION
+ 
+ 
+ extern int get_max_cpu(void);
+-- 
+1.7.9.2
diff --git a/srcpkgs/powertop/template b/srcpkgs/powertop/template
index 23eb77ac916..3d4c72343c4 100644
--- a/srcpkgs/powertop/template
+++ b/srcpkgs/powertop/template
@@ -1,7 +1,7 @@
 # Template file for 'powertop'
 pkgname=powertop
 version=2.2
-revision=1
+revision=2
 build_style=gnu-configure
 makedepends="pkg-config ncurses-devel pciutils-devel libnl3-devel"
 short_desc="Linux tool to find out what is using power on computer"

From 0678da62e48d7e2c6bc4e25fcfd510d34b976f56 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Thu, 14 Feb 2013 07:10:15 +0100
Subject: [PATCH 7/9] nvidia304: fix module building on kernels up to .20.

---
 srcpkgs/nvidia304/nvidia304-dkms.template   | 2 --
 srcpkgs/nvidia304/nvidia304-opencl.template | 2 --
 srcpkgs/nvidia304/template                  | 7 +++----
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/nvidia304/nvidia304-dkms.template b/srcpkgs/nvidia304/nvidia304-dkms.template
index 596835ced3d..36c75bcd014 100644
--- a/srcpkgs/nvidia304/nvidia304-dkms.template
+++ b/srcpkgs/nvidia304/nvidia304-dkms.template
@@ -1,8 +1,6 @@
 # Template file for 'nvidia304-dkms'.
 #
 short_desc="NVIDIA drivers for linux (304.xx series) -- DKMS kernel module"
-long_desc="
- This package contains the NVIDIA non free kernel module files for DKMS."
 
 nonfree=yes
 triggers="dkms"
diff --git a/srcpkgs/nvidia304/nvidia304-opencl.template b/srcpkgs/nvidia304/nvidia304-opencl.template
index 44497923306..aba8c016fe1 100644
--- a/srcpkgs/nvidia304/nvidia304-opencl.template
+++ b/srcpkgs/nvidia304/nvidia304-opencl.template
@@ -1,8 +1,6 @@
 # Template file for 'nvidia304-opencl'.
 #
 short_desc="NVIDIA drivers for linux (304.xx series) -- OpenCL implementation"
-long_desc="
- This package contains the NVIDIA non free OpenCL implementation."
 
 nonfree=yes
 provides="nvidia-opencl-${version} libOpenCL-${version}"
diff --git a/srcpkgs/nvidia304/template b/srcpkgs/nvidia304/template
index 2af02a1fe9b..85575b6ec98 100644
--- a/srcpkgs/nvidia304/template
+++ b/srcpkgs/nvidia304/template
@@ -1,14 +1,11 @@
 # Template file for 'nvidia304'
 pkgname=nvidia304
 version=304.64
-revision=3
+revision=4
 short_desc="NVIDIA drivers for linux (304.xx series) -- libraries and utilities"
 maintainer="Juan RP <xtraeme@gmail.com>"
 license="Propietary NVIDIA license"
 homepage="http://www.nvidia.com"
-long_desc="
- This package contains the non free NVIDIA libraries and utilities for
- the propietary NVIDIA driver for the Linux kernel."
 
 create_wrksrc=yes
 noextract=yes
@@ -39,6 +36,8 @@ do_extract() {
 do_install() {
 	cd ${_pkg}
 
+	sed -i -e "s,\(SUBLEVEL -le\) 5,\1 20," kernel/conftest.sh
+
 	# X driver
 	vinstall nvidia_drv.so 755 usr/lib/xorg/modules/drivers
 

From d288ccfed6ba50d78fd738f1ea6abf5c0d6627ea Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Thu, 14 Feb 2013 07:30:09 +0100
Subject: [PATCH 8/9] xbps-src: bump version.

---
 srcpkgs/xbps-src/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xbps-src/template b/srcpkgs/xbps-src/template
index c02c625143a..f92abfba0a9 100644
--- a/srcpkgs/xbps-src/template
+++ b/srcpkgs/xbps-src/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-src'
 pkgname=xbps-src
-version=20130213
+version=20130214
 revision=1
 build_style=gnu-makefile
 make_build_args="PREFIX=/usr ETCDIR=/etc/xbps"

From e9a3d955473660373e103b5db78c549f29eb5c02 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Thu, 14 Feb 2013 07:36:52 +0100
Subject: [PATCH 9/9] xbps-src: revbump++.

---
 srcpkgs/xbps-src/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xbps-src/template b/srcpkgs/xbps-src/template
index f92abfba0a9..3acdfd144e1 100644
--- a/srcpkgs/xbps-src/template
+++ b/srcpkgs/xbps-src/template
@@ -1,7 +1,7 @@
 # Template file for 'xbps-src'
 pkgname=xbps-src
 version=20130214
-revision=1
+revision=2
 build_style=gnu-makefile
 make_build_args="PREFIX=/usr ETCDIR=/etc/xbps"
 make_install_args="PREFIX=/usr ETCDIR=/etc/xbps"