From b61aa342742b846393289f2fbdd76fd448fcb743 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Feb 28 2022 22:19:37 +0000 Subject: Upgrade to 4.1.2 for support of recent Node.js versions Signed-off-by: Stephen Gallagher --- diff --git a/.gitignore b/.gitignore index 1e79884..ec07d1d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ /less-1.6.1.tgz /less-1.6.3.tgz /less-1.7.0.tgz +/less-4.1.2-nm-prod.tgz +/less-4.1.2.tgz diff --git a/0001-Require-include-files-from-the-default-location.patch b/0001-Require-include-files-from-the-default-location.patch deleted file mode 100644 index 6f1ec0b..0000000 --- a/0001-Require-include-files-from-the-default-location.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 18e3f3f3a1955e0159b4e8c6141518a6a3cd0975 Mon Sep 17 00:00:00 2001 -From: Stephen Gallagher -Date: Wed, 19 Dec 2012 09:06:24 -0500 -Subject: [PATCH] Require include files from the default location - ---- - bin/lessc | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/bin/lessc b/bin/lessc -index e5ee1a1c7431e683ef884affcbea46721237f914..658dbf14e2c0dab9067487d6528066fda5414d09 100755 ---- a/bin/lessc -+++ b/bin/lessc -@@ -6,7 +6,7 @@ var path = require('path'), - os = require('os'), - mkdirp; - --var less = require('../lib/less'); -+var less = require('less'); - var args = process.argv.slice(1); - var options = { - depends: false, -@@ -96,7 +96,7 @@ args = args.filter(function (arg) { - break; - case 'h': - case 'help': -- require('../lib/less/lessc_helper').printUsage(); -+ require('less/lessc_helper').printUsage(); - continueProcessing = false; - case 'x': - case 'compress': -@@ -243,7 +243,7 @@ args = args.filter(function (arg) { - } - break; - default: -- require('../lib/less/lessc_helper').printUsage(); -+ require('less/lessc_helper').printUsage(); - continueProcessing = false; - currentErrorcode = 1; - break; -@@ -288,7 +288,7 @@ if (options.cleancss && options.sourceMap) { - if (! input) { - console.log("lessc: no input files"); - console.log(""); -- require('../lib/less/lessc_helper').printUsage(); -+ require('less/lessc_helper').printUsage(); - currentErrorcode = 1; - return; - } --- -1.8.4.2 - diff --git a/nodejs-less.spec b/nodejs-less.spec index c5e83b6..061f3e2 100644 --- a/nodejs-less.spec +++ b/nodejs-less.spec @@ -1,8 +1,10 @@ %{?nodejs_find_provides_and_requires} -Name: nodejs-less -Version: 1.7.0 -Release: 2%{?dist} +%global npm_name less + +Name: nodejs-%{npm_name} +Version: 4.1.2 +Release: 1%{?dist} Summary: Less.js The dynamic stylesheet language # cssmin.js is licensed under BSD license @@ -11,63 +13,77 @@ License: ASL 2.0 and BSD URL: http://lesscss.org Source0: http://registry.npmjs.org/less/-/less-%{version}.tgz - -# Since we're installing this in a global location, fix the require() -# calls to point there. -Patch0001: 0001-Require-include-files-from-the-default-location.patch +Source1: %{npm_name}-%{version}-nm-prod.tgz BuildArch: noarch BuildRequires: nodejs-devel BuildRequires: nodejs-packaging -BuildRequires: nodejs-grunt-cli Requires: nodejs ExclusiveArch: %{nodejs_arches} noarch 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 -%setup -q -n package -%patch0001 -p1 +%prep +%autosetup -n package -p1 # Remove pre-built files from the dist/ directory rm -f dist/*.js -# enable compression using ycssmin -%nodejs_fixdep ycssmin '~1.0.1' +tar xfz %{SOURCE1} +mkdir -p node_modules +pushd node_modules +ln -s ../node_modules_prod/* . +ln -s ../node_modules_prod/.bin . +popd + %build # Nothing to be built, we're just carrying around flat files + %check -make %{?_smp_mflags} test +%{__nodejs} -e 'require("./")' %install -mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{nodejs_sitelib}/less -chmod a+x bin/lessc -cp -rp bin package.json lib/less/* %{buildroot}/%{nodejs_sitelib}/less + +cp -rp index.js \ + package.json \ + lib/ \ + %{buildroot}/%{nodejs_sitelib}/less + +# Copy over bundled nodejs modules +cp -pr node_modules node_modules_prod \ + %{buildroot}%{nodejs_sitelib}/%{npm_name} + +mkdir -p %{buildroot}%{nodejs_sitelib}/less/bin +install -p -D -m0755 bin/lessc %{buildroot}%{nodejs_sitelib}/less/bin/lessc # Install /usr/bin/lessc -ln -s %{nodejs_sitelib}/less/bin/lessc \ - %{buildroot}%{_bindir} +mkdir -p %{buildroot}%{_bindir} +ln -srf %{nodejs_sitelib}/less/bin/lessc \ + %{buildroot}%{_bindir} -%nodejs_symlink_deps %files -%doc LICENSE README.md CHANGELOG.md CONTRIBUTING.md +%doc README.md %{_bindir}/lessc %{nodejs_sitelib}/less %changelog +* Mon Feb 28 2022 Stephen Gallagher - 4.1.2-1 +- Upgrade to 4.1.2 for support of recent Node.js versions + * Sat Jun 07 2014 Fedora Release Engineering - 1.7.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild diff --git a/sources b/sources index a3d20f8..27a0ad6 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -ff35fa927dbaf5daa956a1074ad9773a less-1.7.0.tgz +SHA512 (less-4.1.2-nm-prod.tgz) = 29cad8046813dc61aeb6fb53520977cca6e3d91234a23e85375d6e483dde75aaddac5b33a9f2ebca1e331c89e3b92f29de9d19000cf6bab82834ffecf6461b49 +SHA512 (less-4.1.2.tgz) = 128429fc4b7b392395bb468992724eb655d9b27afc5c4f0ac2ecd31ce2de552131f2955650809cf10d156111e0cf28d7efc9cc1320bfa33b5615b83286d35f0c