2020-08-28 18:14:00 +08:00
|
|
|
%global enable_tests 1
|
|
|
|
|
%global packagename dateformat
|
|
|
|
|
Name: nodejs-dateformat
|
2020-09-08 16:00:14 +08:00
|
|
|
Version: 3.0.0
|
2020-08-28 18:14:00 +08:00
|
|
|
Release: 1
|
|
|
|
|
Summary: Steven Levithan's excellent dateFormat() function for Node.js
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://github.com/felixge/node-dateformat
|
2020-09-08 16:00:14 +08:00
|
|
|
Source0: https://github.com/felixge/node-dateformat/archive/%{version}.tar.gz
|
2020-08-28 18:14:00 +08:00
|
|
|
BuildArch: noarch
|
|
|
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
|
|
|
|
BuildRequires: nodejs-packaging
|
|
|
|
|
%if 0%{?enable_tests}
|
|
|
|
|
BuildRequires: npm(mocha) npm(underscore)
|
|
|
|
|
%endif
|
|
|
|
|
%description
|
|
|
|
|
This is a JavaScript port of Steven Levithan's excellent dateFormat()
|
|
|
|
|
function, which provides a simple way to format dates and times
|
|
|
|
|
according to a user-specified mask.
|
|
|
|
|
|
|
|
|
|
%prep
|
2020-09-08 16:00:14 +08:00
|
|
|
%autosetup -n node-dateformat-%{version}
|
|
|
|
|
rm test/test_formats.js
|
2020-08-28 18:14:00 +08:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/dateformat
|
|
|
|
|
cp -pr package.json lib/ \
|
|
|
|
|
%{buildroot}%{nodejs_sitelib}/dateformat
|
|
|
|
|
%nodejs_symlink_deps
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
%nodejs_symlink_deps --check
|
|
|
|
|
%{__nodejs} -e 'require("./")'
|
|
|
|
|
%if 0%{?enable_tests}
|
|
|
|
|
TZ=UTC %{_bindir}/mocha -R spec
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%doc Readme.md
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%{nodejs_sitelib}/dateformat
|
|
|
|
|
|
|
|
|
|
%changelog
|
2020-09-08 16:00:14 +08:00
|
|
|
* Mon Aug 17 2020 Anan Fu <fuanan3@huawei.com> - 3.0.0-1
|
2020-08-28 18:14:00 +08:00
|
|
|
- package init
|