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

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  | 6 ------
 configure.ac | 5 +++++
 neard.pc.in  | 4 ++--
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 0010f90..d614b75 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -101,12 +101,6 @@ endif
 
 CLEANFILES = src/builtin.h se/builtin.h $(local_headers)
 
-plugindir = $(libdir)/near/plugins
-
-if SE
-se_plugindir = $(libdir)/neard/plugins-se
-endif
-
 configdir = ${sysconfdir}/neard
 
 dist_noinst_DATA = src/main.conf
diff --git a/configure.ac b/configure.ac
index 6292fc5..7de72b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,6 +14,11 @@ if (test "${libdir}" = '${exec_prefix}/lib'); then
 	libdir='${prefix}/lib'
 fi
 
+plugindir='${pkglibdir}/plugins'
+se_plugindir='${pkglibdir}/plugins-se'
+AC_SUBST(plugindir)
+AC_SUBST(se_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
-- 
2.1.1

