File martin.spec of Package martin
#
# spec file for package martin
#
# Copyright (c) 2026 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global crate martin
Name: %{crate}
Version: 1.4.0
Release: 0
Summary: MapLibre Vector Tiles server and tools
License: Apache-2.0 or MIT
URL: https://github.com/maplibre/martin
Source0: %{name}-v%{version}.tar.zst
Source1: registry.tar.zst
BuildRequires: cargo
BuildRequires: cargo-packaging
BuildRequires: rust
BuildRequires: gcc-c++
BuildRequires: zlib-devel
# BuildRequires: nodejs-default
# BuildRequires: npm-default
ExclusiveArch: %{rust_tier1_arches}
%description
Martin is a tile server and a set of tools able to generate vector tiles on the fly
from large PostgreSQL databases, and serve tiles from PMTiles and MBTiles files.
Martin optimizes for speed and heavy traffic.
%prep
%autosetup -p1 -a1 -n %{name}-v%{version}
%build
export CARGO_NET_OFFLINE=true
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
export CARGO_HOME=$PWD/.cargo
export NODE_ENV=production
export RUST_BACKTRACE=FULL
%{cargo_build} --no-default-features \
--features "fonts,mbtiles,pmtiles,postgres,sprites,styles,metrics" \
--verbose
# Explicitly exclude webui ↑
%install
cd martin
install -D -m 755 ../target/release/martin %{buildroot}%{_bindir}/martin
# manual process
# install -D -d -m 0755 %{buildroot}%{_bindir}
# install -m 0755 %{_builddir}/%{name}-%{version}/target/release/%{name} %{buildroot}%{_bindir}/%{name}
%check
%files
%{_bindir}/martin
%{_bindir}/martin-cp
%{_bindir}/mbtiles
%license LICENSE-APACHE LICENSE-MIT
%doc README.md
%changelog