File rubygem-diff-lcs.spec of Package rubygem-diff-lcs

#
# spec file for package rubygem-diff-lcs
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


Name:           rubygem-diff-lcs
Version:        1.2.5
Release:        0
%define mod_name diff-lcs
%define mod_full_name %{mod_name}-%{version}

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  ruby-macros >= 1
BuildRequires:  rubygem(rdoc) > 3.10
Url:            http://diff-lcs.rubyforge.org/
Source:         http://rubygems.org/gems/%{mod_full_name}.gem
Patch1:         fix-interpreter.diff
Summary:        Diff::LCS computes the difference between two Enumerable sequences
License:        GPL-2.0+ or Ruby
Group:          Development/Languages/Ruby
%define mod_branch -1.2.4
%define mod_weight 1
PreReq:         update-alternatives

%description
Diff::LCS computes the difference between two Enumerable sequences using the
McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
to create a simple HTML diff output format and a standard diff-like tool.
This is release 1.2.4, fixing a bug introduced after diff-lcs 1.1.3 that did
not properly prune common sequences at the beginning of a comparison set.
Thanks to Paul Kunysch for fixing this issue.
Coincident with the release of diff-lcs 1.2.3, we reported an issue with
Rubinius in 1.9 mode
({rubinius/rubinius#2268}[https://github.com/rubinius/rubinius/issues/2268]).
We are happy to report that this issue has been resolved.

%package doc
Summary:        RDoc documentation for %{mod_name}
Group:          Development/Languages/Ruby
Requires:       %{name} = %{version}

%description doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.

%package testsuite
Summary:        Test suite for %{mod_name}
Group:          Development/Languages/Ruby
Requires:       %{name} = %{version}

%description testsuite
Test::Unit or RSpec files, useful for developers.

%prep
# MANUAL
%gem_unpack
%patch1 -p1
%gem_build

%build

%install
%gem_install -f
mv %{buildroot}%{_bindir}/htmldiff{,%{mod_branch}}
ln -s htmldiff%{mod_branch} %{buildroot}%{_bindir}/htmldiff
mv %{buildroot}%{_bindir}/ldiff{,%{mod_branch}}
ln -s ldiff%{mod_branch} %{buildroot}%{_bindir}/ldiff

%post
/usr/sbin/update-alternatives --install \
    %{_bindir}/htmldiff htmldiff %{_bindir}/htmldiff%{mod_branch} %{mod_weight}
/usr/sbin/update-alternatives --install \
    %{_bindir}/ldiff ldiff %{_bindir}/ldiff%{mod_branch} %{mod_weight}

%preun
if [ "$1" = 0 ] ; then
    /usr/sbin/update-alternatives --remove htmldiff %{_bindir}/htmldiff%{mod_branch}
fi
if [ "$1" = 0 ] ; then
    /usr/sbin/update-alternatives --remove ldiff %{_bindir}/ldiff%{mod_branch}
fi

%files
%defattr(-,root,root,-)
%{_bindir}/htmldiff%{mod_branch}
%ghost %{_bindir}/htmldiff
%{_bindir}/ldiff%{mod_branch}
%ghost %{_bindir}/ldiff
%{_libdir}/ruby/gems/%{rb_ver}/cache/%{mod_full_name}.gem
%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_full_name}/
%exclude %{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_full_name}/spec
%{_libdir}/ruby/gems/%{rb_ver}/specifications/%{mod_full_name}.gemspec

%files doc
%defattr(-,root,root,-)
%doc %{_libdir}/ruby/gems/%{rb_ver}/doc/%{mod_full_name}/

%files testsuite
%defattr(-,root,root,-)
%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_full_name}/spec

%changelog
openSUSE Build Service is sponsored by