# # spec file for package perl-Template-Alloy # # 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 Template-Alloy Name: perl-Template-Alloy Version: 1.22.0 Release: 0 # 1.022 -> normalize -> 1.22.0 %define cpan_version 1.022 License: Artistic-1.0 OR GPL-1.0-or-later Summary: TT2/3, HT, HTE, Tmpl, and Velocity Engine URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/R/RH/RHANDOM/%{cpan_name}-%{cpan_version}.tar.gz Source1: cpanspec.yml Source100: README.md BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros Provides: perl(Template::Alloy) = %{version} Provides: perl(Template::Alloy::Compile) Provides: perl(Template::Alloy::Context) Provides: perl(Template::Alloy::EvalPerlHandle) Provides: perl(Template::Alloy::Exception) Provides: perl(Template::Alloy::HTE) Provides: perl(Template::Alloy::Iterator) Provides: perl(Template::Alloy::Operator) Provides: perl(Template::Alloy::Parse) Provides: perl(Template::Alloy::Perl) Provides: perl(Template::Alloy::Play) Provides: perl(Template::Alloy::Stream) Provides: perl(Template::Alloy::TT) Provides: perl(Template::Alloy::Tmpl) Provides: perl(Template::Alloy::VMethod) Provides: perl(Template::Alloy::Velocity) Provides: perl(Template::Alloy::_ContextStash) %undefine __perllib_provides %{perl_requires} %description "An alloy is a homogeneous mixture of two or more elements" (http://en.wikipedia.org/wiki/Alloy). Template::Alloy represents the mixing of features and capabilities from all of the major mini-language based template systems (support for non-mini-language based systems will happen eventually). With Template::Alloy you can use your favorite template interface and syntax and get features from each of the other major template systems. And Template::Alloy is fast - whether your using mod_perl, CGI, or running from the commandline. There is even Template::Alloy::JS for getting a little more speed when that is necessary. Template::Alloy happened by accident (accidentally on purpose). The Template::Alloy (Alloy hereafter) was originally a part of the CGI::Ex suite that performed simple variable interpolation. It used TT2 style variables in TT2 style tags "[% foo.bar %]". That was all the original Template::Alloy did. This was fine and dandy for a couple of years. In winter of 2005-2006 Alloy was revamped to add a few features. One thing led to another and soon Alloy provided for most of the features of TT2 as well as some from TT3. Template::Alloy now provides a full-featured implementation of the Template::Toolkit language. After a move to a new company that was using HTML::Template::Expr and Text::Tmpl templates, support was investigated and interfaces for HTML::Template, HTML::Template::Expr, Text::Tmpl, and Velocity (VTL) were added. All of the various engines offer the same features - each using a different syntax and interface. More recently, the Template::Alloy::JS capabilities were introduced to bring Javascript templates to the server side (along with an increase in speed if ran in persistent environments). Template::Toolkit brought the most to the table. HTML::Template brought the LOOP directive. HTML::Template::Expr brought more vmethods and using vmethods as top level functions. Text::Tmpl brought the COMMENT directive and encouraged speed matching (Text::Tmpl is almost entirely C based and is very fast). The Velocity engine brought AUTO_EVAL and SHOW_UNDEFINED_INTERP. Most of the standard Template::Toolkit documentation covering directives, variables, configuration, plugins, filters, syntax, and vmethods should apply to Alloy just fine (This pod tries to explain everything - but there is too much). See Template::Alloy::TT for a listing of the differences between Alloy and TT. Most of the standard HTML::Template and HTML::Template::Expr documentation covering methods, variables, expressions, and syntax will apply to Alloy just fine as well. Most of the standard Text::Tmpl documentation applies, as does the documentation covering Velocity (VTL). So should you use Template::Alloy ? Well, try it out. It may give you no visible improvement. Or it could. %prep %autosetup -n %{cpan_name}-%{cpan_version} find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644 %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 README samples %changelog