%{?nodejs_find_provides_and_requires} %global packagename unicode-length %global enable_tests 1 Name: nodejs-unicode-length Version: 1.0.0 Release: 6%{?dist} Summary: Get the length of unicode strings License: MIT URL: https://github.com/jviotti/unicode-length.git Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging BuildRequires: coffee-script %if 0%{?enable_tests} BuildRequires: mocha BuildRequires: npm(chai) BuildRequires: npm(lodash) BuildRequires: npm(chalk) %endif %description Get the length of unicode strings %prep %setup -q -n package # remove the pre-build version rm build/unicode-length.js %nodejs_fixdep chalk '>=0.4.0' %nodejs_fixdep punycode '>=1.3.1' %build # compile the .js file from the coffee-script version coffee -c -b -o build/ lib/*.coffee # copy the build .js file to lib/, for the tests cp build/*.js lib/ %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json build/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} # Compile the tests from coffee-script to js coffee -c -b tests/*.coffee %{_bindir}/mocha -R spec tests %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE %{nodejs_sitelib}/%{packagename} %changelog * Sun Jan 17 2016 Jared Smith - 1.0.0-6 - Fix up a couple of dependencies for older versions in Fedora - Don't include coffeelint.json in package * Sat Nov 07 2015 Jared Smith - 1.0.0-5 - Add missing BuildRequire for mocha * Fri Nov 06 2015 Jared Smith - 1.0.0-4 - Fix tests - Fix inclusion of build directory - Rebuild the .js from the source .coffee files * Wed Oct 28 2015 Jared Smith - 1.0.0-1 - Initial packaging