Blob Blame History Raw
%global npm_name ws
# Although there are tests
# the dependancies aren't in Fedora yet
%global enable_tests 0

%{?nodejs_find_provides_and_requires}

Summary:       Web socket client, server and console for nodejs
Name:          nodejs-%{npm_name}
Version:       0.4.31
Release:       5%{?dist}
Group:         System Environment/Libraries
License:       MIT
URL:           https://github.com/einaros/ws
Source0:       http://registry.npmjs.org/%{npm_name}/-/%{npm_name}-%{version}.tgz
BuildRequires: python
BuildRequires: node-gyp
BuildRequires: nodejs-devel
BuildRequires: npm(nan)
%if 0%{?enable_tests}
BuildRequires:  npm(ansi)
BuildRequires:  npm(benchmark)
BuildRequires:  npm(expect.js)
BuildRequires:  npm(mocha)
BuildRequires:  npm(should)
%endif
ExclusiveArch: %{ix86} x86_64 %{arm}

%description
Simple to use, blazing fast and thoroughly tested 
web socket client, server and console for nodejs, 
up-to-date against RFC-6455

%prep
%setup -q -n package

rm -f examples/fileapi/.npmignore

%nodejs_fixdep commander '>=0.6.1'
%nodejs_fixdep nan '>=0.3.0'

%build
export CXXFLAGS="%{optflags}"
export NODE_PATH="/usr/lib/node_modules/"
node-gyp rebuild

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}
cp -pr bin build/Release/*.node index.js lib package.json %{buildroot}%{nodejs_sitelib}/%{npm_name}

# Setup Binaries
mkdir %{buildroot}%{_bindir}
ln -s %{nodejs_sitelib}/%{npm_name}/bin/wscat %{buildroot}%{_bindir}/wscat

# Fix permissions
chmod 755 %{buildroot}%{nodejs_sitelib}/%{npm_name}/bufferutil.node
chmod 755 %{buildroot}%{nodejs_sitelib}/%{npm_name}/validation.node

%if 0%{?enable_tests}
%check
make test
%endif

%files
%doc History.md README.md examples doc
%{nodejs_sitelib}/%{npm_name}
%{_bindir}/wscat

%changelog
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.31-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.31-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri Feb 14 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.4.31-3
- rebuild for icu-53 (via v8)

* Fri Feb 07 2014 Troy Dawson <tdawson@redhat.com> - 0.4.31-2
- Fix nan dependency

* Thu Feb 06 2014 Troy Dawson <tdawson@redhat.com> - 0.4.31-1
- Update to version 0.4.31
- add macro to invoke dependency generator on EL6

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

* Wed Jun 05 2013 Troy Dawson <tdawson@redhat.com> - 0.4.25-4
- add nodejs exclusive arch

* Wed May 29 2013 Troy Dawson <tdawson@redhat.com> - 0.4.25-3
- Use nodejs_fixdep instead of sed to fix dependancy

* Wed May 29 2013 Troy Dawson <tdawson@redhat.com> - 0.4.25-2
- Fixed Summary and Description spelling errors
- Fixed nodejs-commander version dependancy
- Cleanup extra files and strange permissions

* Fri Mar 01 2013 Troy Dawson <tdawson@redhat.com> - 0.4.25-1
- Update to 0.4.25
- Update spec to Fedora nodejs standards

* Fri Nov 16 2012 Troy Dawson <tdawson@redhat.com> - 0.4.22-3
- Fix for building native modules

* Wed Nov 14 2012 Troy Dawson <tdawson@redhat.com> - 0.4.22-1
- Initial build using tchor spec template