Files
perl-HTML-Template-JIT/perl-HTML-Template-JIT.spec
2025-08-12 18:14:37 +02:00

99 lines
4.1 KiB
RPMSpec

#
# spec file for package perl-HTML-Template-JIT
#
# 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 HTML-Template-JIT
Name: perl-HTML-Template-JIT
Version: 0.50.0
Release: 0
# 0.05 -> normalize -> 0.50.0
%define cpan_version 0.05
#Upstream: HTML::Template::JIT : Just-in-time compiler for HTML::Template This module is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" which comes with this module. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this module, in the file ARTISTIC. If not, I'll be glad to provide one. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Just-in-time compiler for HTML::Template
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/S/SA/SAMTREGAR/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(HTML::Template) >= 2.8
BuildRequires: perl(Inline) >= 0.43
BuildRequires: perl(Inline::C)
Requires: perl(HTML::Template) >= 2.8
Requires: perl(Inline) >= 0.43
Requires: perl(Inline::C)
Provides: perl(HTML::Template::JIT) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
This module provides a just-in-time compiler for HTML::Template. The module
works in two phases:
* Load
When new() is called the module checks to see if it already has an
up-to-date version of your template compiled. If it does it loads the
compiled version and returns you a handle to call param() and output().
* Compile
If your template needs to be compiled - either because it has changed or
because it has never been compiled - then HTML::Template::JIT loads
HTML::Template::JIT::Compiler which uses HTML::Template and Inline::C to
compile your template to native machine instructions.
The compiled form is saved to disk in the jit_path directory and control
returns to the Load phase.
This may sound a lot like the way HTML::Template's cache mode works but
there are some significant differences:
* The compilation phase takes a long time. Depending on your system it might
take several seconds to compile a large template.
* The resulting compiled template is much faster than a normal cached
template. My benchmarks show HTML::Template::JIT, with a precompiled
template, performing 4 to 8 times faster than HTML::Template in cache mode.
* The resulting compiled template should use less memory than a normal cached
template. Also, if all your templates are already compiled then you don't
even have to load HTML::Template to use the templates!
%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 ANNOUNCE Changes README
%license ARTISTIC GPL
%changelog