Files
perl-JavaScript-Minifier/perl-JavaScript-Minifier.spec
2025-08-12 18:14:54 +02:00

78 lines
2.6 KiB
RPMSpec

#
# spec file for package perl-JavaScript-Minifier
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define cpan_name JavaScript-Minifier
Name: perl-JavaScript-Minifier
Version: 1.160.0
Release: 0
# 1.16 -> normalize -> 1.160.0
%define cpan_version 1.16
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Perl extension for minifying JavaScript code
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/Z/ZO/ZOFFIX/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
Provides: perl(JavaScript::Minifier) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
This module removes unnecessary whitespace from JavaScript code. The
primary requirement developing this module is to not break working code: if
working JavaScript is in input then working JavaScript is output. It is ok
if the input has missing semi-colons, snips like '++ +' or '12
.toString()', for example. Internet Explorer conditional comments are
copied to the output but the code inside these comments will not be
minified.
The ECMAScript specifications allow for many different whitespace
characters: space, horizontal tab, vertical tab, new line, carriage return,
form feed, and paragraph separator. This module understands all of these as
whitespace except for vertical tab and paragraph separator. These two types
of whitespace are not minimized.
For static JavaScript files, it is recommended that you minify during the
build stage of web deployment. If you minify on-the-fly then it might be a
good idea to cache the minified file. Minifying static files on-the-fly
repeatedly is wasteful.
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes examples README README.md
%license LICENSE
%changelog