# Disable t/ucd.t, it consumes a lot of memory, CPAN RT#108739
%bcond_with ucdtest
Name: perl-Text-Bidi
Version: 2.11
Release: 3%{?dist}
Summary: Unicode bidirectional algorithm using libfribidi
# LICENSE: GPL+ or Artistic
## not in the binary package
# t/BidiTest.txt: UCD
License: GPL+ or Artistic
Group: Development/Libraries
URL: http://search.cpan.org/dist/Text-Bidi/
Source0: http://www.cpan.org/authors/id/K/KA/KAMENSKY/Text-Bidi-%{version}.tar.gz
# Do not use /usr/bin/env, CPAN RT#108736
Patch0: Text-Bidi-2.11-Normalize-shell-bang.patch
# Fix build script to cope with missing pregenerated files, CPAN RT#108738
Patch1: Text-Bidi-2.11-Install-generated-lib-Text-Bidi-private.pm.patch
# bidi is a plugin, CPAN RT#108737
Patch2: Text-Bidi-2.11-Remove-script-attributes-from-bidi.patch
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: gcc
BuildRequires: make
BuildRequires: perl
BuildRequires: perl-devel
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30
# Prefer pkgconfig for locating fribidi
BuildRequires: perl(ExtUtils::PkgConfig)
BuildRequires: perl(strict)
BuildRequires: perl(warnings)
BuildRequires: pkgconfig(fribidi)
BuildRequires: sed
BuildRequires: swig
# Run-time:
BuildRequires: perl(base)
BuildRequires: perl(Carp)
BuildRequires: perl(Config)
BuildRequires: perl(DynaLoader)
BuildRequires: perl(Encode)
BuildRequires: perl(Exporter)
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(integer)
BuildRequires: perl(open)
BuildRequires: perl(overload)
BuildRequires: perl(Tie::Array)
# Tests:
BuildRequires: perl(charnames)
%if %{with ucdtext}
BuildRequires: perl(Data::Dumper)
%endif
BuildRequires: perl(File::Spec)
BuildRequires: perl(File::Temp)
BuildRequires: perl(IO::Handle)
BuildRequires: perl(IPC::Open3)
BuildRequires: perl(Test::More)
%if %{with ucdtext}
BuildRequires: perl(version) >= 0.77
%endif
# Optional tests:
# CPAN::Meta 2.120900 not useful
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
%description
This Perl module provides basic support for the Unicode bidirectional (Bidi)
text algorithm, for displaying text consisting of both left-to-right and
right-to-left written languages (such as Hebrew and Arabic.) It does so via
a SWIG interface file to the libfribidi library.
%package urxvt
Summary: Unicode bidirectional text support for urxvt
License: GPL+ or Artistic
Group: User Interface/X
Requires: perl(Encode)
Requires: perl(Text::Bidi)
Requires: perl(Text::Bidi::Constants)
Requires: rxvt-unicode
%description urxvt
This extension filters the text displayed by Urxvt, so that Bi-directional
text (e.g., Hebrew or Arabic mixed with English) is displayed correctly.
%prep
%setup -q -n Text-Bidi-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
# Delete SWIG-generated files
rm private.c lib/Text/Bidi/private.pm
sed -i -e '/^private\.c/d' MANIFEST
sed -i -e '/^lib\/Text\/Bidi\/private\.pm/d' MANIFEST
# Disable t/ucd.t, it consumes a lot of memory, CPAN RT#108739
%if !%{with ucdtext}
rm t/ucd.t
sed -i -e '/^t\/ucd\.t/d' MANIFEST
%endif
%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
make %{?_smp_mflags}
%install
make pure_install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \;
%{_fixperms} $RPM_BUILD_ROOT/*
install -d -m 0755 ${RPM_BUILD_ROOT}%{_libdir}/urxvt/perl
install -m 0644 -t ${RPM_BUILD_ROOT}%{_libdir}/urxvt/perl misc/bidi
%check
make test
%files
%license LICENSE
%doc Changes
%{_bindir}/*
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/Text*
%{_mandir}/man1/*
%{_mandir}/man3/*
%files urxvt
%license LICENSE
%{_libdir}/urxvt/perl/bidi
%changelog
* Sun May 15 2016 Jitka Plesnikova <jplesnik@redhat.com> - 2.11-3
- Perl 5.24 rebuild
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Petr Pisar <ppisar@redhat.com> 2.11-1
- Specfile autogenerated by cpanspec 1.78.