diff --git a/main/abuild/APKBUILD b/main/abuild/APKBUILD
index 7eb2a825847b4618e2378e34842eb52f695e333e..c498b6cb2b1d9988e6b958b0009dbfbbf50730cc 100644
--- a/main/abuild/APKBUILD
+++ b/main/abuild/APKBUILD
@@ -1,8 +1,9 @@
 # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
 pkgdesc="Script to build Alpine Packages"
 pkgname=abuild
-pkgver=2.12.1
-pkgrel=9
+pkgver=2.12.1_git20120919
+_ver=${pkgver%_git*}
+pkgrel=0
 url=http://git.alpinelinux.org/cgit/abuild/
 depends="fakeroot file sudo pax-utils openssl apk-tools>=2.0.7-r1 uclibc-utils
 	abuildhelper curl"
@@ -12,11 +13,12 @@ subpackages="apkbuild-cpan:cpan"
 pkggroups="abuild"
 arch="all"
 license=GPL-2
-source="http://git.alpinelinux.org/cgit/abuild/snapshot/abuild-$pkgver.tar.bz2
+source="http://git.alpinelinux.org/cgit/abuild/snapshot/abuild-$_ver.tar.bz2
 	abuild-git.patch"
 
+_builddir="$srcdir/$pkgname-$_ver"
 prepare() {
-	cd "$srcdir/$pkgname-$pkgver"
+	cd "$_builddir"
 	for i in $source; do
 		case $i in
 		*.patch)
@@ -30,12 +32,12 @@ prepare() {
 }
 
 build() {
-	cd "$srcdir/$pkgname-$pkgver"
+	cd "$_builddir"
 	make
 }
 
 package() {
-	cd "$srcdir/$pkgname-$pkgver"
+	cd "$_builddir"
 	make install DESTDIR="$pkgdir"
 	install -m 644 abuild.conf "$pkgdir"/etc/abuild.conf
 	install -d -m 775 -g abuild "$pkgdir"/var/cache/distfiles
@@ -50,4 +52,4 @@ cpan() {
 }
 
 md5sums="92348750a3354c3ec7b811716543b8e5  abuild-2.12.1.tar.bz2
-90018b9a6e428de018cdd7ff868ebf85  abuild-git.patch"
+896303f1bf063284ce663f6e506fdacd  abuild-git.patch"
diff --git a/main/abuild/abuild-git.patch b/main/abuild/abuild-git.patch
index 264952ac2bbd1f8eb44df9338f78d069556bb197..559be6cf7d1f832e18eff14c4875d03e021b968e 100644
--- a/main/abuild/abuild-git.patch
+++ b/main/abuild/abuild-git.patch
@@ -1,5 +1,5 @@
 diff --git a/abuild.in b/abuild.in
-index 2780d2e..b2e0197 100755
+index 2780d2e..e885dd9 100755
 --- a/abuild.in
 +++ b/abuild.in
 @@ -404,6 +404,9 @@ default_unpack() {
@@ -140,7 +140,7 @@ index 2780d2e..b2e0197 100755
 +			;;
 +		esac
 +		echo "$soname $sover"
-+	done > "$controldir"/.provides-so
++	done | sort -u > "$controldir"/.provides-so
 +
 +	# now find the so dependencies
 +	scanelf --nobanner --recursive --needed "$datadir"  | tr ' ' ':' \