diff --git a/debian/config.yaml b/debian/config.yaml new file mode 100644 index 00000000..93f7c464 --- /dev/null +++ b/debian/config.yaml @@ -0,0 +1,31 @@ +# Connection keep alive timeout [default: 75] +keep_alive: 75 + +# The socket address to bind [default: 0.0.0.0:3000] +listen_addresses: '0.0.0.0:3000' + +# Number of web server workers +worker_processes: 8 + +# see https://maplibre.org/martin/config-file.html + +# postgres: +# connection_string: 'postgresql://postgres@localhost:5432/db' +# default_srid: 4326 +# pool_size: 20 +# max_feature_count: 1000 +# disable_bounds: false + +# pmtiles: +# paths: +# - /dir-path +# - /path/to/pmtiles.pmtiles +# sources: +# pm-src1: /path/to/pmtiles1.pmtiles + +# mbtiles: +# paths: +# - /dir-path +# - /path/to/mbtiles.mbtiles +# sources: +# mb-src1: /path/to/mbtiles1.mbtiles diff --git a/debian/martin.service b/debian/martin.service new file mode 100644 index 00000000..46f34907 --- /dev/null +++ b/debian/martin.service @@ -0,0 +1,8 @@ +[Unit] +Description = A blazing fast map tile server which can generate and serve vector tiles on the fly from large PostGIS databases, PMTile, and MBTile files + +[Service] +ExecStart = /usr/bin/martin --config /usr/local/etc/martin/config.yaml + +[Install] +WantedBy = multi-user.target diff --git a/martin/Cargo.toml b/martin/Cargo.toml index a11c2a93..21cf3fd8 100644 --- a/martin/Cargo.toml +++ b/martin/Cargo.toml @@ -20,6 +20,21 @@ homepage.workspace = true name = "martin" maintainer = "Stepan Kuzmin , Yuri Astrakhan , MapLibre contributors" depends = "$auto" +maintainer-scripts = "../debian" +assets = [ + ["target/release/martin", "/usr/bin/martin", "755"], + ["../README.md","/usr/share/doc/martin/README.md","644"], + ["../debian/config.yaml", "/usr/share/doc/martin/config.yaml", "644"], + ["../debian/config.yaml", "/usr/local/etc/martin/config.yaml", "644"], +] + +# see https://github.com/kornelski/cargo-deb/blob/main/systemd.md#packagemetadatadebsystemd-units-options +[package.metadata.deb.systemd-units] +unit-scripts = "../debian/" +enable = false +start = false +restart-after-upgrade = false +stop-on-upgrade = true [lib] path = "src/lib.rs"