2014-02-20 09:47:03 +00:00
#
# spec file for package perl-HTML-Template-Expr
#
2024-07-23 19:59:23 +00:00
# Copyright (c) 2024 SUSE LLC
2014-02-20 09:47:03 +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.
2024-07-23 19:59:23 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2014-02-20 09:47:03 +00:00
#
2024-07-23 19:59:23 +00:00
%define cpan_name HTML-Template-Expr
2014-02-20 09:47:03 +00:00
Name : perl-HTML-Template-Expr
2024-07-23 19:59:23 +00:00
Version : 0.70.0
Release : 0
# 0.07 -> normalize -> 0.70.0
%define cpan_version 0.07
#Upstream: HTML::Template::Expr : HTML::Template extension adding expression support 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 : HTML::Template extension adding expression support
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
2025-08-12 18:14:37 +02:00
Source100 : README.md
2024-07-23 19:59:23 +00:00
BuildArch : noarch
BuildRequires : perl
BuildRequires : perl-macros
BuildRequires : perl(HTML::Template) >= 2.4
BuildRequires : perl(Parse::RecDescent)
Requires : perl(HTML::Template) >= 2.4
Requires : perl(Parse::RecDescent)
Provides : perl(HTML::Template::Expr) = %{version}
%undefine __perllib_provides
2014-02-20 09:47:03 +00:00
%{perl_requires}
%description
This module provides an extension to HTML::Template which allows
2024-07-23 19:59:23 +00:00
expressions in the template syntax. This is purely an addition - all the
normal HTML::Template options, syntax and behaviors will still work. See
HTML::Template for details.
Expression support includes comparisons, math operations, string operations
and a mechanism to allow you add your own functions at runtime. The basic
syntax is:
<TMPL_IF EXPR=" b a n a n a _ c o u n t > 1 0 " >
I've got a lot of bananas.
</TMPL_IF>
2014-02-20 09:47:03 +00:00
2024-07-23 19:59:23 +00:00
This will output " I ' v e g o t a l o t o f b a n a n a s " if you call:
2014-02-20 09:47:03 +00:00
2024-07-23 19:59:23 +00:00
$template->param(banana_count => 100);
2014-02-20 09:47:03 +00:00
2024-07-23 19:59:23 +00:00
In your script. <TMPL_VAR>s also work with expressions:
2014-02-20 09:47:03 +00:00
2024-07-23 19:59:23 +00:00
I'd like to have <TMPL_VAR EXPR=" b a n a n a _ c o u n t * 2 " > bananas.
This will output " I ' d l i k e t o h a v e 2 0 0 b a n a n a s . " with the same param() call
as above.
2014-02-20 09:47:03 +00:00
%prep
2024-07-23 19:59:23 +00:00
%autosetup -n %{cpan_name} -%{cpan_version}
2014-02-20 09:47:03 +00:00
%build
2024-07-23 19:59:23 +00:00
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%check
2014-02-20 09:47:03 +00:00
make test
%install
2024-07-23 19:59:23 +00:00
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc ANNOUNCE Changes README
%license ARTISTIC GPL
2014-02-20 09:47:03 +00:00
%changelog