[tracker/extract-rules-fix: 1/3] libtracker-extract: Don't break compilation due to missing rules/modules dir



commit 7a583997a0fe8355f75cd1fa0995866ec6e18dec
Author: Martyn Russell <martyn lanedo com>
Date:   Mon Feb 24 15:51:18 2014 +0000

    libtracker-extract: Don't break compilation due to missing rules/modules dir

 configure.ac                                       |    8 ++++++++
 .../{01-mockup.rule.in => 01-mockup.rule}          |    0
 examples/libtracker-extract/Makefile.am            |   14 +++++---------
 src/libtracker-extract/Makefile.am                 |    4 ++--
 src/tracker-extract/Makefile.am                    |   12 +++++++++---
 5 files changed, 24 insertions(+), 14 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 79458ea..15e5e33 100644
--- a/configure.ac
+++ b/configure.ac
@@ -320,6 +320,14 @@ TRACKER_EXTRACT_REQUIRED="glib-2.0        >= $GLIB_REQUIRED
 
 PKG_CHECK_MODULES(TRACKER_EXTRACT, [$TRACKER_EXTRACT_REQUIRED])
 
+TRACKER_EXTRACT_MODULES_DIR="${libdir}/tracker-${TRACKER_API_VERSION}/extract-modules"
+AC_SUBST(TRACKER_EXTRACT_MODULES_DIR)
+
+# NOTE: We don't use ${TRACKER_API_VERSION} because other content like
+# the ontology is installed to the same location.
+TRACKER_EXTRACT_RULES_DIR="${datadir}/tracker/extract-rules"
+AC_SUBST(TRACKER_EXTRACT_RULES_DIR)
+
 # Check requirements for tracker-extract modules
 TRACKER_EXTRACT_MODULES_REQUIRED="glib-2.0     >= $GLIB_REQUIRED"
 
diff --git a/examples/libtracker-extract/01-mockup.rule.in b/examples/libtracker-extract/01-mockup.rule
similarity index 100%
rename from examples/libtracker-extract/01-mockup.rule.in
rename to examples/libtracker-extract/01-mockup.rule
diff --git a/examples/libtracker-extract/Makefile.am b/examples/libtracker-extract/Makefile.am
index cc2e80f..a632727 100644
--- a/examples/libtracker-extract/Makefile.am
+++ b/examples/libtracker-extract/Makefile.am
@@ -16,17 +16,13 @@ libextract_mockup_la_LIBADD =                          \
        $(BUILD_LIBS)                                  \
        $(LIBTRACKER_EXTRACT_LIBS)
 
-rules_in_files = 01-mockup.rule.in
-
-%.rule: %.rule.in
-       @sed -e "s|@extractmodulesdir[ ]|${extractmodulesdir}|" $< > $@
-
 # This is noinst_ only because it's an example, normally this would be
 # "rules" (for rules_DATA and rulesdir) or whatever name you want to
 # give for your rules files.
-noinstdir = $(extractrulesdir)
+#
+# _RULES_DIR = $(datadir)/tracker/extract-rules
+#
+noinstdir = $(TRACKER_EXTRACT_RULES_DIR)
 noinst_DATA = 01-mockup.rule
 
-CLEANFILES = $(noinst_DATA)
-
-EXTRA_DIST = $(rules_in_files)
+EXTRA_DIST = $(noinst_DATA)
diff --git a/src/libtracker-extract/Makefile.am b/src/libtracker-extract/Makefile.am
index ad20135..abae223 100644
--- a/src/libtracker-extract/Makefile.am
+++ b/src/libtracker-extract/Makefile.am
@@ -5,8 +5,8 @@ AM_CPPFLAGS =                                          \
        -I$(top_srcdir)/src                            \
        -I$(top_builddir)/src                          \
        -DSHAREDIR=\""$(datadir)"\"                    \
-       -DTRACKER_EXTRACTOR_RULES_DIR=\""$(extractrulesdir)"\" \
-       -DTRACKER_EXTRACTORS_DIR=\""$(extractmodulesdir)"\" \
+       -DTRACKER_EXTRACTOR_RULES_DIR=\""$(TRACKER_EXTRACT_RULES_DIR)"\" \
+       -DTRACKER_EXTRACTORS_DIR=\""$(TRACKER_EXTRACT_MODULES_DIR)"\" \
        $(LIBTRACKER_EXTRACT_CFLAGS)
 
 libtracker_extractdir = $(libdir)/tracker-$(TRACKER_API_VERSION)
diff --git a/src/tracker-extract/Makefile.am b/src/tracker-extract/Makefile.am
index 45c25f4..69a638e 100644
--- a/src/tracker-extract/Makefile.am
+++ b/src/tracker-extract/Makefile.am
@@ -1,14 +1,16 @@
-include $(top_srcdir)/Makefile.extractdirs
+#
+# _RULES_DIR = $(datadir)/tracker/extract-rules
+#
+rulesdir = $(TRACKER_EXTRACT_RULES_DIR)
 
 module_flags = -module -avoid-version -no-undefined
-rulesdir = $(extractrulesdir)
 
 AM_CPPFLAGS = \
        $(BUILD_CFLAGS) \
        -I$(top_srcdir)/src \
        -I$(top_builddir)/src \
        -DLOCALEDIR=\""$(localedir)"\" \
-       -DTRACKER_EXTRACTORS_DIR=\""$(extractmodulesdir)"\" \
+       -DTRACKER_EXTRACTORS_DIR=\""$(TRACKER_EXTRACT_MODULES_DIR)"\" \
        $(TRACKER_EXTRACT_CFLAGS)
 
 # NOTE: The rules are here and not in another sub-directory because we
@@ -54,6 +56,10 @@ rules_files = \
 # NOTE:
 # We don't always link with libtracker-common, we only link
 # against it if we directly use functions in the .so
+#
+# _MODULES_DIR = $(libdir)/tracker-$(TRACKER_API_VERSION)/extract-modules
+#
+extractmodulesdir = $(TRACKER_EXTRACT_MODULES_DIR)
 extractmodules_LTLIBRARIES = # Empty
 rules_DATA = # Empty
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]