Blob Blame History Raw
%global commit 86a331e6d8bad7fac1a4a53b46a2bd49c848f348
%global module_name TileStache

Name:           python-tilestache
Version:        1.49.11
Release:        3%{?dist}
Summary:        A stylish alternative for caching your map tiles

Group:          Applications/Databases
License:        BSD
URL:            http://tilestache.org
Source0:        https://github.com/%{module_name}/%{module_name}/archive/%{commit}/%{module_name}-%{commit}.tar.gz
# Modify font search to find the system DejaVuSansMono.ttf - Not submitted upstream
Patch0:         %{name}-1.49.11-use-system-fonts.patch
# Don't install the bundled font or docs - Not submitted upstream
Patch1:         %{name}-1.49.11-unbundle-installs.patch

BuildArch:      noarch

BuildRequires:  python2-devel
BuildRequires:  python-setuptools
Requires:       font(dejavusansmono)
Requires:       python-imaging
Requires:       python-modestmaps
Requires:       python-simplejson
Requires:       python-werkzeug

%package examples
Summary:        Example code for TileStache

Requires:       %{name}%{?isa} = %{version}-%{release}

%description
TileStache is a Python-based server application that can serve up map tiles
based on rendered geographic data. You might be familiar with TileCache, the
venerable open source WMS server from MetaCarta. TileStache is similar, but we
hope simpler and better-suited to the needs of designers and cartographers.

%description examples
Example code for TileStache: A stylish alternative for caching your map tiles

%prep
%setup -qn %{module_name}-%{commit}
%patch0 -p1
%patch1 -p1

# Remove shebang from a script
sed -i '1{\@^#!/usr/bin/env python@d}' %{module_name}/Goodies/Caches/GoogleCloud.py

# Add shebang to a script
sed -i '1i #!/bin/bash' examples/zoom_example/run_server.sh

%build
%{__python2} setup.py build

%install
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}

mkdir -p %{buildroot}%{_mandir}/man1
install -p -m0644 man/tilestache-clean.1 %{buildroot}%{_mandir}/man1/
install -p -m0644 man/tilestache-render.1 %{buildroot}%{_mandir}/man1/
install -p -m0644 man/tilestache-seed.1 %{buildroot}%{_mandir}/man1/
install -p -m0644 man/tilestache-server.1 %{buildroot}%{_mandir}/man1/

mkdir -p %{buildroot}%{_datadir}/%{module_name}
cp -a examples %{buildroot}%{_datadir}/%{module_name}/

%files
%doc CHANGELOG LICENSE README.md
%{_bindir}/tilestache-clean.py
%{_bindir}/tilestache-compose.py
%{_bindir}/tilestache-list.py
%{_bindir}/tilestache-render.py
%{_bindir}/tilestache-seed.py
%{_bindir}/tilestache-server.py
%{_mandir}/man1/tilestache-clean.1.gz
%{_mandir}/man1/tilestache-render.1.gz
%{_mandir}/man1/tilestache-seed.1.gz
%{_mandir}/man1/tilestache-server.1.gz
%{python2_sitelib}/%{module_name}/
%{python2_sitelib}/%{module_name}-%{version}-py?.?.egg-info

%files examples
%doc CHANGELOG LICENSE README.md
%{_datadir}/%{module_name}

%changelog
* Mon Dec 15 2014 Scott K Logan <logans@cottsay.net> - 1.49.11-3
- More spec clean-ups for Package Review
- Use GitHub upstream
- Add examples subpackage

* Sun Nov 30 2014 Scott K Logan <logans@cottsay.net> - 1.49.11-2
- Spec clean-ups for Package Review

* Sun Sep 28 2014 Scott K Logan <logans@cottsay.net> - 1.49.11-1
- Initial package