Blob Blame History Raw
%global enable_tests 1

Name:           carto
Version:        0.9.5
Release:        1%{?dist}
Summary:        Mapnik style sheet compiler

License:        ASL 2.0
URL:            https://github.com/mapbox/carto
Source0:        http://registry.npmjs.org/carto/-/carto-%{version}.tgz
# The test files are not included in the npm tarball.
# Source1 is generated using Source10, which pulls from the upstream
# version control repository.
Source1:        carto-tests-v%{version}.tar.bz2
Source10:       carto-dl-tests.sh
BuildArch:      noarch
ExclusiveArch:  %{nodejs_arches} noarch

Requires:       npm(millstone)

BuildRequires:  nodejs-packaging

%if 0%{?enable_tests}
BuildRequires:  npm(mocha)
BuildRequires:  npm(mapnik-reference)
BuildRequires:  npm(sax)
BuildRequires:  npm(underscore)
%endif

%description
Carto is a style sheet compiler for Mapnik. It's an evolution of
the Cascadenik idea and language, with an emphasis on speed and
flexibility.


%prep
%setup -q -n package
%setup -T -D -a 1 -q -n package
rm -rf node_modules


%build


%install
mkdir -p %{buildroot}/%{nodejs_sitelib}/carto
cp -pr package.json bin lib %{buildroot}/%{nodejs_sitelib}/carto
mkdir -p %{buildroot}/%{nodejs_sitelib}/carto/bin
mkdir -p %{buildroot}/%{_bindir}
ln -s %{nodejs_sitelib}/carto/bin/carto %{buildroot}/%{_bindir}/carto
mkdir -p %{buildroot}%{_mandir}/man1
cp -p man/*.1 %{buildroot}%{_mandir}/man1
%nodejs_symlink_deps


%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%{nodejs_sitelib}/mocha/bin/mocha -R spec test/*.test.js
%endif


%files
%doc LICENSE README.md CHANGELOG.md
%{nodejs_sitelib}/carto
%{_bindir}/carto
%{_mandir}/man1/carto.1*


%changelog
* Wed Oct 30 2013 Tom Hughes <tom@compton.nu> - 0.9.5-1
- Update to 0.9.5 upstream release
- Update to latest nodejs packaging standards
- Enable tests

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Sun Feb 10 2013 Tom Hughes <tom@compton.nu> - 0.9.4-1
- Initial build of 0.9.4