%{?nodejs_find_provides_and_requires} %global packagename flat-cache # Tests disabled because they depend on npm(glob-expand), which # isn't yet in Fedora, see https://bugzilla.redhat.com/show_bug.cgi?id=1493354 %global enable_tests 0 Name: nodejs-flat-cache Version: 1.2.2 Release: 1%{?dist} Summary: A stupidly simple key/value storage using files to persist some data License: MIT URL: https://github.com/royriojas/flat-cache Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # The test files are not included in the npm tarball. # Source{1-9} are generated by running Source10, which pulls from the upstream # version control repository. Source1: tests-%{version}.tar.bz2 Source10: dl-tests.sh BuildArch: noarch %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildRequires: nodejs-packaging BuildRequires: npm(circular-json) BuildRequires: npm(del) BuildRequires: npm(read-json-sync) BuildRequires: npm(write) %if 0%{?enable_tests} BuildRequires: mocha BuildRequires: npm(glob-expand) %endif %description A stupidly simple key/value storage using files to persist some data %prep %autosetup -n package # setup the tests %autosetup -T -D -a 1 -n package %nodejs_fixdep write %build # nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} NODE_ENV=test %{_bindir}/mocha -R spec test/specs %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc *.md %license LICENSE %{nodejs_sitelib}/%{packagename} %changelog * Tue Sep 19 2017 Jared Smith - 1.2.2-1 - Update to upstream 1.2.2 release * Fri Jul 29 2016 Jared Smith - 1.0.10-1 - Initial packaging