Blob Blame History Raw
 %bcond_without tests

%global pypi_name geotiler

%global _description %{expand:
GeoTiler is a library to create maps using tiles from a map provider.
The main goal of the library is to enable a programmer to create maps
using tiles downloaded from OpenStreetMap, Stamen or other map provider.
The maps can be used by interactive applications or to create data analysis

Name:           python-%{pypi_name}
Version:        0.15.1
Release:        1%{?dist}
Summary:        GeoTiler is a library to create map using tiles from a map provider

License:        GPLv3+
URL:  {pypi_name}
Source0:        %{pypi_source %{pypi_name}}

# Upstream for modestmaps-py was asked to clarify the exact BSD license
# text via and by direct
# email to Michal Migurski. Since that upstream has remained unresponsive,
# the intended license text is assumed to be the 3-clause BSD license from
# (as the more restrictive of
# the two most common BSD variants, the other being
Source1:        LICENSE-modestmaps-py
# Man pages hand-written for Fedora in groff_man(7) format based on upstream
# --help output.
Source2:        geotiler-fetch.1
Source3:        geotiler-lint.1
Source4:        geotiler-route.1

# Downstream-only: patch out linting and coverage dependencies
Patch:          geotiler-0.15.0-linters.patch

BuildRequires:  python3-devel
BuildRequires:  make

BuildArch:      noarch

%description %_description

%package -n python3-%{pypi_name}
Summary:        %{summary}

BuildRequires:  pyproject-rpm-macros

#For documentation
BuildRequires:  %{py3_dist sphinx}
BuildRequires:  %{py3_dist sphinx-rtd-theme}
BuildRequires:  python3-sphinx-latex
BuildRequires:  latexmk
#For rendered image placeholders
BuildRequires:  ImageMagick
BuildRequires:  font(liberationsans)

%if %{with tests}
BuildRequires:  %{py3_dist pytest}
BuildRequires:  %{py3_dist numpy}

# For geotiler-route command-line tool:
Requires:       %{py3_dist pycairo}
Requires:       %{py3_dist lxml}
%description -n python3-%{pypi_name} %_description

%package doc
Summary:        %{summary}

%description doc
Documentation for %{name}.

%autosetup -n %{pypi_name}-%{version} -p1
cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} .

rm -fv poetry.lock

%pyproject_buildrequires -r %{?with_tests:-x tests}


# Insert placeholders for documentation sample images that are normally
# generated by downloading (variously-licensed) data from the Internet in the
# top-level Makefile.
convert -size 512x512 xc:gray -font 'Liberation-Sans-Bold-Italic' \
    -pointsize 48 -fill black -gravity center -annotate +0+0 \
    'Rendered image\nnot available' doc/map-osm.png
cp -p doc/map-osm.png doc/map-stamen-toner.png
cp -p doc/map-osm.png doc/map-bluemarble.png
convert -size 1920x1080 xc:gray -font 'Liberation-Sans-Bold-Italic' \
    -pointsize 96 -fill black -gravity center -annotate +0+0 \
    'Rendered image\nnot available' doc/map-path.png
PYTHONPATH="${PWD}" sphinx-build -b latex doc _latex %{?_smp_mflags}
%make_build -C _latex LATEXMKOPTS='-quiet'

%pyproject_save_files -l geotiler
install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 \
    geotiler-fetch.1 geotiler-lint.1 geotiler-route.1

%if %{with tests}

%files -n python3-%{pypi_name} -f %{pyproject_files}

%files doc
%license COPYING
%doc _latex/geotiler.pdf

* Fri Feb 09 2024 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 0.15.1-1
- Update to 0.15.1 (close RHBZ#2259601)

* Fri Jan 26 2024 Fedora Release Engineering <> - 0.15.0-3
- Rebuilt for

* Mon Jan 22 2024 Fedora Release Engineering <> - 0.15.0-2
- Rebuilt for

* Wed Aug 02 2023 Benjamin A. Beasley <> - 0.15.0-1
- Update to 0.15.0 (close RHBZ#2228274)

* Mon Jul 31 2023 Benjamin A. Beasley <> - 0.14.7-4
- Patch out unused uvloop test dependency
- Patch for Pillow 10 (fix RHBZ#2220253, fix RHBZ#2226199)
- Patch out unwanted linting and coverage test dependencies

* Fri Jul 21 2023 Fedora Release Engineering <> - 0.14.7-3
- Rebuilt for

* Fri Jan 20 2023 Fedora Release Engineering <> - 0.14.7-2
- Rebuilt for

* Tue Jan 3 2023 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 0.14.7-1
- Update to the latest upstream's release
- Remove patch

* Fri Jul 22 2022 Fedora Release Engineering <> - 0.14.5-5
- Rebuilt for

* Mon Jun 20 2022 Python Maint <> - 0.14.5-4
- Rebuilt for Python 3.11

* Fri Jan 21 2022 Fedora Release Engineering <> - 0.14.5-3
- Rebuilt for

* Sun Nov 28 2021 Benjamin A. Beasley <> - 0.14.5-2
- Do not omit first argument to pypi_source
- Reduce LaTeX PDF build verbosity
- Add extra dependencies for geotiler-route CLI tool
- Add man pages for command-line tools

* Sun Oct 17 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 0.14.5-1
- Initial package