Portfiles for an OpenStreetMap Tile Server

Craig Treleaven ctreleaven at cogeco.ca
Sun Aug 29 15:40:56 UTC 2021


> On Aug 29, 2021, at 8:02 AM, Frank Dean <frank at fdsd.co.uk> wrote:
> 
> I have a few questions to ask in relation to a series of Portfiles that
> I have created to support installing and running a map tile server for
> OpenStreetMaps [1].
> 
> [1]: https://switch2osm.org/serving-tiles/
> 
> The logical Portfiles:
> 
> - libprotozero - library required by libosmium
> 
>    https://github.com/mapbox/protozero
> 
> - libosmium - library required by osmium-tool
> 
>    https://github.com/osmcode/libosmium
> 
> - osmium-tool - application required at runtime by mod_tile/renderd
> 
>    https://github.com/osmcode/osmium-tool
> 
> - osmosis - Java application required at runtime by mod_tile/renderd
> 
>    https://github.com/openstreetmap/osmosis
> 
> - openstreetmap-carto - style sheets used by mod_tile/renderd
> 
>    https://github.com/gravitystorm/openstreetmap-carto
> 
> - mod_tile/renderd - the OpenStreetMaps tile server
> 
>    https://wiki.openstreetmap.org/wiki/Mod_tile
> 
> 1.  Should I submit each Portfile in dependency order and await its
>    acceptance before submitting the next in sequence, or submit them
>    in dependency related batches in a single pull request?
> 
> 2.  The primary port is 'mod_tile' which contains an Apache module for
>    serving the tiles and a 'renderd' daemon that renders and creates
>    tile images based on requests from 'mod_tile'.  Both artefacts are
>    created in a single build.
> 
>    I have currently named the port 'renderd', but the project is
>    commonly known as 'mod_tile'.  Naming the port 'renderd' was the
>    only way I could succeed in the 'renderd' startup item being loaded
>    via the 'sudo port load ${subport}' command.
> 
>    Is there a better way of naming and creating this port, perhaps as
>    subports?
> 
> 3.  Getting the tile server up and running requires quite a number of
>    steps.  I have created a shell script to largely automate the
>    process.  At runtime it uses scripts from both 'openstreetmap-carto'
>    and 'mod_tile/renderd', so doesn't immediately sit comfortably being
>    installed with either of them.
> 
>    Is it best to create a simple separate standalone port (without an
>    upstream project), containing just the shell script, naming it
>    something like 'osm-tile-server' and depending on the other two
>    ports; or simply include it in one of the other ports with runtime
>    checks for the existence of required executables with helpful error
>    messages when they're absent?
> 
> Many thanks,
> 
> Frank

I’ll offer my thoughts to get the ball rolling.  First, from briefly looking over the involved projects, this is a relatively complex set of ports so be prepared that it may take some time to get everything working properly.  Good on you for tackling this!

Do you have some support upstream?  AFAICT, mod_tile seems to pretty much only on Debian at this point.  

Re your questions:

1) I think you should add the ports in dependency order rather than one submission including everything.  These days, pull requests tend to get acted on more quickly than tickets.  If you haven’t seen it, we have a wiki page about MacPorts and git at:

https://trac.macports.org/wiki/WorkingWithGit <https://trac.macports.org/wiki/WorkingWithGit#CommongittaskswhileworkingwithMacPortsbase>

You can submit multiple pull requests at once.  Just add links to the other related PRs so anyone reviewing will know that there is a series.

2) I see that the GitHub project is named “mod_tile” while Debian has called their package "libapache2-mod-tile”.  MacPorts has several ports named mod_foo so I think mod_tile makes the most sense.

https://ports.macports.org/search/?installed_file=&q=mod_&name=on <https://ports.macports.org/search/?installed_file=&q=mod_&name=on>

Re the startup item, I think you should be able to use the startupitem.name and startup item.executable keywords to make the renderd daemon work as required.  No?

https://guide.macports.org/#reference.startupitems <https://guide.macports.org/#reference.startupitems>

3) Without seeing the shell script you’ve developed, it is difficult to say whether you should add it to the mod_tile port or port it in a standalone port.  I would lean towards including it in mod_tile.  Perhaps you could submit it upstream for inclusion in a future release?

Hope this helps,

Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20210829/89f4dde8/attachment.htm>


More information about the macports-dev mailing list