Blob Blame History Raw
%global enable_tests 1

Name:           nodejs-chrono
Version:        1.0.4
Release:        1%{?dist}
Summary:        Format dates in JavaScript

License:        MIT
URL:            https://github.com/kkaefer/chrono.js
Source0:        http://registry.npmjs.org/chrono/-/chrono-%{version}.tgz
BuildArch:      noarch

BuildRequires:  nodejs-devel

%if 0%{?enable_tests}
BuildRequires:  npm(expresso)
%endif

%description
Allows formatting of time in a `strftime` style, but with syntax taken
from PHP's date function. It implements pretty much all of the tokens
from PHP's date function, except for B (Swatch internet time) and
e (Content/City timezone identifier). You can escape characters with
a `\` (remember to encode the `\` in a string as well). All other
characters will be printed as they appear in the format string.


%prep
%setup -q -n package
rm -rf node_modules


%build


%if 0%{?enable_tests}
%check
%{nodejs_sitelib}/expresso/bin/expresso
%endif


%install
mkdir -p %{buildroot}/%{nodejs_sitelib}/chrono
cp -pr package.json index.js lib %{buildroot}/%{nodejs_sitelib}/chrono
%nodejs_symlink_deps


%files
%doc LICENSE README.markdown
%{nodejs_sitelib}/chrono


%changelog
* Sun Feb 10 2013 Tom Hughes <tom@compton.nu> - 1.0.4-1
- Initial build of 1.0.4