Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 1

Name:       nodejs-watchit
Version:    0.0.4
Release:    6%{?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

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

BuildRequires:  nodejs-packaging
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
%nodejs_symlink_deps --check
# 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
* Tue Aug 20 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.0.4-6
- restrict to compatible arches

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

* Sat Jun 22 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.0.4-4
- add missing changelog entry

* 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