From 73d1b2586430e72f2b435c1f53bc39ed0819a0fd Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 1 Feb 2018 13:20:06 +0000 Subject: [PATCH] Makefile: Configure database directory Signed-off-by: Michael Tremer --- .gitignore | 1 + Makefile.am | 10 +++++++++- src/python/{location-query => location-query.in} | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) rename src/python/{location-query => location-query.in} (98%) diff --git a/.gitignore b/.gitignore index acb026f..6d9114d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ Makefile.in /configure /libtool /stamp-h1 +/src/python/location-query /test.db diff --git a/Makefile.am b/Makefile.am index ebbb0e5..161f5d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,11 +27,13 @@ SED_PROCESS = \ -e 's,@exec_prefix\@,$(exec_prefix),g' \ -e 's,@libdir\@,$(libdir),g' \ -e 's,@includedir\@,$(includedir),g' \ + -e 's,@databasedir\@,$(databasedir),g' \ < $< > $@ || rm $@ +databasedir = $(datadir)/location pkgconfigdir = $(libdir)/pkgconfig -%.pc: %.pc.in Makefile +%: %.in Makefile $(SED_PROCESS) EXTRA_DIST += \ @@ -115,6 +117,12 @@ src_python_location_la_LIBADD = \ bin_SCRIPTS = \ src/python/location-query +EXTRA_DIST += \ + src/python/location-query.in + +CLEANFILES += \ + src/python/location-query + TESTS_CFLAGS = \ $(AM_CFLAGS) \ -DLIBLOC_PRIVATE diff --git a/src/python/location-query b/src/python/location-query.in similarity index 98% rename from src/python/location-query rename to src/python/location-query.in index 9b5ea94..260f4bd 100644 --- a/src/python/location-query +++ b/src/python/location-query.in @@ -30,7 +30,7 @@ _ = lambda x: x class CLI(object): def __init__(self): # Open database - self.db = location.Database("test.db") + self.db = location.Database("@databasedir@/database.db") def parse_cli(self): parser = argparse.ArgumentParser( -- 2.39.2