2011-05-01 10:34:43 +00:00
|
|
|
#
|
2015-04-13 16:24:14 +00:00
|
|
|
# spec file for package perl-HTML-Template-Compiled
|
2011-05-01 10:34:43 +00:00
|
|
|
#
|
2016-05-20 05:16:43 +00:00
|
|
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
2011-05-01 10:34:43 +00:00
|
|
|
#
|
|
|
|
# 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 http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2015-04-13 16:24:14 +00:00
|
|
|
|
2011-05-01 10:34:43 +00:00
|
|
|
Name: perl-HTML-Template-Compiled
|
2016-05-20 05:16:43 +00:00
|
|
|
Version: 1.003
|
2015-04-13 16:24:14 +00:00
|
|
|
Release: 0
|
2011-05-01 10:34:43 +00:00
|
|
|
%define cpan_name HTML-Template-Compiled
|
|
|
|
Summary: Template System Compiles HTML::Template files to Perl code
|
2015-04-13 16:24:14 +00:00
|
|
|
License: Artistic-1.0 or GPL-1.0+
|
2011-05-01 10:34:43 +00:00
|
|
|
Group: Development/Libraries/Perl
|
2015-04-13 16:24:14 +00:00
|
|
|
Url: http://search.cpan.org/dist/HTML-Template-Compiled/
|
2015-08-29 18:28:24 +00:00
|
|
|
Source0: http://www.cpan.org/authors/id/T/TI/TINITA/%{cpan_name}-%{version}.tar.gz
|
|
|
|
Source1: cpanspec.yml
|
2011-05-01 10:34:43 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
2015-08-29 18:28:24 +00:00
|
|
|
BuildRequires: perl(HTML::Entities)
|
|
|
|
BuildRequires: perl(Parse::RecDescent)
|
2015-04-13 16:24:14 +00:00
|
|
|
BuildRequires: perl(URI::Escape)
|
2015-08-29 18:28:24 +00:00
|
|
|
Requires: perl(HTML::Entities)
|
|
|
|
Requires: perl(Parse::RecDescent)
|
2015-04-13 16:24:14 +00:00
|
|
|
Requires: perl(URI::Escape)
|
2011-05-01 10:34:43 +00:00
|
|
|
%{perl_requires}
|
|
|
|
|
|
|
|
%description
|
2016-05-20 05:16:43 +00:00
|
|
|
HTML::Template::Compiled is a template system which can be used for
|
|
|
|
HTML::Template templates with almost the same API. It offers more flexible
|
|
|
|
template delimiters, additional tags and features, and by compiling the
|
|
|
|
template into perl code it can run significantly faster in persistent
|
|
|
|
environments such as FastCGI or mod_perl.
|
2015-04-13 16:24:14 +00:00
|
|
|
|
|
|
|
The goal is to offer more features for flexibility but keep the basic
|
|
|
|
syntax as easy as it is.
|
|
|
|
|
|
|
|
Features at a glance:
|
|
|
|
|
|
|
|
* Dot notation for objects, hashes and arrays
|
|
|
|
|
2016-05-20 05:16:43 +00:00
|
|
|
* Use expressions without any disadvantages like those in
|
|
|
|
HTML::Template::Expr
|
2015-04-13 16:24:14 +00:00
|
|
|
|
|
|
|
* Write escaping plugins and plugins for new tags
|
|
|
|
|
|
|
|
* Alternate delimiters, e.g. '[%if %]' and '<%if %>'
|
|
|
|
|
|
|
|
* Avoid 'global_vars' option by using the 'SET_VAR' tag to create aliases.
|
|
|
|
|
|
|
|
* Tags ELSIF, EACH, WHILE, COMMENT, WRAPPER, SWITCH/CASE, INCLUDE_VAR
|
|
|
|
|
|
|
|
* Chomp newlines/whitespace
|
|
|
|
|
2016-05-20 05:16:43 +00:00
|
|
|
For a quick reference, see HTML::Template::Compiled::Reference.
|
2011-05-01 10:34:43 +00:00
|
|
|
|
2016-05-20 05:16:43 +00:00
|
|
|
As the basic features work like in HTML::Template, please get familiar with
|
|
|
|
its documentation before.
|
2011-05-01 10:34:43 +00:00
|
|
|
|
2016-05-20 05:16:43 +00:00
|
|
|
HTML::Template::Compiled (HTC) does not implement all features of
|
|
|
|
HTML::Template (see "COMPATIBILITY"), and it has got some additional
|
|
|
|
features which are explained below: "ADDITIONAL FEATURES"
|
2015-04-13 16:24:14 +00:00
|
|
|
|
2016-05-20 05:16:43 +00:00
|
|
|
See "BENCHMARKS" for some examples on the performance. Since it depends
|
|
|
|
highly on the options used and on the template size there can be no general
|
|
|
|
statement on its performance.
|
2011-05-01 10:34:43 +00:00
|
|
|
|
2016-05-20 05:16:43 +00:00
|
|
|
You might want to use HTML::Template::Compiled::Lazy for CGI environments
|
|
|
|
as it doesn't parse the template before calling output. But note that
|
|
|
|
HTC::Lazy isn't much tested, and I don't use it myself, so there's a lack
|
|
|
|
of experience. If you use it and have problems, please report.
|
2011-05-01 10:34:43 +00:00
|
|
|
|
|
|
|
HTC will use a lot of memory because it keeps all template objects in
|
|
|
|
memory. If you are on mod_perl, and have a lot of templates, you should
|
|
|
|
preload them at server startup to be sure that it is in shared memory. At
|
|
|
|
the moment HTC is not fully tested for keeping all data in shared memory
|
|
|
|
(e.g. when a copy-on-write occurs), but it seems like it's behaving well.
|
2015-04-13 16:24:14 +00:00
|
|
|
For preloading you can use HTML::Template::Compiled->preload($cache_dir).
|
2011-05-01 10:34:43 +00:00
|
|
|
|
|
|
|
Generating code, writing it on disk and later eval() it can open security
|
|
|
|
holes, for example if you have more users on the same machine that can
|
|
|
|
access the same files (usually an http server running as 'www' or
|
2016-05-20 05:16:43 +00:00
|
|
|
'nobody'). See "SECURITY" for details what you can do to safe yourself.
|
2011-05-01 10:34:43 +00:00
|
|
|
|
|
|
|
NOTE: If you don't need any of the additional features listed below and if
|
|
|
|
you don't need the speed (in many cases it's probably not worth trading
|
|
|
|
speed for memory), then you might be better off with just using
|
|
|
|
HTML::Template.
|
|
|
|
|
|
|
|
NOTE2: If you have any questions, bug reports, send them to me and not to
|
|
|
|
Sam Tregar. This module is developed by me at the moment, independently
|
|
|
|
from HTML::Template, although I try to get most of the tests from it
|
2016-05-20 05:16:43 +00:00
|
|
|
passing for HTC. See "RESOURCES" for current information.
|
2011-05-01 10:34:43 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n %{cpan_name}-%{version}
|
|
|
|
|
|
|
|
%build
|
2015-08-29 18:28:24 +00:00
|
|
|
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%{__make} %{?_smp_mflags}
|
2011-05-01 10:34:43 +00:00
|
|
|
|
|
|
|
%check
|
2015-08-29 18:28:24 +00:00
|
|
|
%{__make} test
|
2011-05-01 10:34:43 +00:00
|
|
|
|
|
|
|
%install
|
2015-08-29 18:28:24 +00:00
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
2011-05-01 10:34:43 +00:00
|
|
|
%perl_gen_filelist
|
|
|
|
|
|
|
|
%files -f %{name}.files
|
|
|
|
%defattr(-,root,root,755)
|
2015-08-29 18:28:24 +00:00
|
|
|
%doc Changes examples LICENSE README
|
2011-05-01 10:34:43 +00:00
|
|
|
|
|
|
|
%changelog
|