Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 1

Name:       nodejs-transformers
Version:    3.0.0
Release:    2%{?dist}
Summary:    String/Data transformations for Node.js
License:    MIT
Group:      System Environment/Libraries
URL:        https://github.com/ForbesLindesay/transformers
Source0:    http://registry.npmjs.org/transformers/-/transformers-%{version}.tgz
# The test files are not included in the npm tarball.
# Source1 is generated by running Source10, which pulls from the upstream
# version control repository.
Source1:    tests-%{version}.tar.bz2
Source10:   dl-tests.sh

# https://github.com/ForbesLindesay/transformers/pull/31
Patch0:     %{name}-3.0.0-Add-trailing-semicolons-to-uglify-css-test-files.patch

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

BuildRequires:  nodejs-packaging

%if 0%{?enable_tests}
BuildRequires:  mocha
BuildRequires:  npm(css)
BuildRequires:  npm(expect.js)
BuildRequires:  npm(promise)
BuildRequires:  uglify-js
# A lot (>30) of missing devDependencies not listed here.
%endif

%description
String/Data transformations for use in templating libraries, static site
generators and web frameworks. This gathers the most useful transformations
you can apply to text or data into one library with a consistent API.
Transformations can be pretty much anything but most are either compilers
or templating engines.


%prep
%setup -q -n package
%setup -q -T -D -a 1 -n package
# Fix wrong-file-end-of-line-encoding
for i in history.md LICENSE README.md; do
    sed -i -e 's/\r$//' "${i}"
done
%patch0 -p1

%nodejs_fixdep css '~1.6'
%nodejs_fixdep promise '4.x'


%build
#nothing to do


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

%nodejs_symlink_deps


%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
/usr/bin/mocha
%endif


%files
%doc history.md LICENSE README.md
%{nodejs_sitelib}/transformers


%changelog
* Mon Mar 03 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.0.0-2
- add patch for failing tests

* Sun Mar 02 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 3.0.0-1
- initial package