From e7d1a46ad278e520ecf69d2095761ce3fee020e4 Mon Sep 17 00:00:00 2001
From: Chris Lamb <lamby@debian.org>
Date: Fri, 24 Jul 2009 18:43:50 +0200
Subject: [PATCH 12/22] Don't assume that we will use the library from the 'install' target's PREFIX

This patch adds support for using the DESTDIR variable in the 'install'
target to represent the "eventual" destination of the library, decoupling
the installation directory and the run-time directory.

I'm using this so the pkgconfig file gets created with a "prefix" value
of my choice ("/usr") instead of somewhere under my home directory or
wherever I happen to be generating the Debian package from.

Signed-off-by: Chris Lamb <lamby@debian.org>
---
 libfiu/Makefile     |    5 ++++-
 libfiu/libfiu.pc.in |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libfiu/Makefile b/libfiu/Makefile
index f72c513..5730cb2 100644
--- a/libfiu/Makefile
+++ b/libfiu/Makefile
@@ -14,6 +14,9 @@ endif
 # prefix for installing the binaries
 PREFIX=/usr/local
 
+# prefix for eventual location of binaries
+DESTDIR=$(PREFIX)
+
 # install utility, we assume it's GNU/BSD compatible
 INSTALL=install
 
@@ -38,7 +41,7 @@ all: libs libfiu.pc
 libfiu.pc: build-flags libfiu.pc.in
 	@echo "generating libfiu.pc"
 	@cat libfiu.pc.in | \
-		sed 's@++PREFIX++@$(PREFIX)@g' | \
+		sed 's@++DESTDIR++@$(DESTDIR)@g' | \
 		sed 's@++LIB_VER++@$(LIB_VER)@g' \
 		> libfiu.pc
 
diff --git a/libfiu/libfiu.pc.in b/libfiu/libfiu.pc.in
index de3e08b..937d57b 100644
--- a/libfiu/libfiu.pc.in
+++ b/libfiu/libfiu.pc.in
@@ -1,5 +1,5 @@
 
-prefix=++PREFIX++
+prefix=++DESTDIR++
 libdir=${prefix}/lib
 includedir=${prefix}/include
 
-- 
1.6.2.2.646.gb214

