| |
@@ -1,8 +1,10 @@
|
| |
+ %{bcond_without tests}
|
| |
+
|
| |
%{?nodejs_find_provides_and_requires}
|
| |
|
| |
Name: nodejs-less
|
| |
- Version: 3.10.3
|
| |
- Release: 3%{?dist}
|
| |
+ Version: 3.11.1
|
| |
+ Release: 1%{?dist}
|
| |
Summary: Less.js The dynamic stylesheet language
|
| |
|
| |
# cssmin.js is licensed under BSD license
|
| |
@@ -10,17 +12,24 @@
|
| |
License: ASL 2.0 and BSD
|
| |
URL: http://lesscss.org
|
| |
Source0: http://registry.npmjs.org/less/-/less-%{version}.tgz
|
| |
- Patch0: nodejs-less-mime2.patch
|
| |
+ # Generated with ./update_sources.sh (SOURCE100)
|
| |
+ Source1: less_%{version}_node_modules_test.tar.gz
|
| |
+ %global BUILD_NPMS %{SOURCE1}
|
| |
+
|
| |
+ Source2: less_%{version}_node_modules_prod.tar.gz
|
| |
+ %global PROD_NPMS %{SOURCE2}
|
| |
+
|
| |
+
|
| |
+ # Script to download the latest release and cache the NPMs for prod and test
|
| |
+ # node_modules
|
| |
+ Source100: update-sources.sh
|
| |
+
|
| |
BuildArch: noarch
|
| |
ExclusiveArch: %{nodejs_arches} noarch
|
| |
|
| |
BuildRequires: nodejs-packaging
|
| |
|
| |
BuildRequires: npm(clone)
|
| |
- BuildRequires: npm(image-size)
|
| |
- BuildRequires: npm(less-plugin-clean-css)
|
| |
- BuildRequires: npm(mime)
|
| |
- BuildRequires: npm(source-map)
|
| |
|
| |
Provides: lessjs = %{version}-%{release}
|
| |
Obsoletes: lessjs < 1.3.3-2
|
| |
@@ -34,14 +43,10 @@
|
| |
|
| |
%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
|
| |
+ %nodejs_fixdep --remove clone
|
| |
+ %nodejs_fixdep --remove tslib
|
| |
+
|
| |
+ rm -rf node_modules && tar xvf %{BUILD_NPMS}
|
| |
|
| |
|
| |
%build
|
| |
@@ -49,20 +54,29 @@
|
| |
|
| |
|
| |
%check
|
| |
- %nodejs_symlink_deps --check --optional
|
| |
+ %if %{with tests}
|
| |
rm test/less/import-module.less
|
| |
rm test/css/3rd-party/*.css
|
| |
rm test/less/3rd-party/*.less
|
| |
%{__nodejs} test
|
| |
+ %endif
|
| |
|
| |
|
| |
%install
|
| |
mkdir -p %{buildroot}%{nodejs_sitelib}/less
|
| |
cp -pr package.json index.js dist lib %{buildroot}/%{nodejs_sitelib}/less
|
| |
+ tar -C %{buildroot}%{nodejs_sitelib}/less -xf %{PROD_NPMS}
|
| |
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}
|
| |
+
|
| |
+ # Do not install any test files to avoid unnecessary automatic dependencies
|
| |
+ find %{buildroot}/%{nodejs_sitelib}/less -ignore_readdir_race -path "*/test*" -delete
|
| |
+
|
| |
+ # Drop executable permissions on bundled packages
|
| |
+ find %{buildroot}/%{nodejs_sitelib}/less/node_modules/ -executable \! -type d -exec chmod -x {} \;
|
| |
+
|
| |
%nodejs_symlink_deps
|
| |
|
| |
|
| |
@@ -73,7 +87,22 @@
|
| |
%{nodejs_sitelib}/less
|
| |
|
| |
|
| |
+ %pretrans -p <lua>
|
| |
+ -- Replace the symlink for nodejs-clone with the bundled copy
|
| |
+ -- Drop this scriptlet when Fedora 32 is EOL
|
| |
+ path = "%{nodejs_sitelib}/less/node_modules/clone"
|
| |
+ st = posix.stat(path)
|
| |
+ if st and st.type == "link" then
|
| |
+ os.remove(path)
|
| |
+ end
|
| |
+
|
| |
+
|
| |
%changelog
|
| |
+ * Tue Apr 28 2020 Stephen Gallagher <sgallagh@redhat.com> - 3.11.1-1
|
| |
+ - Update to 3.11.1
|
| |
+ - Bundle most dependencies except npm(clone)
|
| |
+ - Conditionalize running tests on build
|
| |
+
|
| |
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.3-3
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
| |
|
| |
Bundle most dependencies except npm(clone)
Include the clean-css and autoprefix plugins
Resolves: rhbz#1828899
Signed-off-by: Stephen Gallagher sgallagh@redhat.com