File perl-Text-Table-HTML-DataTables.spec of Package perl-Text-Table-HTML-DataTables

#
# spec file for package perl-Text-Table-HTML-DataTables
#
# Copyright (c) 2025 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 Text-Table-HTML-DataTables
Name:           perl-Text-Table-HTML-DataTables
Version:        0.013
Release:        0
License:        Artistic-1.0 OR GPL-1.0-or-later
Summary:        Generate HTML table with jQuery and DataTables plugin
URL:            https://metacpan.org/release/%{cpan_name}
Source0:        https://cpan.metacpan.org/authors/id/P/PE/PERLANCAR/%{cpan_name}-%{version}.tar.gz
BuildArch:      noarch
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(File::ShareDir)
BuildRequires:  perl(File::ShareDir::Install) >= 0.06
BuildRequires:  perl(File::Slurper)
BuildRequires:  perl(HTML::Entities)
BuildRequires:  perl(JSON::PP)
BuildRequires:  perl(URI::Escape)
Requires:       perl(File::ShareDir)
Requires:       perl(File::Slurper)
Requires:       perl(HTML::Entities)
Requires:       perl(JSON::PP)
Requires:       perl(URI::Escape)
%{perl_requires}

%description
This module is just like Text::Table::HTML, except the HTML code will also
load jQuery (http://jquery.com) and the DataTables plugin
(http://datatables.net) from the local filesystem (distribution shared
directory), so you can filter and sort the table in the browser.

The datatables bundled in this distribution has the following
characteristics:

* * Support negative search using dash prefix syntax ("-foo") a la Google

To search for table rows that contain "foo", "bar" (in no particular order)
and not "baz", you can enter in the search box:

 foo bar -baz

The example shown in the SYNOPSIS generates HTML code like the following:

 <link rel="stylesheet" type="text/css" href="file:///home/ujang/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/auto/share/dist/Text-Table-HTML-DataTables/datatables-1.10.13/css/jquery.dataTables.min.css">
 <script src="file:///home/ujang/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/auto/share/dist/Text-Table-HTML-DataTables/jquery-2.2.4/jquery-2.2.4.min.js"></script>
 <script src="file:///home/ujang/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/auto/share/dist/Text-Table-HTML-DataTables/datatables-1.10.13/js/jquery.dataTables.min.js"></script>
 <script>$(document).ready(function() { $("table").DataTable(); });</script>

 <table>
 <thead>
 <tr><th>Name</th><th>Rank</th><th>Serial</th></tr>
 </thead>
 <tbody>
 <tr><td>alice</td><td>pvt</td><td>12345</td></tr>
 <tr><td>bob</td><td>cpl</td><td>98765321</td></tr>
 <tr><td>carol</td><td>brig gen</td><td>8745</td></tr>
 </tbody>
 </table>

%prep
%autosetup  -n %{cpan_name}-%{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
openSUSE Build Service is sponsored by