Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global packagename StringScanner
%global enable_tests 1

Name:		nodejs-stringscanner
Version:	0.0.3
Release:	1%{?dist}
Summary:	StringScanner performs lexical scanning operations on a string

License:	MIT
URL:		https://github.com/michaelficarra/cjs-string-scanner.git
Source0:	https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz

# Remove ansi codes from the test file, as coffeescript no longer supports them
Patch0:		nodejs-stringscanner_remove-ansi-from-tests.patch


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

BuildRequires:	nodejs-packaging
BuildRequires:	coffee-script

%if 0%{?enable_tests}
#
%endif

%description
StringScanner performs lexical scanning operations on a string.


%prep
%autosetup -n package -p1


%build
rm lib/*
%{_bindir}/coffee -bc -o lib/ src/*.coffee

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
cp -pr package.json lib/ \
	%{buildroot}%{nodejs_sitelib}/%{packagename}

%nodejs_symlink_deps

%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
%{_bindir}/coffee -bc -o test test/test.coffee
%{__nodejs} test/test.js
%else
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
%endif

%files
%{!?_licensedir:%global license %doc}
%doc *.md
%license LICENSE
%{nodejs_sitelib}/%{packagename}

%changelog
* Sat Jul  9 2016 Jared Smith <jsmith@fedoraproject.org> - 0.0.3-1
- Initial packaging