Skip to content

Commit c683c55

Browse files
Felix Delattrepantierra
authored andcommitted
Added compilation instructions for several distros
1 parent 4ea8729 commit c683c55

20 files changed

+289
-140
lines changed

.github/actions/apt/provision/action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ inputs:
77
runs:
88
using: composite
99
steps:
10-
- name: Update installed packages
11-
uses: ./.github/actions/apt/update
1210
- name: Install package(s)
1311
uses: ./.github/actions/apt/install
1412
with:

.github/actions/apt/update/action.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/actions/yum/provision/action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ inputs:
1212
runs:
1313
using: composite
1414
steps:
15-
- name: Update installed packages
16-
uses: ./.github/actions/yum/update
1715
- name: Install group(s)
1816
uses: ./.github/actions/yum/groups-install
1917
with:

.github/actions/yum/update/action.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/build-and-test-centos-7.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
name: Build & Test (CentOS 7)
33

44
on:
5-
pull_request:
65
push:
76
branches:
8-
- centos7
7+
- master
8+
- distros/centos-7
99

1010
env:
1111
build-dependencies: >-

.github/workflows/build-and-test-fedora-34.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches:
88
- master
99
- develop
10+
- distros/fedora-34
1011

1112
env:
1213
build-group-dependencies: >-

.github/workflows/build-and-test-ubuntu-latest.yml renamed to .github/workflows/build-and-test-ubuntu-20-04.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
2-
name: Build & Test (Ubuntu Latest)
2+
name: Build & Test (Ubuntu 20.04)
33

44
on:
55
pull_request:
66
push:
77
branches:
88
- master
99
- develop
10+
- distros/ubuntu-20-04
1011

1112
env:
1213
build-dependencies: >-
@@ -22,7 +23,7 @@ env:
2223
jobs:
2324
build-and-test:
2425
name: Build & Test
25-
runs-on: ubuntu-latest
26+
runs-on: ubuntu-20.04
2627
steps:
2728
- name: Checkout code
2829
uses: actions/checkout@v2

Makefile.am

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ bin_PROGRAMS = \
2727
noinst_PROGRAMS = gen_tile_test
2828

2929
man_MANS = \
30-
docs/renderd.1 \
31-
docs/render_expired.1 \
32-
docs/render_list.1 \
33-
docs/render_old.1 \
34-
docs/render_speedtest.1
30+
docs/man/renderd.1 \
31+
docs/man/render_expired.1 \
32+
docs/man/render_list.1 \
33+
docs/man/render_old.1 \
34+
docs/man/render_speedtest.1
3535

3636
renderddir = $(sysconfdir)
3737

README.rst

Lines changed: 19 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ As an alternative to ``renderd`` its drop-in replacement
1818
`Tirex <https://github.com/openstreetmap/tirex>`__ can be used in
1919
combination with ``mod_tile``.
2020

21+
Dependencies
22+
------------
23+
24+
* `GNU/Linux` Operating System (works best on Debian or Ubuntu)
25+
* `Apache 2 HTTP webserver <https://httpd.apache.org/>`__
26+
* `Mapnik <https://mapnik.org/>`__
27+
* `Cairo 2D graphics library <https://cairographics.org/>`__
28+
* `Curl library (SSL variant) <https://curl.haxx.se/>`__
29+
* `Iniparser library <https://github.com/ndevilla/iniparser>`__
30+
* `GLib library <https://gitlab.gnome.org/GNOME/glib>`__
31+
2132
Installation
2233
------------
2334

@@ -36,53 +47,18 @@ These packages for **Debian** and **Ubuntu** are being maintained by
3647
the `Debian GIS Team <https://wiki.debian.org/DebianGis>`__ in the respective
3748
`repository <https://salsa.debian.org/debian-gis-team/libapache2-mod-tile>`__.
3849

39-
Dependencies
40-
------------
41-
42-
* `GNU/Linux` Operating System (works best on Debian or Ubuntu)
43-
* `Apache 2 HTTP webserver <https://httpd.apache.org/>`__
44-
* `Mapnik <https://mapnik.org/>`__
45-
* `Cairo 2D graphics library <https://cairographics.org/>`__
46-
* `Curl library (SSL variant) <https://curl.haxx.se/>`__
47-
* `Iniparser library <https://github.com/ndevilla/iniparser>`__
48-
* `GLib library <https://gitlab.gnome.org/GNOME/glib>`__
49-
5050
Compilation
5151
-----------
5252

53-
You may want to compile this software for developing on it or when using
54-
on operating systems this is not being packaged for. On Debian or Ubuntu
55-
systems the following packages are needed to start compiling. On other systems
56-
the name of the libary might differ slightly.
57-
58-
::
59-
60-
$ apt install build-essential \
61-
autoconf \
62-
apache2-dev \
63-
libcairo2-dev \
64-
libcurl4-gnutls-dev \
65-
libglib2.0-dev \
66-
libiniparser-dev \
67-
libmapnik-dev
68-
69-
*(You may install more and optional dependencies in order to add
70-
functionality to renderd)*
71-
72-
Once the dependencies are installed you can compile and install
73-
mod_tile and renderd:
74-
75-
::
76-
77-
$ ./autogen.sh
78-
$ ./configure
79-
$ make
80-
$ sudo make install
81-
$ sudo make install-mod_tile
53+
You may want to compile this software yourself. Either for developing on it or
54+
when using it on an operating system this is not being packaged for.
8255

83-
Be aware that you have to add configuration files that are adjusted to your
84-
environment before you can run it all.
56+
We prepared instructions for you on how to build the software on the following
57+
distributions:
8558

59+
* `CentOS 7 <docs/build/building_on_centos_7.md>`__
60+
* `Fedora 34 </docs/build/building_on_fedora_34.md>`__
61+
* `Ubuntu 20.04 </docs/build/building_on_ubuntu_20_04.md>`__ (this should work as well for Debian 10 and later)
8662

8763
Configuration
8864
-------------
@@ -92,7 +68,7 @@ yourself, you can continue with the configuration. For your convenience
9268
example configuration files are distributed with the software packages and
9369
located in the ``etc`` directory of this repository.
9470

95-
A very basic example-map and data can be found in the ``example-map``
71+
A very basic example-map and data can be found in the ``utils/example-map``
9672
directory. For a simple test copy it over to ``/var/www/example-map``.
9773

9874
Copy the configuration files to their place, too:

docs/build/building_on_centos_7.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Building on CentOS 7
2+
3+
This documents step by step on how to compile and put into use the software `mod_tile` and `renderd`.
4+
Please see our [Continous Integration script](../../.github/workflows/build-and-test-centos-7.yml) for more detail.
5+
6+
As `CentOS 7` does not provide any `mapnik`/`mapnik-devel` packages in the official repository (nor are any available from `EPEL`,) it must therefore be built and installed before `mod_tile` can be built. Although `boost-devel` is present in the official repository, the version available there (`1.53.0`) is not in [mapnik's recommended dependency list](https://github.com/mapnik/mapnik/blob/v3.0.24/INSTALL.md#depends), so the `boost169-devel` package from `EPEL` should probably be used instead.
7+
8+
```shell
9+
#!/usr/bin/env bash
10+
export LD_LIBRARY_PATH=/usr/local/lib
11+
export MAPNIK_VERSION=3.0.24
12+
13+
# Install `EPEL` yum repository
14+
sudo yum --assumeyes install epel-release
15+
16+
# Update installed packages
17+
sudo yum --assumeyes update
18+
19+
# Install "Development Tools" group
20+
sudo yum --assumeyes groups install \
21+
"Development Tools"
22+
23+
# Install build dependencies
24+
sudo yum --assumeyes install \
25+
boost169-devel \
26+
cairo-devel \
27+
freetype-devel \
28+
gdal-devel \
29+
glib2-devel \
30+
harfbuzz-devel \
31+
httpd-devel \
32+
iniparser-devel \
33+
libcurl-devel \
34+
libicu-devel \
35+
libjpeg-turbo-devel \
36+
libmemcached-devel \
37+
libpng-devel \
38+
librados2-devel \
39+
libtiff-devel \
40+
libwebp-devel \
41+
libxml2-devel \
42+
postgresql-devel \
43+
proj-devel \
44+
sqlite-devel \
45+
zlib-devel
46+
47+
# Export `GDAL_DATA` & `PROJ_LIB` variables and create directories (if needed)
48+
export GDAL_DATA=$(gdal-config --datadir)
49+
export PROJ_LIB=/usr/share/proj
50+
sudo --preserve-env mkdir -p ${GDAL_DATA} ${PROJ_LIB}
51+
52+
# Download, Build & Install `Mapnik`
53+
sudo mkdir -p /usr/local/src/mapnik-${MAPNIK_VERSION}
54+
cd /usr/local/src/mapnik-${MAPNIK_VERSION}
55+
sudo curl --silent --location https://github.com/mapnik/mapnik/releases/download/v${MAPNIK_VERSION}/mapnik-v${MAPNIK_VERSION}.tar.bz2 \
56+
| sudo tar --verbose --extract --bzip2 --strip-components=1 --file=-
57+
sudo --preserve-env ./configure BOOST_INCLUDES=/usr/include/boost169 BOOST_LIBS=/usr/lib64/boost169
58+
sudo --preserve-env JOBS=$(nproc) make
59+
sudo --preserve-env make install
60+
61+
# Fix issue with `iniparser.h` from `iniparser-devel` not being in the expected location
62+
sudo mkdir /usr/include/iniparser
63+
sudo ln -s /usr/include/iniparser.h /usr/include/iniparser/iniparser.h
64+
65+
# Download and build
66+
sudo git clone https://github.com/openstreetmap/mod_tile.git /usr/local/src/mod_tile
67+
cd /usr/local/src/mod_tile
68+
sudo --preserve-env ./autogen.sh
69+
sudo --preserve-env ./configure
70+
sudo --preserve-env make
71+
72+
# Create tiles directory
73+
sudo mkdir --parents /run/renderd /var/cache/renderd/tiles
74+
75+
# Move files of example map
76+
sudo cp -r "utils/example-map" /var/www/example-map
77+
78+
# Install leaflet
79+
sudo curl --silent \
80+
"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js" \
81+
> /var/www/example-map/leaflet/leaflet.min.js
82+
sudo curl --silent \
83+
"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css" \
84+
> /var/www/example-map/leaflet/leaflet.css
85+
86+
# Add configuration
87+
sudo cp "etc/renderd/renderd.conf.examples" /etc/renderd.conf
88+
sudo cp "etc/apache2/renderd.conf" /etc/httpd/conf.d/renderd.conf
89+
sudo cp "apache2/renderd-example-map.conf" \
90+
/etc/httpd/conf.d/renderd-example-map.conf
91+
92+
# Apply CentOS specific changes to configuration files
93+
sudo sed --in-place \
94+
"s#/usr/lib/mapnik/3.0/input#/usr/lib64/mapnik/input#g" \
95+
/etc/renderd.conf
96+
sudo sed --in-place \
97+
"s#/usr/share/fonts/truetype#/usr/share/fonts#g" \
98+
/etc/renderd.conf
99+
100+
# Add and activate mod_tile for Apache
101+
echo "LoadModule tile_module /usr/lib64/httpd/modules/mod_tile.so" \
102+
| sudo tee --append /etc/httpd/conf.modules.d/11-mod_tile.conf
103+
104+
# Make example map the new main page of Apache
105+
sudo rm --force /etc/httpd/conf.d/welcome.conf
106+
107+
# Install software
108+
sudo make install
109+
sudo make install-mod_tile
110+
111+
# Start services
112+
sudo httpd
113+
sudo renderd -f
114+
```
115+
116+
Then you can visit: `http://localhost/example-map`

0 commit comments

Comments
 (0)