## 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 # Prepare the single, combined node_modules directory cp %{SOURCE3} . tar xfz %{SOURCE1} mkdir -p node_modules pushd node_modules ln -s ../node_modules_prod/* . if [ -d "../node_modules_prod/.bin" ]; then ln -s ../node_modules_prod/.bin . fi popd %build # nothing to build %install # 1. Install the main cssnano package mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pr package.json src %{buildroot}%{nodejs_sitelib}/%{npm_name} # 2. Install the preset INTO the main package's node_modules directory mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}/node_modules/cssnano-preset-advanced # The preset source files are in the 'package-a4' directory created by %autosetup pushd %{buildroot}%{nodejs_sitelib}/%{npm_name}/node_modules/cssnano-preset-advanced cp -pr %{_builddir}/package-a4/package.json . cp -pr %{_builddir}/package-a4/src . # Also copy its license to be referenced by the subpackage's %files section cp -pr %{_builddir}/package-a4/LICENSE-MIT . popd # 3. Copy over the combined bundled nodejs modules cp -pr node_modules_prod/* %{buildroot}%{nodejs_sitelib}/%{npm_name}/node_modules/ %check %nodejs_symlink_deps --check # Change to the installed directory to run tests pushd %{buildroot}%{nodejs_sitelib}/%{npm_name} # Test that the main module can be required %{__nodejs} -e 'require("./")' # Test that the preset module can be required from the main package's context %{__nodejs} -e 'require("cssnano-preset-advanced")' popd %files %license LICENSE-MIT %{npm_name}-%{version}-bundled-licenses.txt %doc README.md # The main package owns its directory... %{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 %{nodejs_sitelib}/%{npm_name}/node_modules/cssnano-preset-advanced/LICENSE-MIT # The subpackage can have its own README if needed, pointing to the source %doc %{_builddir}/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