Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 0

Name:       nodejs-websocket-driver
Version:    0.3.2
Release:    2%{?dist}
Summary:    WebSocket protocol handler with pluggable I/O for Node.js
License:    MIT
Group:      System Environment/Libraries
URL:        http://github.com/faye/websocket-driver-node
Source0:    http://registry.npmjs.org/websocket-driver/-/websocket-driver-%{version}.tgz
# The test files are not included in the npm tarball.
# Source1 is generated by running Source10, which pulls from the upstream
# version control repository.
Source1:    tests-%{version}.tar.bz2
Source10:   dl-tests.sh

BuildArch:  noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif

BuildRequires:  nodejs-packaging

%if 0%{?enable_tests}
BuildRequires:  npm(jstest)
%endif

%description
%{summary}.


%prep
%setup -q -n package
%setup -q -T -D -a 1 -n package


%build
#nothing to do


%install
mkdir -p %{buildroot}%{nodejs_sitelib}/websocket-driver
cp -pr package.json lib/ \
    %{buildroot}%{nodejs_sitelib}/websocket-driver

%nodejs_symlink_deps


%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
/usr/bin/jstest spec/runner.js
%endif


%files
%doc CHANGELOG.md README.md examples/
%{nodejs_sitelib}/websocket-driver


%changelog
* Sun Mar 30 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.3.2-2
- include test files as separate source

* Sat Mar 29 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.3.2-1
- initial package