Makefile: Configure database directory
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Feb 2018 13:20:06 +0000 (13:20 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Feb 2018 13:20:06 +0000 (13:20 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
.gitignore
Makefile.am
src/python/location-query.in [moved from src/python/location-query with 98% similarity]

index acb026f..6d9114d 100644 (file)
@@ -12,4 +12,5 @@ Makefile.in
 /configure
 /libtool
 /stamp-h1
+/src/python/location-query
 /test.db
index ebbb0e5..161f5d3 100644 (file)
@@ -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
similarity index 98%
rename from src/python/location-query
rename to src/python/location-query.in
index 9b5ea94..260f4bd 100644 (file)
@@ -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(