Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 1

Name:       nodejs-watchit
Version:    0.0.4
Release:    11%{?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
# Workaround fs.stat issue in nodejs 0.10
# Can be removed once nodejs is updated
# https://bugzilla.redhat.com/show_bug.cgi?id=1239735
Patch0:     nodejs-watchit-debounce.patch

%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} .
%patch0 -p1


%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/register \
    --require test/common.js --growl
%endif


%files
%doc LICENSE README.mdown docs/
%{nodejs_sitelib}/watchit


%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.4-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Nov 15 2015 Tom Hughes <tom@compton.nu> - 0.0.4-10
- make debounce test reliable in nodejs 0.10

* Sat Nov 14 2015 Tom Hughes <tom@compton.nu> - 0.0.4-9
- update for changes to coffee-script

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.4-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

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

* 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