%global enable_tests 0
Name: nodejs-millstone
Version: 0.5.15
Release: 2%{?dist}
Summary: Prepares data sources in an MML file for consumption in Mapnik
License: BSD
URL: https://npmjs.org/package/millstone
Source0: http://registry.npmjs.org/millstone/-/millstone-%{version}.tgz
# Accepted upstream - see https://github.com/mapbox/millstone/pull/94
Patch0: nodejs-millstone-pool.patch
# Offered upstream - see https://github.com/mapbox/millstone/pull/96
Patch1: nodejs-millstone-request.patch
# Offered upstream - see https://github.com/mapbox/millstone/pull/96
Patch2: nodejs-millstone-underscore.patch
# Patch out test that fails due to:
# https://github.com/mikeal/request/issues/459
Patch3: nodejs-millstone-tests.patch
BuildArch: noarch
BuildRequires: nodejs-devel
%if 0%{?enable_tests}
BuildRequires: npm(mocha)
BuildRequires: npm(generic-pool)
BuildRequires: npm(mime)
BuildRequires: npm(request)
BuildRequires: npm(srs)
BuildRequires: npm(step)
BuildRequires: npm(underscore)
BuildRequires: npm(zipfile)
%endif
%description
As of carto 0.2.0, the Carto module expects all data sources and
resources to be localized - remote references like URLs and providers
are not downloaded when maps are rendered.
Millstone now contains this logic - it provides two functions, resolve
and flush. Resolve takes an MML file and returns a localized version, and
flush can be used to clear the cache of a specific resource.
%prep
%setup -q -n package
%patch0 -p1
%patch1 -p1 -b .request
%patch2 -p1 -b .underscore
%patch3 -p1 -b .tests
rm -rf node_modules
%build
%if 0%{?enable_tests}
%check
ln -s %{nodejs_sitelib} .
NODE_PATH=lib %{nodejs_sitelib}/mocha/bin/mocha -R spec --timeout 10000
%endif
%install
mkdir -p %{buildroot}/%{nodejs_sitelib}/millstone
cp -pr package.json bin lib %{buildroot}/%{nodejs_sitelib}/millstone
%nodejs_symlink_deps
%files
%doc LICENSE README.md CHANGELOG.md architecture.txt
%{nodejs_sitelib}/millstone
%changelog
* Thu Mar 14 2013 Tom Hughes <thh@cyberscience.com> - 0.5.15-2
- Rebuild against nodejs-request 2.14
* Sun Feb 10 2013 Tom Hughes <tom@compton.nu> - 0.5.15-1
- Initial build of 0.5.15