From b40fb901fed4ef9f81afb9b80be627ffffbc4403 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@hadrons.org>
Date: Thu, 7 Mar 2013 19:15:01 +0100
Subject: [PATCH v3 11/13] build: Unify and centralize plugindir default to be
 PKGLIBDIR/plugins
Status: obsolete

Unify its default value to be under PKGLIBDIR, instead of LIBDIR/near,
which does not match the name of the project nor the daemon. This also
fixes a discrepancy between the directory encoded in the daemon and
the pkg-config file. Centralize the variable to be only set once in
configure.ac.
---
 Makefile.am  | 2 --
 configure.ac | 3 +++
 neard.pc.in  | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a472798..78ee2ad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -57,8 +57,6 @@ AM_CFLAGS = ${builtin_cflags}
 
 CLEANFILES = src/builtin.h $(local_headers)
 
-plugindir = $(libdir)/near/plugins
-
 configdir = ${sysconfdir}/neard
 
 dist_noinst_DATA = src/main.conf
diff --git a/configure.ac b/configure.ac
index a8028d6..5b450dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,6 +14,9 @@ if (test "${libdir}" = '${exec_prefix}/lib'); then
 	libdir='${prefix}/lib'
 fi
 
+plugindir='${pkglibdir}/plugins'
+AC_SUBST(plugindir)
+
 PKG_PROG_PKG_CONFIG
 
 NEARD_COMPILER_FLAGS
diff --git a/neard.pc.in b/neard.pc.in
index 22a494c..36ee645 100644
--- a/neard.pc.in
+++ b/neard.pc.in
@@ -2,8 +2,8 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
- 
-plugindir=${libdir}/neard/plugins
+pkglibdir=@pkglibdir@
+plugindir=@plugindir@
 
 Name: neard
 Description: NFC daemon
-- 
1.9.0.rc3.244.g3497008

