<pre style='margin:0'>
Renee Otten (reneeotten) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/362fedc85ce3f2e828249cdc006e75e0e716eaca">https://github.com/macports/macports-ports/commit/362fedc85ce3f2e828249cdc006e75e0e716eaca</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 362fedc85ce mod_tile: Update to proj7, variants to use Postgresql15-16, fix launch daemon
</span>362fedc85ce is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 362fedc85ce3f2e828249cdc006e75e0e716eaca
</span>Author: Frank Dean <frankdean@users.noreply.github.com>
AuthorDate: Sun Apr 21 12:09:44 2024 +0100
<span style='display:block; white-space:pre;color:#404040;'> mod_tile: Update to proj7, variants to use Postgresql15-16, fix launch daemon
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Also create `mapnik.xml.dist` during the build so it longer needs to be
</span><span style='display:block; white-space:pre;color:#404040;'> distributed with `openstreetmap-cart` port.
</span>---
gis/mod_tile/Portfile | 60 ++++++++++++++++++++++++-----------
gis/mod_tile/files/README_MacPorts.md | 11 +++++--
gis/mod_tile/files/osm_setup_db.sh | 10 +++---
gis/mod_tile/files/renderd.conf.dist | 2 +-
4 files changed, 57 insertions(+), 26 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/gis/mod_tile/Portfile b/gis/mod_tile/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 5532b9a397b..0ef39a783bc 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/gis/mod_tile/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/gis/mod_tile/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7,7 +7,7 @@ PortGroup github 1.0
</span>
github.setup openstreetmap mod_tile 0.5
github.tarball_from archive
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 9
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 10
</span>
categories-append gis
platforms darwin
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -33,6 +33,7 @@ checksums rmd160 e6c2224c6500f695e4a17addc7d05086ce5bebd5 \
</span> boost.version 1.76
depends_build port:apache2 \
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:carto \
</span> port:iniparser
depends_lib port:curl \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -42,7 +43,7 @@ depends_lib port:curl \
</span> path:include/turbojpeg.h:libjpeg-turbo \
port:libpng \
port:mapnik \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- port:proj4 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:proj7 \
</span> port:tiff \
port:webp \
port:zlib
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -59,6 +60,7 @@ set apxs ${prefix}/bin/apxs
</span> set docdir ${prefix}/share/doc/${name}
set mdir ${prefix}/lib/apache2/modules/
set renderd_user nobody
<span style='display:block; white-space:pre;background:#e0ffe0;'>+set pgsqlbinpath /bin
</span>
startupitem.type launchd
startupitem.create yes
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -88,14 +90,16 @@ test.run yes
</span>
require_active_variants mapnik postgis
<span style='display:block; white-space:pre;background:#ffe0e0;'>-variant postgresql12 conflicts postgresql13 description {Use with PostgreSQL 12} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- depends_lib-append port:postgresql12 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- port:pg12-postgis3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant postgresql15 conflicts postgresql16 description {Use with PostgreSQL 15} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set pgsqlbinpath "/lib/postgresql15/bin";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-append port:postgresql15 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:pg15-postgis3
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-variant postgresql13 conflicts postgresql12 description {Use with PostgreSQL 13} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- depends_lib-append port:postgresql13 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- port:pg13-postgis3
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant postgresql16 conflicts postgresql15 description {Use with PostgreSQL 16} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set pgsqlbinpath "/lib/postgresql16/bin";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-append port:postgresql16 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:pg16-postgis3
</span> }
variant osmosis description {Perform incremental OSM updates} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -111,8 +115,9 @@ variant logrotate description {Logrotate configuration} {
</span>
default_variants +osmosis +logrotate
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if {![variant_isset postgresql12] && ![variant_isset postgresql13]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default_variants-append +postgresql13
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {![variant_isset postgresql15] && ![variant_isset postgresql16]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set pgsqlbinpath "/lib/postgresql16/bin";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default_variants-append +postgresql16
</span> }
post-extract {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -132,9 +137,9 @@ post-patch {
</span> post-destroot {
system -W ${worksrcpath} "make install-mod_tile DESTDIR=${destroot} PREFIX=${prefix}"
if {[variant_isset osmosis]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- xinstall -m 0755 -d ${destroot}${prefix}/etc/LaunchAgents/${agent_uniquename}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -m 0755 -d ${destroot}${prefix}/etc/LaunchDaemons/${agent_uniquename}
</span> set minutes 20; # Run every ${minutes} minutes
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set plist [open "${destroot}${prefix}/etc/LaunchAgents/${agent_uniquename}/${agent_uniquename}.plist" w 0644]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set plist [open "${destroot}${prefix}/etc/LaunchDaemons/${agent_uniquename}/${agent_uniquename}.plist" w 0644]
</span> puts ${plist} {<?xml version="1.0" encoding="UTF-8"?>}
puts ${plist} {<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"}
puts ${plist} {"http://www.apple.com/DTDs/PropertyList-1.0.dtd">}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -166,10 +171,10 @@ post-destroot {
</span>
# install the plist
if {[getuid] == 0 && ${startupitem.install}} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- xinstall -m 0755 -d ${destroot}/Library/LaunchAgents
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ln -sf ${prefix}/etc/LaunchAgents/${agent_uniquename}/${agent_uniquename}.plist ${destroot}/Library/LaunchAgents
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -m 0755 -d ${destroot}/Library/LaunchDaemons
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -sf ${prefix}/etc/LaunchDaemons/${agent_uniquename}/${agent_uniquename}.plist ${destroot}/Library/LaunchDaemons
</span> } else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ln -sf ${prefix}/etc/LaunchAgents/${agent_uniquename}/${agent_uniquename}.plist ${destroot}${prefix}/etc/LaunchAgents
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -sf ${prefix}/etc/LaunchDaemons/${agent_uniquename}/${agent_uniquename}.plist ${destroot}${prefix}/etc/LaunchDaemons
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -186,6 +191,15 @@ post-destroot {
</span> xinstall -o root -m 0644 ${worksrcpath}/renderd.conf.dist \
${destroot}${prefix}/etc/renderd/renderd.conf.dist
xinstall -m 0755 -d ${destroot}${prefix}/etc/${name}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ exec -ignorestderr sudo -u ${macportsuser} carto -qf ${workpath}/.tmp/mapnik.xml.dist ${prefix}/share/openstreetmap-carto/project.mml >& /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -o root -m 0644 ${workpath}/.tmp/mapnik.xml.dist \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${prefix}/etc/renderd/mapnik.xml.dist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[file exists ${prefix}/share/openstreetmap-carto/symbols]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -s ${prefix}/share/openstreetmap-carto/symbols ${destroot}${prefix}/etc/renderd/symbols
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[file exists ${prefix}/share/openstreetmap-carto/patterns]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ln -s ${prefix}/share/openstreetmap-carto/patterns ${destroot}${prefix}/etc/renderd/patterns
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> xinstall -o root -m 0644 ${worksrcpath}/osm-tiles-update.conf.dist \
${destroot}${prefix}/etc/${name}/osm-tiles-update.conf.dist
xinstall -m 0755 -d \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -197,6 +211,8 @@ post-destroot {
</span> ${destroot}${prefix}/share/${name}
xinstall -o ${renderd_user} -m 0755 -d ${destroot}${prefix}/var/run/${name}
xinstall -o ${renderd_user} -m 0755 -d ${destroot}${prefix}/var/lib/${name}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -o ${renderd_user} -m 0755 -d ${destroot}${prefix}/var/run/renderd
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -o ${renderd_user} -m 0755 -d ${destroot}${prefix}/var/log/renderd
</span>
if {[variant_isset logrotate]} {
xinstall -m 0755 -d ${destroot}${prefix}/etc/logrotate.d
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -206,12 +222,20 @@ post-destroot {
</span> ${destroot}${prefix}/share/${name}/osm_setup_db.sh \
${destroot}${prefix}/share/${name}/openstreetmap-tiles-update-expire
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|/lib/postgresql/bin|${pgsqlbinpath}|g" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${prefix}/share/${name}/osm_setup_db.sh
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> destroot.keepdirs \
${destroot}${prefix}/var/run/${name} \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ${destroot}${prefix}/var/lib/${name}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${prefix}/var/lib/${name} \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${prefix}/var/run/renderd \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ${destroot}${prefix}/var/log/renderd
</span> }
post-activate {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![file exists ${prefix}/etc/renderd/mapnik.xml]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ file copy ${prefix}/etc/renderd/mapnik.xml.dist ${prefix}/etc/renderd/mapnik.xml
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> if {![file exists ${prefix}/etc/renderd/renderd.conf]} {
file copy ${prefix}/etc/renderd/renderd.conf.dist ${prefix}/etc/renderd/renderd.conf
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -229,7 +253,7 @@ post-activate {
</span>
pre-deactivate {
if {[variant_isset osmosis]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- system "launchctl unload /Library/LaunchAgents/${agent_uniquename}.plist"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "launchctl unload /Library/LaunchDaemons/${agent_uniquename}.plist"
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -248,6 +272,6 @@ And then relaunch Apache:
</span> if {[variant_isset osmosis]} {
notes-append "To load ${agent_name}:
<span style='display:block; white-space:pre;background:#ffe0e0;'>- sudo launchctl load -w /Library/LaunchAgents/${agent_uniquename}.plist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sudo launchctl load -w /Library/LaunchDaemons/${agent_uniquename}.plist
</span> "
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/gis/mod_tile/files/README_MacPorts.md b/gis/mod_tile/files/README_MacPorts.md
</span><span style='display:block; white-space:pre;color:#808080;'>index 173acd93f3a..8ef003ef425 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/gis/mod_tile/files/README_MacPorts.md
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/gis/mod_tile/files/README_MacPorts.md
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -42,7 +42,7 @@ Optionally, you can download and apply incremental updates to the database by
</span> running an import script which can be scheduled with:
$ sudo launchctl load -w \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- /Library/LaunchAgents/org.macports.fetch-osm-db-updates.plist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /Library/LaunchDaemons/org.macports.fetch-osm-db-updates.plist
</span>
This script downloads an hourly snapshot, so it has to be run at least that
frequently to keep up-to-date. The default installation runs it more
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -50,6 +50,11 @@ frequently to allow it to catch up, allowing for a little downtime. Depending
</span> on your requirements, it may be better not to run this process at all and just
refresh the entire region every few months or so.
<span style='display:block; white-space:pre;background:#e0ffe0;'>+If the daemon is loaded you can use the following command to immediately
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+initiate the process before the next scheduled session.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ sudo launchctl kickstart -p system/org.macports.fetch-osm-db-updates
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> The output of the various scripts and utilities are written to log files under
`@PREFIX@/var/log/renderd`. A configuration file for `logrotate` is
deployed to `@PREFIX@/etc/logrotate.d/renderd`. Please see the `logrotate`
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -100,7 +105,7 @@ configuration files:
</span>
- `@PREFIX@/etc/mod_tile/osm-tiles-update.conf`
- `@PREFIX@/etc/openstreetmap-carto/external-data.yml`
<span style='display:block; white-space:pre;background:#ffe0e0;'>-- `@PREFIX@/etc/openstreetmap-carto/mapnik.xml`
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- `@PREFIX@/etc/renderd/mapnik.xml`
</span>
The `mapnik.xml` configuration file repeatedly defines the database name for
every style. It may be easier to re-create the entire configuration file from
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -113,7 +118,7 @@ its original source file as follows:
</span> source file:
$ sudo port install carto
<span style='display:block; white-space:pre;background:#ffe0e0;'>- $ carto project.mml | sudo tee @PREFIX@/etc/openstreetmap-carto/mapnik.xml
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ carto project.mml | sudo tee @PREFIX@/etc/renderd/mapnik.xml
</span>
## Useful Resources
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/gis/mod_tile/files/osm_setup_db.sh b/gis/mod_tile/files/osm_setup_db.sh
</span><span style='display:block; white-space:pre;color:#808080;'>index 3692e3bf8d4..ebd43d46f64 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/gis/mod_tile/files/osm_setup_db.sh
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/gis/mod_tile/files/osm_setup_db.sh
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -71,6 +71,7 @@ set +e
</span> #set -x
PREFIX="${PREFIX:-/usr/local}"
<span style='display:block; white-space:pre;background:#e0ffe0;'>+PGSQLBINPATH="${PREFIX}/lib/postgresql/bin"
</span>
if [ -r $PREFIX/etc/mod_tile/osm-tiles-update.conf ]; then
source $PREFIX/etc/mod_tile/osm-tiles-update.conf
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -101,9 +102,9 @@ fi
</span>
initializeDatabase()
{
<span style='display:block; white-space:pre;background:#ffe0e0;'>- sudo -u "$PG_SUPER_USER" "$PREFIX/bin/createuser" "$GIS_DB_USER" -DRS >/dev/null 2>&1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sudo -u "$PG_SUPER_USER" "$PREFIX/bin/createdb" "$GIS_DB" --owner="$GIS_DB_USER" --encoding=UTF8 >/dev/null 2>&1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- cat <<EOF | sudo -u "$PG_SUPER_USER" psql "$GIS_DB" >/dev/null 2>&1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sudo -u "$PG_SUPER_USER" "$PGSQLBINPATH/createuser" "$GIS_DB_USER" -DRS >/dev/null 2>&1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sudo -u "$PG_SUPER_USER" "$PGSQLBINPATH/createdb" "$GIS_DB" --owner="$GIS_DB_USER" --encoding=UTF8 >/dev/null 2>&1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cat <<EOF | sudo -u "$PG_SUPER_USER" "$PGSQLBINPATH/psql" "$GIS_DB" >/dev/null 2>&1
</span> CREATE EXTENSION postgis;
CREATE EXTENSION hstore;
ALTER TABLE geometry_columns OWNER TO $GIS_DB_USER;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -187,7 +188,7 @@ createDatabase()
</span> exit 1
fi
>&2 echo "Creating indexes... (This can also take a very long time)"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- sudo -u "$GIS_USER" psql -d "$GIS_DB" -U "$GIS_DB_USER" \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sudo -u "$GIS_USER" "$PGSQLBINPATH/psql" -d "$GIS_DB" -U "$GIS_DB_USER" \
</span> -f "$PREFIX/share/openstreetmap-carto/indexes.sql" >/dev/null
if [ $? -ne 0 ]; then
>&2 echo "Error creating indexes in PostgreSQL"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -243,6 +244,7 @@ initializeIncrementalUpdates()
</span> fi
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+cd /tmp
</span> if [ -z "$SKIP_IMPORT" ]; then
initializeDatabase
readPbf
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/gis/mod_tile/files/renderd.conf.dist b/gis/mod_tile/files/renderd.conf.dist
</span><span style='display:block; white-space:pre;color:#808080;'>index 558ac0ac3ba..a964c9a1f74 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/gis/mod_tile/files/renderd.conf.dist
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/gis/mod_tile/files/renderd.conf.dist
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -12,7 +12,7 @@ font_dir_recurse=1
</span> [ajt]
URI=/tile/
TILEDIR=@PREFIX@/var/lib/mod_tile
<span style='display:block; white-space:pre;background:#ffe0e0;'>-XML=@PREFIX@/etc/openstreetmap-carto/mapnik.xml
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+XML=@PREFIX@/etc/renderd/mapnik.xml
</span> HOST=localhost
TILESIZE=256
MAXZOOM=20
</pre><pre style='margin:0'>
</pre>