## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global npm_name cssnano %global _description %{expand: Cssnano is a modern, modular compression tool written on top of the PostCSS ecosystem, which allows us to use a lot of powerful features in order to compact CSS appropriately. } Name: nodejs-%{npm_name} Version: 7.0.7 Release: %autorelease Summary: A modular minifier, built on top of the PostCSS ecosystem # This is the combined license list for the main package and its dependencies. License: MIT AND BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND CC-BY-4.0 AND ISC URL: https://github.com/cssnano/%{npm_name} Source0: https://registry.npmjs.org/%{npm_name}/-/%{npm_name}-%{version}.tgz # IMPORTANT: These sources are for the COMBINED dependencies of both packages. Source1: %{npm_name}-%{version}-nm-prod.tgz Source2: %{npm_name}-%{version}-nm-dev.tgz Source3: %{npm_name}-%{version}-bundled-licenses.txt # Source for the preset subpackage Source4: https://registry.npmjs.org/cssnano-preset-advanced/-/cssnano-preset-advanced-%{version}.tgz BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-devel BuildRequires: npm Requires: nodejs %description %{_description} # Definition of the subpackage for the 'advanced' preset %package -n nodejs-%{npm_name}-preset-advanced Summary: Advanced optimisations preset for cssnano # This license list should cover the preset and its specific dependencies License: MIT AND BSD-3-Clause AND CC-BY-4.0 AND ISC # This creates a strict dependency on the main package Requires: nodejs-%{npm_name} = %{version}-%{release} %description -n nodejs-%{npm_name}-preset-advanced This package provides the "advanced" preset for cssnano, which enables more aggressive, but potentially unsafe, CSS optimizations. %prep # Unpack main source (Source0) to 'package' and preset source (Source4) to 'package-a4' %autosetup -n package -a 4 # Unpack the single, combined dependency bundle. This creates 'node_modules_prod'. tar xfz %{SOURCE1} %build # nothing to build %install # 1. Install the main cssnano package from its unpacked source mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pr package/package.json package/src %{buildroot}%{nodejs_sitelib}/%{npm_name} # 2. Install the COMPLETE bundled dependencies (which includes the preset itself) in one go. # This is the simplest and most robust way. mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}/node_modules cp -pr node_modules_prod/* %{buildroot}%{nodejs_sitelib}/%{npm_name}/node_modules/ %check # Change directory into the main package's source for testing cd package # Create a local node_modules and link all bundled dependencies into it. # This creates a reliable test environment. mkdir -p node_modules ln -s ../node_modules_prod/* ./node_modules/ # Also link the preset's source code into node_modules so it's discoverable. ln -s ../package-a4 ./node_modules/cssnano-preset-advanced # Now, with a complete node_modules, we can run the tests %nodejs_symlink_deps --check # Test that the main module can be required (it will find its deps in ./node_modules) %{__nodejs} -e 'require("./")' # Test that the preset can be required %{__nodejs} -e 'require("cssnano-preset-advanced")' %files # The main package owns its directory... %license package/LICENSE-MIT %doc package/README.md %{nodejs_sitelib}/%{npm_name} # ...but it must NOT own the preset's directory inside node_modules. %exclude %{nodejs_sitelib}/%{npm_name}/node_modules/cssnano-preset-advanced %files -n nodejs-%{npm_name}-preset-advanced # The subpackage owns its own directory inside the main package's node_modules %license package-a4/LICENSE-MIT %doc package-a4/README.md %{nodejs_sitelib}/%{npm_name}/node_modules/cssnano-preset-advanced %changelog ## START: Generated by rpmautospec * Tue Aug 05 2025 Jiri Kyjovsky - 7.0.7-3 - Uncommitted changes * Thu Jul 24 2025 Fedora Release Engineering - 7.0.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild * Tue Jul 15 2025 Jiri Kyjovsky - 7.0.7-1 - Initial package ## END: Generated by rpmautospec