Package perl-Expect-Simple: Specfile

#
#   - Expect::Simple -
#   This spec file was automatically generated by cpan2rpm [ver: 2.027]
#   (ALT Linux revision)
#   The following arguments were used:
#       --spec-only Expect-Simple-0.04.tar.gz
#   For more information on cpan2rpm please visit: http://perl.arix.com/
#
%def_without test
%define module Expect-Simple
%define m_distro Expect-Simple
%define m_name Expect::Simple
%define m_author_id unknown
%define _enable_test 1

Name: perl-Expect-Simple
Version: 0.04
Release: alt1

Summary: wrapper around the Expect module
Summary(ru_RU.UTF-8): Expect-Simple есть простейшая обёртка вокруг модуля Expect

License: Artistic
Group: Development/Perl
Url: http://ftp.silvernet.ru/CPAN/authors/id/D/DJ/DJERIUS/

Packager: Malo Skryleve <malo@altlinux.org>

BuildArch: noarch
Source: %m_distro-%version.tar.gz

Requires: perl-Expect
BuildRequires: perl-Expect perl-devel

%description
"Expect::Simple" is a wrapper around the "Expect" module which
should suffice for simple applications.  It hides most of the
"Expect" machinery; the "Expect" object is available for tweaking if
need be.

Generally, one starts by creating an Expect::Simple object using
new.  This will start up the target program, and will wait until
one of the specified prompts is output by the target.  At that point
the caller should send() commands to the program; the results are
available via the before, after, match_str, and match_idx
methods.  Since Expect simulates a terminal, there will be extra
"\r" characters at the end of each line in the result (on UNIX at
least).  This is easily fixed:

    ($res = $obj->before) =~ tr/\r//d;
    @lines = split( "\n", $res );

This is not done automatically.

Exceptions will be thrown on error (match with "/Expect::Simple/").
Errors from Expect are available via the error_expect method.
More human readable errors are available via the error method.

The connection is automatically broken (by sending the specified
disconnect command to the target) when the Expect::Simple object is
destroyed.

%description -l ru_RU.UTF-8
"Expect::Simple" есть обёртка вокруг модуля "Expect", которой должно
хватить для простых приложений. Обёртка таит большинство из набора
функций модуля, однако ж, сам объект всё ещё доступен для работы с ним.

Начинать работу обычно нужно с создания объекта Expect::Simple чрез
метод new, который запустит целевую программу и будет ожидать пока
от целевой программы не выведется какая-либо из указанных строк. После
чего приложение может посылать ей команды чрез send(), а плод
исполнения команды получать чрез before, after, match_str, и match_idx.
Поскольку Expect эмулирует терминал, то по крайней мере на
Unix-компьютерах вывод от целевой программы будет содержать символы "\r"
в конце каждой строки. Сие же может быть легко поправлено:

    ($res = $obj->before) =~ tr/\r//d;
    @lines = split( "\n", $res );

Вся сия не делаются автоматически.

Исключения будет выпущено при ошибке, а ловить его нужно правилом
/Expect::Simple/. Ошибки от Expect доступны чрез метод error_expect.
А человекочитаемый вид ошибки может быть получен чрез метод error.

Когда объект Expect::Simple уничтожается, соединение автоматически
обрывается посылкою определённой команды на отключение от целевой
программы.

%prep
%setup -n %m_distro-%version
%build
%perl_vendor_build

%install
%perl_vendor_install

%files
%perl_vendor_privlib/Expect/*

%changelog
* Wed Feb 16 2011 Malo Skryleve <malo@altlinux.org> 0.04-alt1
- initial build for ALT Linux Sisyphus