diff --git a/spki/ChangeLog b/spki/ChangeLog
index c7f69c88dc3365eedec2107ecf2329bfd3494a60..4aa0ce1f7a61d34bd633669c979ad94d0588c681 100644
--- a/spki/ChangeLog
+++ b/spki/ChangeLog
@@ -1,5 +1,28 @@
 2012-07-13  Niels Möller  <nisse@lysator.liu.se>
 
+	Always use the installed nettle library, don't look for it in the
+	build tree.
+	* configure.ac: Use a regular AC_CHECK_LIB to check for nettle.
+	Deleted check for nettle_buildir.
+	* certificate.h, certificate.c: Use angles, <>, when including
+	nettle header files.
+	* parse.h, parse-transport.c, parse.c: Likewise.
+	* tag.h, tag.c, verify,c: Likewise.
+	* testsuite/testutils.h: Likewise.
+	* Makefile.in (PRE_CPPFLAGS): Delete reference to nettle_buildir.
+	(PRE_LDFLAGS): Deleted.
+ 	* testsuite/Makefile.in (PRE_CPPFLAGS): Delete reference to
+	nettle_buildir.
+	(PRE_LDFLAGS): Likewise.
+	(check): Don't set LD_LIBRARY_PATH (used to point at
+	nettle_buildir/.lib).
+	* tools/Makefile.in (PRE_CPPFLAGS): Delete reference to nettle_buildir.
+	(PRE_LDFLAGS): Likewise.
+	* testsuite/check-signature-test: Use installed sexp-conv.
+	* testsuite/delegate-test: Likewise.
+	* testsuite/make-signature-test: Likewise.
+	* testsuite/reduce-test: Likewise.
+
 	* Fixed copyright headers on many files, used to say "The nettle
 	library is free software". Now refers to the "libspki library"
 	instead.
diff --git a/spki/Makefile.in b/spki/Makefile.in
index 4d225374ee97119f6340f789039a5a238cdf6224..75bae3c184aeba32e7d89b94984cb2efb2cc8591 100644
--- a/spki/Makefile.in
+++ b/spki/Makefile.in
@@ -14,8 +14,7 @@ MKDIR_P = @MKDIR_P@
 
 SUBDIRS = tools testsuite
 
-PRE_CPPFLAGS = -I. -I$(srcdir) -Inettle_builddir
-PRE_LDFLAGS = -Lnettle_builddir
+PRE_CPPFLAGS = -I. -I$(srcdir)
 
 include config.make
 
diff --git a/spki/certificate.c b/spki/certificate.c
index b68ada72f087f02b4ee2087074233677703a2dbf..72988300b22385fc1cec4a4c9178ad1027867382 100644
--- a/spki/certificate.c
+++ b/spki/certificate.c
@@ -28,9 +28,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "nettle/md5.h"
-#include "nettle/sha.h"
-#include "nettle/sexp.h"
+#include <nettle/md5.h>
+#include <nettle/sha.h>
+#include <nettle/sexp.h>
 
 #include "certificate.h"
 #include "parse.h"
diff --git a/spki/certificate.h b/spki/certificate.h
index 014f62c6748cac282352d24703fdbd972bb91883..56330435e5a93c6044cd6306e63e40998b934277 100644
--- a/spki/certificate.h
+++ b/spki/certificate.h
@@ -24,10 +24,10 @@
 #define LIBSPKI_CERTIFICATE_H_INCLUDED
 
 
-#include "nettle/md5.h"
-#include "nettle/sha.h"
-#include "nettle/realloc.h"
-#include "nettle/buffer.h"
+#include <nettle/md5.h>
+#include <nettle/sha.h>
+#include <nettle/realloc.h>
+#include <nettle/buffer.h>
 
 /* This should be the only file ever including spki-types.h
  * directly. */
diff --git a/spki/configure.ac b/spki/configure.ac
index 9314bfa4ac4ef1f9635747d7127eb309677863a2..8b3a46667fe2ca1ac4bf91f0314099f219d219da 100644
--- a/spki/configure.ac
+++ b/spki/configure.ac
@@ -73,10 +73,11 @@ AC_CHECK_LIB(gmp, __gmpz_getlimbn,,
 # Add -R flags needed to run programs linked with gmp
 LSH_RPATH_FIX
 
-if test -d nettle_buildir; then
-  CPPFLAGS="$CCPFLAGS -Inettle_builddir"
-  LD_FLAGS="$LDFLAGS -Lnettle_builddir"
-fi
+AC_CHECK_LIB(nettle, nettle_sha1_digest,,
+    [AC_MSG_ERROR(
+    [Nettle library not found. See http://www.lysator.liu.se/~nisse/nettle/.])])
+
+LSH_RPATH_FIX
 
 # Set these flags *last*, or else the test programs won't compile
 if test x$GCC = xyes ; then
diff --git a/spki/parse-transport.c b/spki/parse-transport.c
index 911abf18424d73cf062b06afa0f8e41f1ec3ba8c..d54a0819b40de576ce4df5846a13099d96ca558e 100644
--- a/spki/parse-transport.c
+++ b/spki/parse-transport.c
@@ -26,7 +26,7 @@
 
 #include "parse.h"
 
-#include "nettle/sexp.h"
+#include <nettle/sexp.h>
 
 enum spki_type
 spki_transport_iterator_first(struct spki_iterator *i,
diff --git a/spki/parse.c b/spki/parse.c
index 5ce7b3c19ac0df79855fb3a98795d92905b76e1f..fb36dd5762744267a9ffb23558221ac5881b8183 100644
--- a/spki/parse.c
+++ b/spki/parse.c
@@ -27,7 +27,7 @@
 #include <assert.h>
 #include <string.h>
 
-#include "nettle/sexp.h"
+#include <nettle/sexp.h>
 
 #include "parse.h"
 #include "tag.h"
diff --git a/spki/parse.h b/spki/parse.h
index ee13c55029305b6317958b9cd2560c0149a04efc..6f44bbd01eb5a723c194fc70209109ff91930f3a 100644
--- a/spki/parse.h
+++ b/spki/parse.h
@@ -23,7 +23,7 @@
 #ifndef LIBSPKI_PARSE_H_INCLUDED
 #define LIBSPKI_PARSE_H_INCLUDED
 
-#include "nettle/sexp.h"
+#include <nettle/sexp.h>
 
 #include "certificate.h"
 
diff --git a/spki/tag.c b/spki/tag.c
index e2a9228a4479b2178b3275ee12654c426ce3d7ea..f3c354fea204dfccf7b3638c9beabdb79d1557d6 100644
--- a/spki/tag.c
+++ b/spki/tag.c
@@ -30,8 +30,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "nettle/buffer.h"
-#include "nettle/sexp.h"
+#include <nettle/buffer.h>
+#include <nettle/sexp.h>
 
 #include "tag.h"
 
diff --git a/spki/tag.h b/spki/tag.h
index 5f84449980937d023bf6345eaf71f1dda1c45866..580d4e66c79709d8e336e4fc49b8c96d67032cbc 100644
--- a/spki/tag.h
+++ b/spki/tag.h
@@ -27,8 +27,8 @@
 
 struct sexp_iterator;
 
-#include "nettle/realloc.h"
-#include "nettle/buffer.h"
+#include <nettle/realloc.h>
+#include <nettle/buffer.h>
 
 struct spki_tag;
 
diff --git a/spki/testsuite/Makefile.in b/spki/testsuite/Makefile.in
index 2e74e9f91490c504c781c0188cd419f70e702633..33a058e7cf7e6e6e7a2840e10a59ad5087bd538b 100644
--- a/spki/testsuite/Makefile.in
+++ b/spki/testsuite/Makefile.in
@@ -7,8 +7,8 @@ top_srcdir = @top_srcdir@
 
 include ../config.make
 
-PRE_CPPFLAGS = -I.. -I$(top_srcdir) -I../nettle_builddir
-PRE_LDFLAGS = -L.. -L../nettle_builddir
+PRE_CPPFLAGS = -I.. -I$(top_srcdir)
+PRE_LDFLAGS = -L..
 
 TS_SOURCES = principal-test.c date-test.c tag-test.c read-acl-test.c \
 	     lookup-acl-test.c read-cert-test.c cdsa-reduce-test.c
@@ -52,8 +52,7 @@ test-rules:
 include $(srcdir)/.test-rules.make
 
 check: $(TS_ALL)
-	LD_LIBRARY_PATH=../nettle_builddir/.lib srcdir=$(srcdir) \
-		$(srcdir)/run-tests $(TS_ALL)
+	srcdir=$(srcdir) $(srcdir)/run-tests $(TS_ALL)
 
 Makefile: $(srcdir)/Makefile.in ../config.status
 	cd .. && $(SHELL) ./config.status testsuite/$@
diff --git a/spki/testsuite/check-signature-test b/spki/testsuite/check-signature-test
index 28776a1e227dbff75de2b1da16306960a21789f7..318fc79f137c25afcd4b12f9b2f33ccf07705d78 100755
--- a/spki/testsuite/check-signature-test
+++ b/spki/testsuite/check-signature-test
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 conv () {
-    echo "$1" | ../../nettle/tools/sexp-conv -s transport | tee test.in
+    echo "$1" | sexp-conv -s transport | tee test.in
 }
 
 die () {
diff --git a/spki/testsuite/delegate-test b/spki/testsuite/delegate-test
index 71c32d9cec02e5f3697e00b8a33d9f196058e1f6..0a786e6a22fc12844eab9e32a1ce49254aa1eca9 100755
--- a/spki/testsuite/delegate-test
+++ b/spki/testsuite/delegate-test
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 conv () {
-    ../../nettle/tools/sexp-conv -s transport | tee test.in
+    sexp-conv -s transport | tee test.in
 }
 
 die () {
@@ -12,7 +12,7 @@ die () {
 check_sexp () {
     file="$1"
     shift
-    ../../nettle/tools/sexp-conv -s canonical > test.canonical || die "sexp-conv failed"
+    sexp-conv -s canonical > test.canonical || die "sexp-conv failed"
     cmp "$file" test.canonical || die "$@"
 }
     
diff --git a/spki/testsuite/make-signature-test b/spki/testsuite/make-signature-test
index 74c7a0494149a17ca579b5dcdce2124c7a369d16..d2e2a5b5c7037502277be253456a9d9a166c2464 100755
--- a/spki/testsuite/make-signature-test
+++ b/spki/testsuite/make-signature-test
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 conv () {
-    echo "$1" | ../../nettle/tools/sexp-conv -s transport | tee test.in
+    echo "$1" sexp-conv -s transport | tee test.in
 }
 
 die () {
@@ -10,7 +10,7 @@ die () {
 }
 
 echo foo | ../tools/spki-make-signature "$srcdir/key-1" \
-         | ../../nettle/tools/sexp-conv -s transport > test.in
+         | sexp-conv -s transport > test.in
 
 echo foo | ../tools/spki-check-signature "`cat test.in`" \
      || die "Valid signature failed"
diff --git a/spki/testsuite/reduce-test b/spki/testsuite/reduce-test
index aaa53a4530d166664179d12609fd37c501f1256d..71737450f7f2655dc04bdd5363759969964e3731 100755
--- a/spki/testsuite/reduce-test
+++ b/spki/testsuite/reduce-test
@@ -1,9 +1,9 @@
 #! /bin/sh
 
-# Test case from Oscar C�novas Reverte
+# Test case from Oscar Cánovas Reverte
 
 conv () {
-    ../../nettle/tools/sexp-conv -s transport
+    sexp-conv -s transport
 }
 
 die () {
@@ -14,7 +14,7 @@ die () {
 check_sexp () {
     file="$1"
     shift
-    ../../nettle/tools/sexp-conv -s canonical > test.canonical || die "sexp-conv failed"
+    sexp-conv -s canonical > test.canonical || die "sexp-conv failed"
     cmp "$file" test.canonical || die "$@"
 }
 
diff --git a/spki/testsuite/testutils.h b/spki/testsuite/testutils.h
index a64c92164c2de81f22fb4e0044f33ad1aa676db2..99be5299ef75eb82c9e8957f4589d3f80c3e8a24 100644
--- a/spki/testsuite/testutils.h
+++ b/spki/testsuite/testutils.h
@@ -6,7 +6,7 @@
 #include "parse.h"
 #include "tag.h"
 
-#include "nettle/sexp.h"
+#include <nettle/sexp.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/spki/tools/Makefile.in b/spki/tools/Makefile.in
index 4add7746d1bfcc2ae6c4f00be943e7aaf44b675d..6f87507c6cde1dd7ea5445331279f5877f8b4fee 100644
--- a/spki/tools/Makefile.in
+++ b/spki/tools/Makefile.in
@@ -7,8 +7,8 @@ top_srcdir = @top_srcdir@
 
 include ../config.make
 
-PRE_CPPFLAGS = -I.. -I$(top_srcdir) -I../nettle_builddir
-PRE_LDFLAGS = -L.. -L../nettle_builddir
+PRE_CPPFLAGS = -I.. -I$(top_srcdir)
+PRE_LDFLAGS = -L..
 
 PROGRAM_LIBS = -lspki -lhogweed -lnettle $(LIBS)
 
diff --git a/spki/verify.c b/spki/verify.c
index e56c57e36b7f81666003fed1e77ff974b05f4a93..f516c903823ca0e22d1efac84873296314e8634a 100644
--- a/spki/verify.c
+++ b/spki/verify.c
@@ -24,9 +24,9 @@
 # include "config.h"
 #endif
 
-#include "nettle/bignum.h"
-#include "nettle/dsa.h"
-#include "nettle/rsa.h"
+#include <nettle/bignum.h>
+#include <nettle/dsa.h>
+#include <nettle/rsa.h>
 
 #include "certificate.h"
 #include "parse.h"