Blob Blame History Raw
%if 0%{?fedora} <= 14
%define pvendorlib %{perl_privlib}
%endif
%if 0%{?fedora} >= 15
%define pvendorlib %{perl_vendorlib}
%endif
%if 0%{?rhel} >= 5
%define pvendorlib %{perl_vendorlib}
%endif

Name:           perl-Net-SSH-Expect
Version:        1.09
Release:        7%{?dist}
Summary:        Net-SSH-Expect - SSH wrapper to execute remote commands

Group:          Development/Libraries
License:        GPL+ or Artistic
URL:            http://search.cpan.org/dist/Net-SSH-Expect/
Source0:        http://search.cpan.org/CPAN/authors/id/B/BN/BNEGRAO/Net-SSH-Expect-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch

BuildRequires:  perl(ExtUtils::MakeMaker), perl(Test::More), perl-Expect

Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)), perl-Expect

%description
This module is a wrapper to the *ssh* executable that is available in
your system's *$PATH*. Use this module to execute commands on the
remote SSH server. It authenticates with the user and password you
passed in the constructor's attributes "user" and "password".

Once an ssh connection was started using the "connect()" method it will
remain open until you call the "close()" method. This allows you execute
as many commands as you want with the "exec()" method using only one
connection. This is a better approach over other ssh wrapper
implementations, i.e: Net::SCP, Net::SSH and Net::SCP::Expect, that
start a new ssh connection each time a remote command is issued or a
file is transfered.

It uses *Expect.pm* module to interact with the SSH server. A
"get_expect()" method is provided so you can obtain the internal
"Expect" object connected to the SSH server. Use this only if you have
some special need that you can't do with the "exec()" method.

This module was inspired by Net::SCP::Expect 
<http://search.cpan.org/~djberg/Net-SCP-Expect-0.12/Expect.pm>
and by Net::Telnet and some of its methods work the same as these two
modules.

%prep
%setup -q -n Net-SSH-Expect-%{version}

%build
PERL5_CPANPLUS_IS_RUNNING=1 %{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} 

%check
%{__make} test

%install
rm -rf %{buildroot}
%{__make} pure_install PERL_INSTALL_ROOT=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} ';' 2>/dev/null

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%{_mandir}/man3/Net::SSH::Expect.3pm.gz
%{pvendorlib}/Net
%{pvendorlib}/Net/SSH
%{pvendorlib}/Net/SSH/Expect.pm
%{pvendorlib}/Net/SSH/Expect.pod

%changelog
* Wed Aug 28 2013 Carl Thompson <fedora@red-dragon.com> - 1.09-7
- fixed permissions in %files section

* Tue May 14 2013 Carl Thopmson <fedora@red-dragon.com> - 1.09-6
- added ownership to directories

* Fri Mar 4 2011 Carl Thompson <fedora@red-dragon.com> 1.09-5
- fixed a typo in the spec file

* Thu Mar 3 2011 Carl Thompson <fedora@red-dragon.com> 1.09-4
- updated the spec to remove some legacy components
- added PERL5_CPANPLUS_IS_RUNNING=1 to prevent package from pulling
- from CPAN

* Wed Mar 2 2011 Carl Thompson <fedora@red-dragon.com> 1.09-3
- fixed an error in the if statements testing distro for definition

* Wed Mar 2 2011 Carl Thompson <fedora@red-dragon.com> 1.09-2
- cleaned up the spec file and used more macros

* Tue Mar 1 2011 Carl Thompson <fedora@red-dragon.com> 1.09-1
- Initial build.