From: Sarah Hoffmann Date: Sun, 2 Dec 2018 10:13:48 +0000 (+0100) Subject: Restructure script and website installation X-Git-Tag: v3.3.0~51^2~3 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/e70f405abddfe5a8a7400424558071ebba769eda Restructure script and website installation Just make cmake install a small stub that includes the settings from the build directory and then the script from the source directory. Remove executable rights from php files in utils/ so that they cannot be accidentally executed. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 898ab229..b7a2caaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,8 +93,7 @@ message (STATUS "Using PHP binary " ${PHP_BIN}) # #----------------------------------------------------------------------------- -set(CUSTOMFILES - settings/phrase_settings.php +set(WEBSITESCRIPTS website/deletable.php website/details.php website/hierarchy.php @@ -103,6 +102,9 @@ set(CUSTOMFILES website/reverse.php website/search.php website/status.php +) + +set(CUSTOMSCRIPTS utils/country_languages.php utils/importWikipedia.php utils/export.php @@ -114,11 +116,24 @@ set(CUSTOMFILES utils/warm.php ) -foreach (cfile ${CUSTOMFILES}) - configure_file(${PROJECT_SOURCE_DIR}/${cfile} ${PROJECT_BINARY_DIR}/${cfile}) +foreach (script_source ${CUSTOMSCRIPTS}) + configure_file(${PROJECT_SOURCE_DIR}/cmake/script.tmpl + ${PROJECT_BINARY_DIR}/${script_source}) +endforeach() + +foreach (script_source ${WEBSITESCRIPTS}) + configure_file(${PROJECT_SOURCE_DIR}/cmake/website.tmpl + ${PROJECT_BINARY_DIR}/${script_source}) endforeach() -configure_file(${PROJECT_SOURCE_DIR}/settings/defaults.php ${PROJECT_BINARY_DIR}/settings/settings.php) +set(CONFIGUREFILES + settings/phrase_settings.php + settings/defaults.php + ) + +foreach (cfile ${CONFIGUREFILES}) + configure_file(${PROJECT_SOURCE_DIR}/${cfile} ${PROJECT_BINARY_DIR}/${cfile}) +endforeach() set(WEBPATHS css images js) diff --git a/cmake/script.tmpl b/cmake/script.tmpl new file mode 100755 index 00000000..8146ca8b --- /dev/null +++ b/cmake/script.tmpl @@ -0,0 +1,4 @@ +#!@PHP_BIN@ -Cq +indirect via init-cmd.php->/lib/cmd.php for runWithEnv, getCmdOpt -// ->indirect via init-cmd.php->/lib/init.php->db.php for &getDB() - require_once(CONST_BasePath.'/lib/setup/SetupClass.php'); require_once(CONST_BasePath.'/lib/setup_functions.php'); ini_set('memory_limit', '800M'); diff --git a/utils/specialphrases.php b/utils/specialphrases.php old mode 100755 new mode 100644 index 7d22df50..40fd3750 --- a/utils/specialphrases.php +++ b/utils/specialphrases.php @@ -1,7 +1,5 @@ -#!@PHP_BIN@ -Cq