Normalize CPAN version
See https://github.com/openSUSE/cpanspec/issues/47 for details OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-String-Diff?expand=0&rev=24
This commit is contained in:
@@ -16,43 +16,37 @@
|
||||
#
|
||||
|
||||
|
||||
Name: perl-String-Diff
|
||||
Version: 0.07
|
||||
Release: 0
|
||||
%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
|
||||
Group: Development/Libraries/Perl
|
||||
Summary: Simple diff to String
|
||||
URL: https://metacpan.org/release/%{cpan_name}
|
||||
Source: https://cpan.metacpan.org/authors/id/Y/YA/YAPPO/%{cpan_name}-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM https://github.com/yappo/p5-String-Diff/commit/cf34e0b93fe89fb24f91cfaf998b5b563f269eb2.patch
|
||||
Patch1: cf34e0b93fe89fb24f91cfaf998b5b563f269eb2.patch
|
||||
Source0: https://cpan.metacpan.org/authors/id/Y/YA/YAPPO/%{cpan_name}-%{cpan_version}.tar.gz
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: perl
|
||||
BuildRequires: perl-macros
|
||||
BuildRequires: perl(Algorithm::Diff)
|
||||
BuildRequires: perl(Capture::Tiny)
|
||||
BuildRequires: perl(HTML::Entities)
|
||||
BuildRequires: perl(Module::Install::GithubMeta)
|
||||
BuildRequires: perl(Module::Install::ReadmeFromPod)
|
||||
BuildRequires: perl(Module::Install::ReadmeMarkdownFromPod)
|
||||
BuildRequires: perl(Module::Install::Repository)
|
||||
BuildRequires: perl(Test::Base)
|
||||
BuildRequires: perl(Module::Build)
|
||||
BuildRequires: perl(Module::Build::Tiny) >= 0.034
|
||||
BuildRequires: perl(Test::More) >= 0.88
|
||||
BuildRequires: perl(YAML)
|
||||
Requires: perl(Algorithm::Diff)
|
||||
Requires: perl(Capture::Tiny)
|
||||
Requires: perl(HTML::Entities)
|
||||
Provides: perl(String::Diff) = %{version}
|
||||
%undefine __perllib_provides
|
||||
%{perl_requires}
|
||||
|
||||
%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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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_close => '</del>',
|
||||
append_open => '<ins>',
|
||||
append_close => '</ins>',
|
||||
});
|
||||
);
|
||||
|
||||
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 <b><ins><BIG>R</BIG>uby</ins></b>');
|
||||
|
||||
%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
|
||||
perl Makefile.PL INSTALLDIRS=vendor
|
||||
make %{?_smp_mflags}
|
||||
perl Build.PL --installdirs=vendor
|
||||
./Build build --flags=%{?_smp_mflags}
|
||||
|
||||
%check
|
||||
make test
|
||||
./Build test
|
||||
|
||||
%install
|
||||
%perl_make_install
|
||||
%perl_process_packlist
|
||||
./Build install --destdir=%{buildroot} --create_packlist=0
|
||||
%perl_gen_filelist
|
||||
|
||||
%files -f %{name}.files
|
||||
%defattr(-,root,root,755)
|
||||
%doc Changes README README.mkdn
|
||||
%doc Changes README
|
||||
%license LICENSE
|
||||
|
||||
%changelog
|
||||
|
Reference in New Issue
Block a user