Files
nodejs-cheerio/nodejs-cheerio.spec

82 lines
2.7 KiB
RPMSpec

#
# spec file for package nodejs-cheerio
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define base_name cheerio
Name: nodejs-cheerio
Version: 0.19.0
Release: 0
Summary: Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
License: MIT
Group: Development/Languages/Other
Url: https://github.com/cheeriojs/cheerio
Source: http://registry.npmjs.org/%{base_name}/-/%{base_name}-%{version}.tgz
BuildRequires: nodejs-packaging
BuildRequires: nodejs-css-select
Requires: nodejs-css-select
BuildRequires: nodejs-dom-serializer
Requires: nodejs-dom-serializer
BuildRequires: nodejs-entities
Requires: nodejs-entities
BuildRequires: nodejs-htmlparser2
Requires: nodejs-htmlparser2
BuildRequires: nodejs-lodash
Requires: nodejs-lodash
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%nodejs_find_provides_and_requires
%description
Features
* Familiar syntax: Cheerio implements a subset of core jQuery. Cheerio removes
all the DOM inconsistencies and browser cruft from the jQuery library,
revealing its truly gorgeous API.
* Blazingly fast: Cheerio works with a very simple, consistent DOM model. As a
result parsing, manipulating, and rendering are incredibly efficient.
Preliminary end-to-end benchmarks suggest that cheerio is about 8x faster
than JSDOM.
* Incredibly flexible: Cheerio wraps around @FB55's forgiving htmlparser2.
Cheerio can parse nearly any HTML or XML document.
%prep
%setup -q -n package
%build
%install
mkdir -p %{buildroot}%{nodejs_modulesdir}/%{base_name}
cp -pr package.json *.js \
lib \
%{buildroot}%{nodejs_modulesdir}/%{base_name}/
mkdir -p %{buildroot}%{nodejs_modulesdir}/%{base_name}/node_modules
for module in css-select dom-serializer entities htmlparser2 lodash; do
ln -s %{nodejs_modulesdir}/$module %{buildroot}%{nodejs_modulesdir}/%{base_name}/node_modules/
done
%files
%defattr(-,root,root,-)
%doc *.md test
%{nodejs_modulesdir}/%{base_name}
%changelog