Files
perl-Dancer-Template-Tenjin/perl-Dancer-Template-Tenjin.spec
2025-08-12 18:12:59 +02:00

88 lines
2.8 KiB
RPMSpec

#
# spec file for package perl-Dancer-Template-Tenjin
#
# 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 Dancer-Template-Tenjin
Name: perl-Dancer-Template-Tenjin
Version: 0.500.0
Release: 0
# 0.5 -> normalize -> 0.500.0
%define cpan_version 0.5
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Tenjin wrapper for Dancer
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/I/ID/IDOPEREL/%{cpan_name}-%{cpan_version}.tar.gz
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Dancer::Config)
BuildRequires: perl(Dancer::FileUtils)
BuildRequires: perl(Dancer::Template::Abstract)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.31
BuildRequires: perl(Tenjin) >= 0.70.1
BuildRequires: perl(Try::Tiny)
Requires: perl(Dancer::Config)
Requires: perl(Dancer::Template::Abstract)
Requires: perl(Tenjin) >= 0.70.1
Requires: perl(Try::Tiny)
Provides: perl(Dancer::Template::Tenjin) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
This class is an interface between Dancer's template engine abstraction
layer and the Tenjin module.
Tenjin is a fast and feature-full templating engine that can be used by
Dancer for production purposes. In comparison to Template::Toolkit, it is
much more lightweight, has almost no dependencies, and supports embedded
Perl code instead of defining its own language.
In order to use this engine, you need to set your webapp's template engine
in your app's configuration file (config.yml) like so:
template: "tenjin"
You can also directly set it in your app code with the *set* keyword.
Now you can create Tenjin templates normally, but note that due to a Dancer
restriction your template files must end in the '.tt' extension as Dancer
automatically adds this extension to the template names you declare in your
apps.
%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 README
%license LICENSE
%changelog