commit
5391d85a3c
BIN
less-3.10.3.tgz
Normal file
BIN
less-3.10.3.tgz
Normal file
Binary file not shown.
70
nodejs-less-mime2.patch
Normal file
70
nodejs-less-mime2.patch
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
commit 1cbb465aa92f7cb903f7900e0e43cc08294fc649
|
||||||
|
Author: Tom Hughes <tom@compton.nu>
|
||||||
|
Date: Thu Sep 20 18:55:15 2018 +0100
|
||||||
|
|
||||||
|
Update for npm(mime) version 2.x
|
||||||
|
|
||||||
|
diff --git a/bin/lessc b/bin/lessc
|
||||||
|
index 0ffe6dbc..11c11d45 100644
|
||||||
|
--- a/bin/lessc
|
||||||
|
+++ b/bin/lessc
|
||||||
|
@@ -180,10 +180,10 @@ var environment = {
|
||||||
|
return buffer.toString('base64');
|
||||||
|
},
|
||||||
|
mimeLookup: function mimeLookup(filename) {
|
||||||
|
- return require('mime').lookup(filename);
|
||||||
|
+ return require('mime').getType(filename);
|
||||||
|
},
|
||||||
|
charsetLookup: function charsetLookup(mime) {
|
||||||
|
- return require('mime').charsets.lookup(mime);
|
||||||
|
+ return (/^text\/|^application\/(javascript|json)/).test(mime) ? 'UTF-8' : null;
|
||||||
|
},
|
||||||
|
getSourceMapGenerator: function getSourceMapGenerator() {
|
||||||
|
return require('source-map').SourceMapGenerator;
|
||||||
|
diff --git a/dist/less.cjs.js b/dist/less.cjs.js
|
||||||
|
index 41b01742..cfc307e9 100644
|
||||||
|
--- a/dist/less.cjs.js
|
||||||
|
+++ b/dist/less.cjs.js
|
||||||
|
@@ -11,10 +11,10 @@ var environment = {
|
||||||
|
return buffer.toString('base64');
|
||||||
|
},
|
||||||
|
mimeLookup: function mimeLookup(filename) {
|
||||||
|
- return require('mime').lookup(filename);
|
||||||
|
+ return require('mime').getType(filename);
|
||||||
|
},
|
||||||
|
charsetLookup: function charsetLookup(mime) {
|
||||||
|
- return require('mime').charsets.lookup(mime);
|
||||||
|
+ return (/^text\/|^application\/(javascript|json)/).test(mime) ? 'UTF-8' : null;
|
||||||
|
},
|
||||||
|
getSourceMapGenerator: function getSourceMapGenerator() {
|
||||||
|
return require('source-map').SourceMapGenerator;
|
||||||
|
diff --git a/lib/less-node/environment.js b/lib/less-node/environment.js
|
||||||
|
index a9b790c9..a24cf481 100644
|
||||||
|
--- a/lib/less-node/environment.js
|
||||||
|
+++ b/lib/less-node/environment.js
|
||||||
|
@@ -5,10 +5,10 @@ export default {
|
||||||
|
return buffer.toString('base64');
|
||||||
|
},
|
||||||
|
mimeLookup: function (filename) {
|
||||||
|
- return require('mime').lookup(filename);
|
||||||
|
+ return require('mime').getType(filename);
|
||||||
|
},
|
||||||
|
charsetLookup: function (mime) {
|
||||||
|
- return require('mime').charsets.lookup(mime);
|
||||||
|
+ return (/^text\/|^application\/(javascript|json)/).test(mime) ? 'UTF-8' : null;
|
||||||
|
},
|
||||||
|
getSourceMapGenerator: function getSourceMapGenerator() {
|
||||||
|
return require('source-map').SourceMapGenerator;
|
||||||
|
diff --git a/package.json b/package.json
|
||||||
|
index b9887fcf..50599f21 100644
|
||||||
|
--- a/package.json
|
||||||
|
+++ b/package.json
|
||||||
|
@@ -42,7 +42,7 @@
|
||||||
|
"errno": "^0.1.1",
|
||||||
|
"graceful-fs": "^4.1.2",
|
||||||
|
"image-size": "~0.5.0",
|
||||||
|
- "mime": "^1.4.1",
|
||||||
|
+ "mime": "^2.0.0",
|
||||||
|
"mkdirp": "^0.5.0",
|
||||||
|
"promise": "^7.1.1",
|
||||||
|
"request": "^2.83.0",
|
||||||
58
nodejs-less.spec
Normal file
58
nodejs-less.spec
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
%{?nodejs_find_provides_and_requires}
|
||||||
|
Name: nodejs-less
|
||||||
|
Version: 3.10.3
|
||||||
|
Release: 1
|
||||||
|
Summary: Less.js The dynamic stylesheet language
|
||||||
|
License: ASL 2.0 and BSD
|
||||||
|
URL: http://lesscss.org
|
||||||
|
Source0: http://registry.npmjs.org/less/-/less-%{version}.tgz
|
||||||
|
Patch0: nodejs-less-mime2.patch
|
||||||
|
BuildArch: noarch
|
||||||
|
ExclusiveArch: %{nodejs_arches} noarch aarch64 x86_64
|
||||||
|
BuildRequires: nodejs-packaging
|
||||||
|
BuildRequires: npm(clone) npm(image-size) npm(less-plugin-clean-css) npm(mime) npm(source-map)
|
||||||
|
Provides: lessjs = %{version}-%{release}
|
||||||
|
Obsoletes: lessjs < 1.3.3-2
|
||||||
|
%description
|
||||||
|
LESS extends CSS with dynamic behavior such as variables, mixins, operations
|
||||||
|
and functions. LESS runs on both the client-side (Chrome, Safari, Firefox)
|
||||||
|
and server-side, with Node.js and Rhino.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -p 1 -n package
|
||||||
|
%nodejs_fixdep clone "^1.0.2"
|
||||||
|
%nodejs_fixdep --optional --remove errno
|
||||||
|
%nodejs_fixdep --optional --remove mkdirp
|
||||||
|
%nodejs_fixdep --optional image-size "^0.6.3"
|
||||||
|
%nodejs_fixdep --optional promise "^8.0.1"
|
||||||
|
%nodejs_fixdep --optional request "^2.67.0"
|
||||||
|
%nodejs_fixdep --optional source-map "^0.5.6"
|
||||||
|
rm -rf node_modules
|
||||||
|
|
||||||
|
%build
|
||||||
|
|
||||||
|
%check
|
||||||
|
%nodejs_symlink_deps --check --optional
|
||||||
|
rm test/less/import-module.less
|
||||||
|
rm test/css/3rd-party/*.css
|
||||||
|
rm test/less/3rd-party/*.less
|
||||||
|
%{__nodejs} test
|
||||||
|
|
||||||
|
%install
|
||||||
|
mkdir -p %{buildroot}%{nodejs_sitelib}/less
|
||||||
|
cp -pr package.json index.js dist lib %{buildroot}/%{nodejs_sitelib}/less
|
||||||
|
mkdir -p %{buildroot}%{nodejs_sitelib}/less/bin
|
||||||
|
install -m755 -p bin/lessc %{buildroot}%{nodejs_sitelib}/less/bin
|
||||||
|
mkdir -p %{buildroot}%{_bindir}
|
||||||
|
ln -s %{nodejs_sitelib}/less/bin/lessc %{buildroot}%{_bindir}
|
||||||
|
%nodejs_symlink_deps
|
||||||
|
|
||||||
|
%files
|
||||||
|
%doc README.md CHANGELOG.md CONTRIBUTING.md
|
||||||
|
%license LICENSE
|
||||||
|
%{_bindir}/lessc
|
||||||
|
%{nodejs_sitelib}/less
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Wed Aug 19 2020 zhanghua <zhanghua40@huawei.com> - 3.10.3-1
|
||||||
|
- Package init
|
||||||
4
nodejs-less.yaml
Normal file
4
nodejs-less.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: github
|
||||||
|
src_repo: less/less.js
|
||||||
|
tag_pattern: "^v"
|
||||||
|
seperator: "."
|
||||||
Loading…
x
Reference in New Issue
Block a user