#
# spec file for package perl-Term-Completion
#
# Copyright (c) 2018 SUSE LINUX 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:           perl-Term-Completion 
Version:        1.00
Release:        2.31.uyuni3
Summary:        Read one line of user input, with convenience functions 
License:        GPL-1.0+ or Artistic-1.0
Group:          Development/Libraries
Source:         http://search.cpan.org/CPAN/authors/id/M/MA/MAREKR/Term-Completion-%{version}.tar.gz 
Url:            http://search.cpan.org/dist/Term-Completion
Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
BuildArch:      noarch
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(Carp)
BuildRequires:  perl(Exporter)
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(File::Spec)
BuildRequires:  perl(IO::Handle)
BuildRequires:  perl(IO::String)
BuildRequires:  perl(POSIX)
BuildRequires:  perl(Term::ReadKey) >= 2.3
BuildRequires:  perl(Term::Size)
BuildRequires:  perl(Test::More)
BuildRequires:  perl(base)
BuildRequires:  perl(strict)
BuildRequires:  perl(warnings)
Requires:       perl(Term::ReadKey) >= 2.3
Requires:       perl(Term::Size)
Provides:      perl(Term::Completion::Path)
%if !0%{?rhel}
# Removed by copr build script
%endif

Patch0:         space-handling.patch

%{?perl_default_filter}

%description
Term::Completion is an extensible, highly configurable replacement for
the venerable Term::Complete package. It is object-oriented and thus allows
subclassing. Two derived classes are Term::Completion::Multi and 
Term::Completion::Path. A prompt is printed and the user may enter one line
of input, submitting the answer by pressing the ENTER key. 

%prep
%setup -q -n Term-Completion-%{version}
%patch0 -p1
find . -type f -exec chmod -c -x {} \;
perl -pi -e 's|^#!/opt/perl_5.8.8/bin/perl|#!%{__perl}|' devel/tget.pl
for file in README Changes devel/*; do
    sed -i 's/\r//g' ${file}
done

%build
perl Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}

%install
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
%{_fixperms} %{buildroot}/*
%if !0%{?rhel}
%perl_process_packlist
%endif

%check
# needed for testing...
export COLUMNS=80
export LINES=25
make test

%files
%defattr(-,root,root)
%doc Changes README devel/
%{perl_vendorlib}/*
%{_mandir}/man3/*.3*

%changelog
* Fri Dec 18 2020 Stefan Bluhm <stefan.bluhm@clacee.eu>
- Adapted for RHEL systems.
* Wed Jan 17 2018 mc@suse.com
- format specfile
* Sun Jun 18 2017 mc@suse.com
- require Term::Size and Term::ReadKey
* Sat Jun 17 2017 mc@suse.com
- initial package