##
##  perl-term.spec -- OpenPKG RPM Package Specification
##  Copyright (c) 2000-2025 OpenPKG Project <http://openpkg.org/>
##
##  Permission to use, copy, modify, and distribute this software for
##  any purpose with or without fee is hereby granted, provided that
##  the above copyright notice and this permission notice appear in all
##  copies.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
##  SUCH DAMAGE.
##

#   versions of individual parts
%define       V_perl               5.22
%define       V_term_readkey       2.38
%define       V_term_inkey         1.04
%define       V_term_size          0.209
%define       V_term_query         2.0
%define       V_term_vt102         0.91
%define       V_term_ansiscreen    1.42
%define       V_term_ansicolor     4.06
%define       V_term_readline_gnu  1.20
%define       V_term_readline_perl 1.0303
%define       V_term_progressbar   2.09
%define       V_term_statusbar     1.18
%define       V_term_prompt        1.04
%define       V_term_readpassword  0.11
%define       V_io_tty             1.20
%define       V_io_stty            0.03

#   package information
Name:         perl-term
Summary:      Perl Modules for use with Terminals
URL:          http://www.cpan.org/
Vendor:       Perl Community
Packager:     OpenPKG Project
Distribution: OpenPKG Community
Class:        BASE
Group:        Perl
License:      GPL/Artistic
Version:      %{V_perl}
Release:      20231229

#   list of sources
Source0:      http://www.cpan.org/authors/id/J/JS/JSTOWE/TermReadKey-%{V_term_readkey}.tar.gz
Source1:      http://www.cpan.org/authors/id/R/RA/RAZINF/Term-InKey-%{V_term_inkey}.tar.gz
Source2:      http://www.cpan.org/authors/id/F/FE/FERREIRA/Term-Size-%{V_term_size}.tar.gz
Source3:      http://www.cpan.org/authors/id/A/AK/AKSTE/Term-Query-%{V_term_query}.tar.gz
Source5:      http://www.cpan.org/authors/id/A/AU/AUTRIJUS/Term-ANSIScreen-%{V_term_ansiscreen}.tar.gz
Source4:      http://www.cpan.org/authors/id/A/AJ/AJWOOD/Term-VT102-%{V_term_vt102}.tar.gz
Source6:      http://www.cpan.org/authors/id/T/TO/TODDR/IO-Tty-%{V_io_tty}.tar.gz
Source7:      http://www.cpan.org/authors/id/T/TO/TODDR/IO-Stty-%{V_io_stty}.tar.gz
Source8:      http://www.cpan.org/modules/by-module/Term/Term-ReadLine-Perl-%{V_term_readline_perl}.tar.gz
Source9:      http://www.cpan.org/authors/id/H/HA/HAYASHI/Term-ReadLine-Gnu-%{V_term_readline_gnu}.tar.gz
Source10:     http://www.cpan.org/authors/id/F/FL/FLUFFY/Term-ProgressBar-%{V_term_progressbar}.tar.gz
Source11:     http://www.cpan.org/authors/id/S/SH/SHAYH/Term-StatusBar-%{V_term_statusbar}.tar.gz
Source12:     http://www.cpan.org/authors/id/P/PE/PERSICOM/Term-Prompt-%{V_term_prompt}.tar.gz
Source13:     http://www.cpan.org/authors/id/P/PH/PHOENIX/Term-ReadPassword-%{V_term_readpassword}.tar.gz
Source14:     http://www.cpan.org/authors/id/R/RR/RRA/Term-ANSIColor-%{V_term_ansicolor}.tar.gz
Patch0:       perl-term.patch

#   build information
BuildPreReq:  OpenPKG, openpkg >= 20160101, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126
PreReq:       OpenPKG, openpkg >= 20160101, perl >= %{V_perl}
BuildPreReq:  readline, ncurses, perl-module
PreReq:       readline, ncurses, perl-module

%description
    Various Perl modules for use on Terminals:
    - Term::ReadKey (%{V_term_readkey})
    - Term::InKey (%{V_term_inkey})
    - Term::Size (%{V_term_size})
    - Term::Query (%{V_term_query})
    - Term::ANSIScreen (%{V_term_ansiscreen})
    - Term::ANSIColor (%{V_term_ansicolor})
    - Term::VT102 (%{V_term_vt102})
    - Term::ReadLine::Gnu (%{V_term_readline_gnu})
    - Term::ReadLine::Perl (%{V_term_readline_perl})
    - Term::ProgressBar (%{V_term_progressbar})
    - Term::StatusBar (%{V_term_statusbar})
    - Term::Prompt (%{V_term_prompt})
    - Term::ReadPassword (%{V_term_readpassword})
    - IO::Tty (%{V_io_tty})
    - IO::Pty
    - IO::Stty (%{V_io_stty})

%track
    prog perl-term:IO-Stty = {
        version   = %{V_io_stty}
        url       = http://www.cpan.org/authors/id/T/TO/TODDR/
        regex     = IO-Stty-(__VER__)\.tar\.gz
    }
    prog perl-term:IO-Tty = {
        version   = %{V_io_tty}
        url       = http://www.cpan.org/authors/id/T/TO/TODDR/
        regex     = IO-Tty-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-ANSIScreen = {
        version   = %{V_term_ansiscreen}
        url       = http://www.cpan.org/authors/id/A/AU/AUTRIJUS/
        regex     = Term-ANSIScreen-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-ANSIColor = {
        version   = %{V_term_ansicolor}
        url       = http://www.cpan.org/authors/id/R/RR/RRA/
        regex     = Term-ANSIColor-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-InKey = {
        version   = %{V_term_inkey}
        url       = http://www.cpan.org/authors/id/R/RA/RAZINF/
        regex     = Term-InKey-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-Query = {
        version   = %{V_term_query}
        url       = http://www.cpan.org/authors/id/A/AK/AKSTE/
        regex     = Term-Query-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-ReadLine-Gnu = {
        version   = %{V_term_readline_gnu}
        url       = http://www.cpan.org/authors/id/H/HA/HAYASHI/
        regex     = Term-ReadLine-Gnu-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-ReadLine-Perl = {
        version   = %{V_term_readline_perl}
        url       = http://www.cpan.org/modules/by-module/Term/
        regex     = Term-ReadLine-Perl-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-Size = {
        version   = %{V_term_size}
        url       = http://www.cpan.org/authors/id/F/FE/FERREIRA/
        regex     = Term-Size-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-VT102 = {
        version   = %{V_term_vt102}
        url       = http://www.cpan.org/authors/id/A/AJ/AJWOOD/
        regex     = Term-VT102-(__VER__)\.tar\.gz
    }
    prog perl-term:TermReadKey = {
        version   = %{V_term_readkey}
        url       = http://www.cpan.org/authors/id/J/JS/JSTOWE/
        regex     = TermReadKey-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-ProgressBar = {
        version   = %{V_term_progressbar}
        url       = http://www.cpan.org/authors/id/F/FL/FLUFFY/
        regex     = Term-ProgressBar-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-StatusBar = {
        version   = %{V_term_statusbar}
        url       = http://www.cpan.org/authors/id/S/SH/SHAYH/
        regex     = Term-StatusBar-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-Prompt = {
        version   = %{V_term_prompt}
        url       = http://www.cpan.org/authors/id/P/PE/PERSICOM/
        regex     = Term-Prompt-(__VER__)\.tar\.gz
    }
    prog perl-term:Term-ReadPassword = {
        version   = %{V_term_readpassword}
        url       = http://www.cpan.org/authors/id/P/PH/PHOENIX/
        regex     = Term-ReadPassword-(__VER__)\.tar\.gz
    }

%prep
    %setup -q -c
    %setup -q -T -D -a 1
    %setup -q -T -D -a 2
    %setup -q -T -D -a 3
    %setup -q -T -D -a 4
    %setup -q -T -D -a 5
    %setup -q -T -D -a 6
    %setup -q -T -D -a 7
    %setup -q -T -D -a 8
    %setup -q -T -D -a 9
    %setup -q -T -D -a 10
    %setup -q -T -D -a 11
    %setup -q -T -D -a 12
    %setup -q -T -D -a 13
    %setup -q -T -D -a 14
    %patch -p0

%build

%install
    %{l_prefix}/bin/perl-openpkg prepare
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE0}  configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE1}  configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE2}  configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE3}  configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE4}  configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE5}  configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE6}  configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE7}  configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE8}  configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE9}  configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE10} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE11} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE12} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE13} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE14} configure build install
    %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`

%files -f files

%clean

