2024-07-29 19:33:09 +00:00
committed by Git OBS Bridge
parent 1c695f48ad
commit ac146f4d41

View File

@@ -16,43 +16,37 @@
# #
Name: perl-String-Diff
Version: 0.07
Release: 0
%define cpan_name String-Diff %define cpan_name String-Diff
Summary: Simple diff to String Name: perl-String-Diff
Version: 0.70.0
Release: 0
# 0.07 -> normalize -> 0.70.0
%define cpan_version 0.07
License: Artistic-1.0 OR GPL-1.0-or-later License: Artistic-1.0 OR GPL-1.0-or-later
Group: Development/Libraries/Perl Summary: Simple diff to String
URL: https://metacpan.org/release/%{cpan_name} URL: https://metacpan.org/release/%{cpan_name}
Source: https://cpan.metacpan.org/authors/id/Y/YA/YAPPO/%{cpan_name}-%{version}.tar.gz Source0: https://cpan.metacpan.org/authors/id/Y/YA/YAPPO/%{cpan_name}-%{cpan_version}.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/yappo/p5-String-Diff/commit/cf34e0b93fe89fb24f91cfaf998b5b563f269eb2.patch
Patch1: cf34e0b93fe89fb24f91cfaf998b5b563f269eb2.patch
BuildArch: noarch BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl BuildRequires: perl
BuildRequires: perl-macros BuildRequires: perl-macros
BuildRequires: perl(Algorithm::Diff) BuildRequires: perl(Algorithm::Diff)
BuildRequires: perl(Capture::Tiny) BuildRequires: perl(Module::Build)
BuildRequires: perl(HTML::Entities) BuildRequires: perl(Module::Build::Tiny) >= 0.034
BuildRequires: perl(Module::Install::GithubMeta) BuildRequires: perl(Test::More) >= 0.88
BuildRequires: perl(Module::Install::ReadmeFromPod)
BuildRequires: perl(Module::Install::ReadmeMarkdownFromPod)
BuildRequires: perl(Module::Install::Repository)
BuildRequires: perl(Test::Base)
BuildRequires: perl(YAML) BuildRequires: perl(YAML)
Requires: perl(Algorithm::Diff) Requires: perl(Algorithm::Diff)
Requires: perl(Capture::Tiny) Provides: perl(String::Diff) = %{version}
Requires: perl(HTML::Entities) %undefine __perllib_provides
%{perl_requires} %{perl_requires}
%description %description
String::Diff is the difference of a consecutive string is made. After String::Diff is the difference of a consecutive string is made. after
general diff is done, the difference in the line is searchable. general diff is done, the difference in the line is searchable.
the mark of the addition and the deletion can be freely changed. The color the mark of the addition and the deletion can be freely changed. the color
is colored to the terminal with ANSI, using the HTML display it. is colored to the terminal with ANSI, using the HTML display it.
After the line is divided, diff is taken when 'linebreak' option is after the line is divided, diff is taken when 'linebreak' option is
specified. specified.
my($old_string, $new_string) = String::Diff::diff_fully('this is Perl', 'this is Ruby', linebreak => 1); my($old_string, $new_string) = String::Diff::diff_fully('this is Perl', 'this is Ruby', linebreak => 1);
@@ -62,12 +56,12 @@ specified.
In diff and diff_merge methods the mark of the difference can be changed. In diff and diff_merge methods the mark of the difference can be changed.
my $diff = String::Diff::diff('this is Perl', 'this is Ruby',{ my $diff = String::Diff::diff('this is Perl', 'this is Ruby',
remove_open => '<del>', remove_open => '<del>',
remove_close => '</del>', remove_close => '</del>',
append_open => '<ins>', append_open => '<ins>',
append_close => '</ins>', append_close => '</ins>',
}); );
You can escape callback set to diff function and diff_merge function. You can escape callback set to diff function and diff_merge function.
@@ -85,22 +79,23 @@ You can escape callback set to diff function and diff_merge function.
is($diff_new, 'this is &lt;b&gt;<ins>&lt;BIG&gt;R&lt;/BIG&gt;uby</ins>&lt;/b&gt;'); is($diff_new, 'this is &lt;b&gt;<ins>&lt;BIG&gt;R&lt;/BIG&gt;uby</ins>&lt;/b&gt;');
%prep %prep
%autosetup -n %{cpan_name}-%{version} -p1 %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 %build
perl Makefile.PL INSTALLDIRS=vendor perl Build.PL --installdirs=vendor
make %{?_smp_mflags} ./Build build --flags=%{?_smp_mflags}
%check %check
make test ./Build test
%install %install
%perl_make_install ./Build install --destdir=%{buildroot} --create_packlist=0
%perl_process_packlist
%perl_gen_filelist %perl_gen_filelist
%files -f %{name}.files %files -f %{name}.files
%defattr(-,root,root,755) %doc Changes README
%doc Changes README README.mkdn %license LICENSE
%changelog %changelog