#!/usr/bin/env python3
import sys
+import os
sys.path.insert(1, '@CMAKE_SOURCE_DIR@')
-from nominatim import tools
+os.environ['NOMINATIM_NOMINATIM_TOOL'] = os.path.abspath(__file__)
-tools.@tool_name@(module_dir='@CMAKE_BINARY_DIR@/module',
- osm2pgsql_path='@CMAKE_BINARY_DIR@/osm2pgsql/osm2pgsql',
- phplib_dir='@CMAKE_SOURCE_DIR@/lib',
- data_dir='@CMAKE_SOURCE_DIR@')
+from nominatim import cli
+
+exit(cli.nominatim(module_dir='@CMAKE_BINARY_DIR@/module',
+ osm2pgsql_path='@CMAKE_BINARY_DIR@/osm2pgsql/osm2pgsql',
+ phplib_dir='@CMAKE_SOURCE_DIR@/lib-php',
+ sqllib_dir='@CMAKE_SOURCE_DIR@/lib-sql',
+ data_dir='@CMAKE_SOURCE_DIR@',
+ config_dir='@CMAKE_SOURCE_DIR@/settings',
+ phpcgi_path='@PHPCGI_BIN@'))