%{?nodejs_find_provides_and_requires}
%global enable_tests 0
Name: nodejs-watchit
Version: 0.0.4
Release: 4%{?dist}
Summary: A sensible wrapper around fs.watch for Node.js
# Upstream have been informed about missing LICENSE:
# https://github.com/TrevorBurnham/Watchit/issues/6
License: MIT
Group: System Environment/Libraries
URL: https://github.com/TrevorBurnham/Watchit
Source0: http://registry.npmjs.org/watchit/-/watchit-%{version}.tgz
Source1: LICENSE
BuildArch: noarch
BuildRequires: nodejs-devel
BuildRequires: npm(docco)
# Currently to compile the .coffee files, watchit depends on itself,
# which is not yet available.
%if 0%{?enable_tests}
BuildRequires: coffee-script
BuildRequires: npm(expect.js)
BuildRequires: npm(mocha)
%endif
%description
%{summary}.
%prep
%setup -q -n package
cp -a %{SOURCE1} .
%build
%{nodejs_sitelib}/docco/bin/docco ./src/watchit.coffee
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/watchit
cp -pr package.json lib/ \
%{buildroot}%{nodejs_sitelib}/watchit
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
ln -sf %{nodejs_sitelib} .
# Broken test which upstream haven't fixed:
# https://github.com/TrevorBurnham/Watchit/issues/5
rm -f test/include.coffee
%{nodejs_sitelib}/mocha/bin/mocha --compilers coffee:coffee-script \
--require test/common.js --growl
%endif
%files
%doc LICENSE README.mdown docs/
%{nodejs_sitelib}/watchit
%changelog
* Sat May 25 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.0.4-3
- include copy of MIT license to comply with license requirements while
waiting for upstream themselves to include a copy
* Sun Feb 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.0.4-2
- amend mocha options
* Sun Feb 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.0.4-1
- initial package