changeset 2099:f17a1b4bc259

Improve mapsearch SysV init scripts.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 10 Sep 2019 16:22:53 +0300
parents 00a10a891ce8
children 9141edfb5647
files scripts/mapsearch.sysvinit scripts/mapsearch.sysvinit.cfg
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/mapsearch.sysvinit	Tue Sep 10 16:06:59 2019 +0300
+++ b/scripts/mapsearch.sysvinit	Tue Sep 10 16:22:53 2019 +0300
@@ -44,13 +44,19 @@
 
 . /lib/lsb/init-functions
 
+THLIBS_DIR="${MAPSEARCH_DIR}/th-libs/"
 
 update_map_data()
 {
   if test ! -d "$MAPSEARCH_DIR/.hg"; then
     hg clone "$MAPSEARCH_REPO" "$MAPSEARCH_DIR"
+    if test ! -d "$THLIBS_DIR/.hg"; then
+      hg clone "$THLIBS_REPO" "$THLIBS_DIR"
+    fi
   else
     cd "$MAPSEARCH_DIR" && hg pull && hg update
+    cd "$THLIBS_DIR" && hg pull && hg update
+    cd "$MAPSEARCH_DIR" && make "bin/mapsearch" -j4 && cp "bin/mapsearch" "$MAPSEARCH_BIN"
   fi
 }
 
--- a/scripts/mapsearch.sysvinit.cfg	Tue Sep 10 16:06:59 2019 +0300
+++ b/scripts/mapsearch.sysvinit.cfg	Tue Sep 10 16:22:53 2019 +0300
@@ -1,6 +1,11 @@
 # Configuration file /etc/default/mapsearch
 # for Pupunen MapSearch daemon SysV init script
 
+# Mercurial repository URLs for maputils and th-libs
+MAPSEARCH_REPO="http://pupunen.net/hg/maputils"
+THLIBS_REPO="https://tnsp.org/hg/th-libs"
+
+
 # Use mapsearch user and group to drop privileges to
 MAPSEARCH_OPTS="-U mapsearch -G mapsearch"
 
@@ -14,8 +19,6 @@
 # Cache data directory, if -U/-G is used this needs write permission for that user/group
 MAPSEARCH_DIR="/var/cache/mapsearch"
 
-MAPSEARCH_REPO="http://pupunen.net/hg/maputils"
-
 
 # Set world center / origin
 MAPSEARCH_OPTS="$MAPSEARCH_OPTS -w 8192:8192"