Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 3d857cfc864573f7588288a92b09f52c > files > 5

nodejs-srs-0.2.20-3.fc18.src.rpm

%global enable_tests 1

Name:           nodejs-srs
Version:        0.2.20
Release:        3%{?dist}
Summary:        Spatial reference library for Node.js

License:        BSD
URL:            https://github.com/springmeyer/node-srs
# Real source is http://registry.npmjs.org/srs/-/srs-%{version}.tgz
# but files copied from gdal whose provenance is unclear (as described
# in PROVENANCE.TXT and PROVENANCE.TXT-fedora in gdal) have been
# removed from the tar ball by the cleaner script.
Source0:        srs-%{version}-fedora.tgz
# Cleaner script for the tarball
Source1:        nodejs-srs-cleaner.sh
# Settings file normally generated by waf build
Source2:        nodejs-srs-settings.js
# Link against system libraries
Patch0:         nodejs-srs-libraries.patch
# Patch out tests which rely on removed files
Patch1:         nodejs-srs-tests.patch

ExclusiveArch:  %{ix86} x86_64 %{arm}

BuildRequires:  nodejs-devel
BuildRequires:  node-gyp
BuildRequires:  gdal-devel

%if 0%{?enable_tests}
BuildRequires:  npm(mocha)
BuildRequires:  gdal
BuildRequires:  proj-epsg
%endif

%{?nodejs_default_filter}

%description
Bindings to libosr for handling spatial references in Node.js.


%prep
%setup -q -n package-fedora
%patch0 -p0 -b .libraries
%patch1 -p1 -b .tests
cp -pr %{SOURCE2} lib/settings.js
rm -rf deps node_modules lib/srs_data


%build
export CXXFLAGS="%{optflags}"
node-gyp rebuild
cp -pr build/Release/_srs.node lib


%install
mkdir -p %{buildroot}/%{nodejs_sitearch}/srs
cp -pr package.json lib %{buildroot}/%{nodejs_sitearch}/srs
%nodejs_symlink_deps


%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
NODE_PATH=lib %{nodejs_sitearch}/mocha/bin/mocha -R spec
%endif


%files
%doc LICENSE.txt README.md
%{nodejs_sitearch}/srs


%changelog
* Wed Apr  3 2013 Tom Hughes <tom@compton.nu> - 0.2.20-3
- Filter out provide for Node.js native extension
- Enable tests

* Wed Mar 13 2013 Tom Hughes <tom@compton.nu> - 0.2.20-2
- Restrict supported architectures using ExclusiveArch
- Rebuild against node 0.10

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