summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiretza2022-04-25 22:13:23 +0200
committerXiretza2022-05-20 09:02:06 +0200
commitd938e19b43ee1adf07f709578461efdc66a07490 (patch)
treea99d2b4356ba8410a2d1e3b78946b6859f34b878
parent93309f8ae3d6c208d8abb18b17bc8881ec975559 (diff)
downloadaur-d938e19b43ee1adf07f709578461efdc66a07490.tar.gz
Update to latest version
-rw-r--r--.SRCINFO46
-rw-r--r--0001-Fix-configuration-to-point-to-installed-files.patch41
-rw-r--r--PKGBUILD176
-rw-r--r--apache.conf4
-rw-r--r--nominatim.install5
-rw-r--r--settings-local.php4
-rw-r--r--std-runtimeerror.patch11
-rw-r--r--webapps-paths.patch21
8 files changed, 118 insertions, 190 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d4c0a2e66ec3..9a3a6186ca04 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,53 +1,57 @@
pkgbase = nominatim
pkgdesc = Geocoding tool using OpenStreetmap data
- pkgver = 3.5.1
- pkgrel = 6
+ pkgver = 4.0.1
+ pkgrel = 1
url = https://nominatim.org
install = nominatim.install
arch = x86_64
license = GPL2
+ checkdepends = python-behave
+ checkdepends = phpunit
+ checkdepends = phpcs
+ checkdepends = python-pylint
+ checkdepends = python-pytest
makedepends = clang
makedepends = cmake
- makedepends = libxml2
+ depends = expat
+ depends = proj
depends = boost
depends = boost-libs
- depends = expat
- depends = fmt
depends = git
depends = libosmium
+ depends = osm2pgsql
+ depends = postgresql
+ depends = postgis
+ depends = python-psycopg2
+ depends = python-dotenv
+ depends = python-psutil
+ depends = python-jinja
+ depends = python-pyicu
+ depends = python-yaml
+ depends = libdatrie
depends = php
+ depends = php-cgi
depends = php-intl
depends = php-pgsql
- depends = postgis
- depends = postgresql
- depends = protozero
- depends = proj
depends = pyosmium
- depends = python-psycopg2
optdepends = nominatim-data-wikipedia: optional auxiliary data source to help indicate the importance of OSM features
optdepends = nominatim-data-postcodes-gb: improve searches that involve a UK postcode
optdepends = nominatim-data-postcodes-us: improve searches that involve a US postcode
optdepends = nominatim-data-tiger: improves searches that involve US house numbers
noextract = country_grid.sql.gz
- backup = etc/webapps/nominatim/settings/local.php
- source = https://nominatim.org/release/Nominatim-3.5.1.tar.bz2
+ source = https://nominatim.org/release/Nominatim-4.0.1.tar.bz2
source = https://www.nominatim.org/data/country_grid.sql.gz
source = nominatim.sysusers
source = nominatim.tmpfiles
source = apache.conf
source = php.ini
- source = settings-local.php
- source = webapps-paths.patch
- source = std-runtimeerror.patch
- sha256sums = 9e4e8d58e6c0a4fd0270ca34657226a19bde33fb0fcfbeb91a215c739faddde5
+ source = 0001-Fix-configuration-to-point-to-installed-files.patch
+ sha256sums = 8f0c7ab93e6341713da40d034e689c4b9c3f257de485624abe4dc78b175267fc
sha256sums = fe66393aaf561749255cebf4c61d13a8425e326b8ce50409d88c4035165de049
sha256sums = 7f71b5217cbe0713fa5f8baa138348c9cd49f42c2b6025c059076042e0c04c6d
sha256sums = 50bf612ad951bcf3c1969aa79b0c7ab78745983720bc5f2deb37d1704c0e37d8
- sha256sums = 8dd94ea1a88156bc55dc41e4f4df878df4f28c23c31bfda36c89470e2f5997d0
+ sha256sums = 3c4d5fbb1299aff5d4efa855c8b278f2e19c47104982f3488c2c545a40f75ac8
sha256sums = 37c4b17463f8317d39bb741b07bbb693afc0bbf584eec590f89b849542b98b7d
- sha256sums = c51857c2aa9d1373b5b66cd695b9b30a916ecd05570d92cf631af5efc63ed472
- sha256sums = e35272be9414661c79659da8bd1c8028e859c460efbf52236a4bb84f018b9a57
- sha256sums = 7d5eb8dada043384e267fd2cd4ad621916ef62d5dd81e4f00c3989302a4b5a2b
+ sha256sums = 0873be585fa87e266e7e5bf02ab71b7032ea4e8d38d168f2f56cf4dd1bb32975
pkgname = nominatim
-
diff --git a/0001-Fix-configuration-to-point-to-installed-files.patch b/0001-Fix-configuration-to-point-to-installed-files.patch
new file mode 100644
index 000000000000..95d00c3f5892
--- /dev/null
+++ b/0001-Fix-configuration-to-point-to-installed-files.patch
@@ -0,0 +1,41 @@
+From ac0cd973586b44bcdb678f7edefa2175aca416ef Mon Sep 17 00:00:00 2001
+From: Xiretza <xiretza@xiretza.xyz>
+Date: Thu, 24 Jun 2021 15:56:34 +0200
+Subject: [PATCH] Fix configuration to point to installed files
+
+---
+ settings/env.defaults | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/settings/env.defaults b/settings/env.defaults
+index 4069270e..5f7e45cc 100644
+--- a/settings/env.defaults
++++ b/settings/env.defaults
+@@ -10,13 +10,13 @@ NOMINATIM_DATABASE_DSN="pgsql:dbname=nominatim"
+
+ # Database web user.
+ # Nominatim sets up read-only access for this user during installation.
+-NOMINATIM_DATABASE_WEBUSER="www-data"
++NOMINATIM_DATABASE_WEBUSER="http"
+
+ # Directory where to find the PostgreSQL server module.
+ # When empty the module is expected to be located in the 'module' subdirectory
+ # in the project directory.
+ # Changing this value requires to run 'nominatim refresh --functions'.
+-NOMINATIM_DATABASE_MODULE_PATH=
++NOMINATIM_DATABASE_MODULE_PATH="/usr/lib/nominatim/module"
+
+ # Number of occurances of a word before it is considered frequent.
+ # Similar to the concept of stop words. Frequent partial words get ignored
+@@ -65,7 +65,7 @@ NOMINATIM_HTTP_PROXY_PASSWORD=
+ # When empty, osm2pgsql is expected to reside in the osm2pgsql directory in
+ # the project directory.
+ # EXPERT ONLY. You should usually use the supplied osm2pgsql.
+-NOMINATIM_OSM2PGSQL_BINARY=
++NOMINATIM_OSM2PGSQL_BINARY="/usr/bin/osm2pgsql"
+
+ # Directory where to find US Tiger data files to import.
+ # OBSOLETE: use `nominatim add-data --tiger-data <dir>` to explicitly state
+--
+2.32.0
+
diff --git a/PKGBUILD b/PKGBUILD
index c2494feb2307..da597d3d3307 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,8 +4,8 @@ pkgname="nominatim"
pkgdesc="Geocoding tool using OpenStreetmap data"
url="https://nominatim.org"
-pkgver=3.5.1
-pkgrel=6
+pkgver=4.0.1
+pkgrel=1
arch=("x86_64")
license=("GPL2")
@@ -13,24 +13,31 @@ license=("GPL2")
makedepends=(
"clang"
"cmake"
- "libxml2"
)
depends=(
+ "expat"
+ "proj"
"boost"
"boost-libs"
- "expat"
- "fmt"
+
"git"
"libosmium"
+ "osm2pgsql"
+
+ "postgresql"
+ "postgis"
+ "python-psycopg2"
+ "python-dotenv"
+ "python-psutil"
+ "python-jinja"
+ "python-pyicu"
+ "python-yaml"
+ "libdatrie"
"php"
+ "php-cgi"
"php-intl"
"php-pgsql"
- "postgis"
- "postgresql"
- "protozero"
- "proj"
"pyosmium"
- "python-psycopg2"
)
optdepends=(
"nominatim-data-wikipedia: optional auxiliary data source to help indicate the importance of OSM features"
@@ -38,6 +45,13 @@ optdepends=(
"nominatim-data-postcodes-us: improve searches that involve a US postcode"
"nominatim-data-tiger: improves searches that involve US house numbers"
)
+checkdepends=(
+ "python-behave"
+ "phpunit"
+ "phpcs"
+ "python-pylint"
+ "python-pytest"
+)
source=(
"https://nominatim.org/release/Nominatim-${pkgver}.tar.bz2"
@@ -46,143 +60,47 @@ source=(
"${pkgname}.tmpfiles"
"apache.conf"
"php.ini"
- "settings-local.php"
- "webapps-paths.patch"
- "std-runtimeerror.patch"
-)
-sha256sums=(
- "9e4e8d58e6c0a4fd0270ca34657226a19bde33fb0fcfbeb91a215c739faddde5"
- "fe66393aaf561749255cebf4c61d13a8425e326b8ce50409d88c4035165de049"
- "7f71b5217cbe0713fa5f8baa138348c9cd49f42c2b6025c059076042e0c04c6d"
- "50bf612ad951bcf3c1969aa79b0c7ab78745983720bc5f2deb37d1704c0e37d8"
- "8dd94ea1a88156bc55dc41e4f4df878df4f28c23c31bfda36c89470e2f5997d0"
- "37c4b17463f8317d39bb741b07bbb693afc0bbf584eec590f89b849542b98b7d"
- "c51857c2aa9d1373b5b66cd695b9b30a916ecd05570d92cf631af5efc63ed472"
- "e35272be9414661c79659da8bd1c8028e859c460efbf52236a4bb84f018b9a57"
- "7d5eb8dada043384e267fd2cd4ad621916ef62d5dd81e4f00c3989302a4b5a2b"
+ "0001-Fix-configuration-to-point-to-installed-files.patch"
)
+sha256sums=('8f0c7ab93e6341713da40d034e689c4b9c3f257de485624abe4dc78b175267fc'
+ 'fe66393aaf561749255cebf4c61d13a8425e326b8ce50409d88c4035165de049'
+ '7f71b5217cbe0713fa5f8baa138348c9cd49f42c2b6025c059076042e0c04c6d'
+ '50bf612ad951bcf3c1969aa79b0c7ab78745983720bc5f2deb37d1704c0e37d8'
+ '3c4d5fbb1299aff5d4efa855c8b278f2e19c47104982f3488c2c545a40f75ac8'
+ '37c4b17463f8317d39bb741b07bbb693afc0bbf584eec590f89b849542b98b7d'
+ '0873be585fa87e266e7e5bf02ab71b7032ea4e8d38d168f2f56cf4dd1bb32975')
noextract=(
"country_grid.sql.gz"
)
install="${pkgname}.install"
-backup=(
- "etc/webapps/${pkgname}/settings/local.php"
-)
prepare() {
- mkdir -p "${srcdir}/build"
- patch -d "${srcdir}/Nominatim-${pkgver}" -p1 < webapps-paths.patch
- patch -d "${srcdir}/Nominatim-${pkgver}" -p1 < std-runtimeerror.patch
+ cd "Nominatim-$pkgver"
- cp "country_grid.sql.gz" "${srcdir}/Nominatim-${pkgver}/data/country_grid.sql.gz"
+ patch -p1 < "$srcdir/0001-Fix-configuration-to-point-to-installed-files.patch"
+ cp "$srcdir/country_grid.sql.gz" "data/country_grid.sql.gz"
}
build() {
- cd "${srcdir}/build"
- cmake \
- -DCMAKE_BUILD_TYPE="Release" \
+ # The postgres module is built using postgres' module makefiles, which set CFLAGS to the ones
+ # used during postgres' compilation. This includes -ffile-prefix-map, which breaks debug packages.
+ # Add our $DEBUG_CFLAGS to CUSTOM_COPT, which is appended to CFLAGS in
+ # /usr/lib/postgresql/pgxs/src/Makefile.global.
+ export CUSTOM_COPT=$DEBUG_CFLAGS
+
+ cmake -S "Nominatim-$pkgver" -B build \
+ -DCMAKE_BUILD_TYPE="None" \
-DCMAKE_INSTALL_PREFIX="/usr" \
- -DEXTERNAL_LIBOSMIUM="ON" \
- -DEXTERNAL_PROTOZERO="ON" \
- -DEXTERNAL_FMT="ON" \
- "../Nominatim-${pkgver}"
- make
+ -DBUILD_OSM2PGSQL=off
+
+ make -C build VERBOSE=1
}
package() {
cd "${srcdir}/build/"
make DESTDIR="${pkgdir}/" install
- # install is a bit of a mess;
- # upstream instructs to run from build and src
- # directory, which does not sound like the
- # thing I’d want to do.
-
- # (see also my patch to change the directories
- # hardcoded in (src)/settings/defaults.php)
-
- # directories to copy from source dir to /var/lib
- for _dir in \
- "data" \
- "data-sources" \
- "lib" \
- "munin" \
- "nominatim" \
- "settings" \
- "sql" \
- "utils" \
- "website"
- do
- install \
- -Ddm755 \
- "${pkgdir}/var/lib/${pkgname}/src/${_dir}"
- cp -aR \
- "${srcdir}/Nominatim-${pkgver}/${_dir}" \
- "${pkgdir}/var/lib/${pkgname}/src/"
- done
-
- # directories to copy from build dir to /var/lib
- for _dir in \
- "utils"
- do
- install \
- -Ddm755 \
- "${pkgdir}/var/lib/${pkgname}/bin/${_dir}"
-
- cp -aR \
- "${srcdir}/build/${_dir}" \
- "${pkgdir}/var/lib/${pkgname}/bin/"
- done
-
- # directories to copy from build to /usr/share/webapps
- for _dir in \
- "website"
- do
- install \
- -Ddm755 \
- "${pkgdir}/usr/share/webapps/${pkgname}/${_dir}"
-
- cp -aR \
- "${srcdir}/build/${_dir}" \
- "${pkgdir}/usr/share/webapps/${pkgname}/"
- done
-
- # directories to copy from build to /etc/webapps/
- for _dir in \
- "settings"
- do
- install \
- -Ddm755 \
- "${pkgdir}/etc/webapps/${pkgname}/${_dir}"
-
- cp -aR \
- "${srcdir}/build/${_dir}" \
- "${pkgdir}/etc/webapps/${pkgname}/"
- done
-
- # single files (binaries) to copy to /var/lib
- install -Dm755 "${srcdir}/build/module/nominatim.so" -t "${pkgdir}/var/lib/${pkgname}/bin/module/"
-
- # repair symlinks pointing to ${srcdir}
- for _link in \
- "css" \
- "images" \
- "js"
- do
- rm "${pkgdir}/usr/share/webapps/${pkgname}/website/${_link}"
- ln -sf "/var/lib/${pkgname}/src/website/${_link}" "${pkgdir}/usr/share/webapps/${pkgname}/website/${_link}"
- done
-
- # link settings from /etc/webapps
- install -Ddm755 "${pkgdir}/etc/webapps/${pkgname}/"
- ln -s "/etc/webapps/${pkgname}/settings/" "${pkgdir}/var/lib/${pkgname}/bin/settings"
- # and from /usr/share/webapps/
- ln -s "/etc/webapps/${pkgname}/settings/" "${pkgdir}/usr/share/webapps/${pkgname}/settings"
-
- # install package settings
- install -Dm644 "${srcdir}/settings-local.php" "${pkgdir}/etc/webapps/${pkgname}/settings/local.php"
-
# install apache and php config
install -Dm644 "${srcdir}/apache.conf" -t "${pkgdir}/etc/webapps/${pkgname}"
install -Dm644 "${srcdir}/php.ini" "${pkgdir}/etc/php/conf.d/nominatim.ini"
@@ -191,3 +109,5 @@ package() {
install -Dm 644 "${srcdir}/${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
install -Dm 644 "${srcdir}/${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
}
+
+# vim: set et ts=4:
diff --git a/apache.conf b/apache.conf
index d54b71505f93..8f4c8b39cb19 100644
--- a/apache.conf
+++ b/apache.conf
@@ -1,5 +1,5 @@
-Alias /nominatim "/usr/share/webapps/nominatim/website"
-<Directory "/usr/share/webapps/nominatim/website">
+Alias /nominatim "/usr/lib/nominatim/lib-php/website"
+<Directory "/usr/lib/nominatim/lib-php/website">
Options FollowSymlinks MultiViews
DirectoryIndex search.php
Require all granted
diff --git a/nominatim.install b/nominatim.install
index dfc68d6834fd..9cdeebb2807d 100644
--- a/nominatim.install
+++ b/nominatim.install
@@ -3,9 +3,8 @@
post_install() {
cat <<- 'EOF'
Create the required PostgreSQL and users for nominatim by running
- `sudo su - postgres "createuser -s nominatim; createuser http"`
+ `sudo su - postgres -c "createuser --superuser nominatim; createuser http"`
- Then `su` to user `nominatim` and follow the instructions at http://nominatim.org/release-docs/latest/admin/Import-and-Update/#choosing-the-data-to-import to download and import data.
-
+ Then `su` to user `nominatim` and follow the instructions at https://nominatim.org/release-docs/latest/admin/Import/#choosing-the-data-to-import to download and import data.
EOF
}
diff --git a/settings-local.php b/settings-local.php
deleted file mode 100644
index 878565a6fa83..000000000000
--- a/settings-local.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
- @define('CONST_Website_BaseURL', '/nominatim/');
- @define('CONST_Osm2pgsql_Flatnode_File', '/var/cache/nominatim/flatnode.file');
- @define('CONST_Osm2pgsql_Binary', '/usr/bin/osm2pgsql');
diff --git a/std-runtimeerror.patch b/std-runtimeerror.patch
deleted file mode 100644
index bf38c1689acd..000000000000
--- a/std-runtimeerror.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff --unified --recursive --text a/osm2pgsql/src/pgsql.cpp b/osm2pgsql/src/pgsql.cpp
---- a/osm2pgsql/src/pgsql.cpp 2020-07-04 14:44:32.549937439 +0300
-+++ b/osm2pgsql/src/pgsql.cpp 2020-07-04 14:43:12.343270778 +0300
-@@ -3,6 +3,7 @@
-
- #include <cstdarg>
- #include <cstdio>
-+#include <stdexcept>
-
- pg_conn_t::pg_conn_t(std::string const &conninfo)
- : m_conn(PQconnectdb(conninfo.c_str()))
diff --git a/webapps-paths.patch b/webapps-paths.patch
deleted file mode 100644
index 845dd788a2a1..000000000000
--- a/webapps-paths.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -ru a/settings/defaults.php b/settings/defaults.php
---- a/settings/defaults.php 2019-12-28 23:57:37.000000000 +0200
-+++ b/settings/defaults.php 2020-02-06 14:31:22.613567043 +0200
-@@ -1,6 +1,6 @@
- <?php
--@define('CONST_BasePath', '@CMAKE_SOURCE_DIR@');
--@define('CONST_InstallPath', '@CMAKE_BINARY_DIR@');
-+@define('CONST_BasePath', '/var/lib/nominatim/src');
-+@define('CONST_InstallPath', '/var/lib/nominatim/bin');
- if (file_exists(getenv('NOMINATIM_SETTINGS'))) require_once(getenv('NOMINATIM_SETTINGS'));
- if (file_exists(CONST_InstallPath.'/settings/local.php')) require_once(CONST_InstallPath.'/settings/local.php');
- if (isset($_GET['debug']) && $_GET['debug']) @define('CONST_Debug', true);
-@@ -8,7 +8,7 @@
- // General settings
- @define('CONST_Debug', false);
- @define('CONST_Database_DSN', 'pgsql:dbname=nominatim'); // or add ;host=...;port=...;user=...;password=...
--@define('CONST_Database_Web_User', 'www-data');
-+@define('CONST_Database_Web_User', 'http');
- @define('CONST_Database_Module_Path', CONST_InstallPath.'/module');
- @define('CONST_Max_Word_Frequency', '50000');
- @define('CONST_Limit_Reindexing', true);