diff --git a/testing/shadow/APKBUILD b/testing/shadow/APKBUILD
index 5be9e706d27e5d43ef99f1ceb543862d218ca16f..e7c4522eeffef5315f15a4982c14ab8cfdddc36c 100644
--- a/testing/shadow/APKBUILD
+++ b/testing/shadow/APKBUILD
@@ -7,9 +7,8 @@ pkgdesc="PAM-using login and passwd utilities (usermod / useradd / newuidmap etc
 url="http://pkg-shadow.alioth.debian.org/"
 arch="all"
 license="GPL"
-depends=
-depends_dev="linux-pam-dev"
-makedepends="$depends_dev"
+depends=""
+makedepends="linux-pam-dev"
 subpackages="$pkgname-doc $pkgname-dbg"
 source="http://pkg-shadow.alioth.debian.org/releases/shadow-$pkgver.tar.xz
 	login.pamd
@@ -17,55 +16,52 @@ source="http://pkg-shadow.alioth.debian.org/releases/shadow-$pkgver.tar.xz
 	cross-size-checks.patch
 	"
 options="suid"
-
-_builddir="$srcdir"/shadow-$pkgver
-prepare() {
-	local i
-	cd "$_builddir"
-	for i in $source; do
-		case $i in
-		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
-		esac
-	done
-}
+builddir="$srcdir/shadow-$pkgver"
 
 build() {
-	cd "$_builddir"
-	CFLAGS="$CFLAGS -O0"
-	./configure --prefix=/usr \
+	cd "$builddir"
+
+	CFLAGS="$CFLAGS -O0" ./configure --prefix=/usr \
 		--sysconfdir=/etc \
 		--mandir=/usr/share/man \
 		--infodir=/usr/share/info \
 		--localstatedir=/var \
-		--without-nscd \
 		--disable-nls \
+		--with-libpam \
+		--without-audit \
+		--without-selinux \
+		--without-acl \
+		--without-attr \
+		--without-tcb \
+		--without-nscd \
 		--without-group-name-max-length \
 		|| return 1
 	make || return 1
 }
 
 package() {
-	cd "$_builddir"
+	cd "$builddir"
+
 	make DESTDIR="$pkgdir" install || return 1
 
-	# do not install these pam.d files they are broken and outdated
-	# nologin is provided by util-linux
+	# Do not install these pam.d files they are broken and outdated.
+	# nologin is provided by util-linux.
 	rm "$pkgdir"/etc/pam.d/* \
 		"$pkgdir"/sbin/nologin \
 		|| return 1
 
-	# however, install our own for login
-	cp "$srcdir"/login.pamd "$pkgdir"/etc/pam.d/login
+	# However, install our own for login.
+	cp "$srcdir"/login.pamd "$pkgdir"/etc/pam.d/login || return 1
 
-	# /etc/login.defs is not very useful - replace it with a blank file
+	# /etc/login.defs is not very useful - replace it with a blank file.
 	rm "$pkgdir"/etc/login.defs
 	touch "$pkgdir"/etc/login.defs
 
-	# avoid conflict with man-pages
+	# Avoid conflict with man-pages.
 	rm "$pkgdir"/usr/share/man/man3/getspnam.3* \
 		"$pkgdir"/usr/share/man/man5/passwd.5* || return 1
 
-	# for unprivileged lxc containera
+	# Used e.g. for unprivileged LXC containers.
 	touch "$pkgdir"/etc/subuid
 	touch "$pkgdir"/etc/subgid
 }