##
##  perl-ole.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_ole_storage                    0.386
%define       V_ole_storage_lite               0.22
%define       V_spreadsheet_writeexcel         2.40
%define       V_spreadsheet_writeexcel_simple  1.04
%define       V_spreadsheet_writeexcel_fromxml 1.1
%define       V_spreadsheet_writeexcelxml      0.15
%define       V_spreadsheet_parseexcel         0.66
%define       V_spreadsheet_parseexcel_simple  1.04
%define       V_spreadsheet_basicread          1.12
%define       V_spreadsheet_convertaa          0.06
%define       V_spreadsheet_perl               0.12
%define       V_spreadsheet_engine             0.14

#   package information
Name:         perl-ole
Summary:      Perl Modules for use with OLE Documents
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/M/MS/MSCHWARTZ/OLE-Storage-%{V_ole_storage}.tar.gz
Source1:      http://www.cpan.org/authors/id/J/JM/JMCNAMARA/OLE-Storage_Lite-%{V_ole_storage_lite}.tar.gz
Source2:      http://www.cpan.org/authors/id/J/JM/JMCNAMARA/Spreadsheet-WriteExcel-%{V_spreadsheet_writeexcel}.tar.gz
Source3:      http://www.cpan.org/authors/id/T/TM/TMTM/Spreadsheet-WriteExcel-Simple-%{V_spreadsheet_writeexcel_simple}.tar.gz
Source4:      http://www.cpan.org/authors/id/B/BW/BWMCADAMS/Spreadsheet-WriteExcel-FromXML-%{V_spreadsheet_writeexcel_fromxml}.tar.gz
Source5:      http://www.cpan.org/authors/id/J/JM/JMCNAMARA/Spreadsheet-WriteExcelXML-%{V_spreadsheet_writeexcelxml}.tar.gz
Source6:      http://www.cpan.org/authors/id/J/JM/JMCNAMARA/Spreadsheet-ParseExcel-%{V_spreadsheet_parseexcel}.tar.gz
Source7:      http://www.cpan.org/authors/id/T/TM/TMTM/Spreadsheet-ParseExcel-Simple-%{V_spreadsheet_parseexcel_simple}.tar.gz
Source8:      http://www.cpan.org/authors/id/G/GN/GNG/Spreadsheet-BasicRead-%{V_spreadsheet_basicread}.tar.gz
Source9:      http://www.cpan.org/authors/id/N/NK/NKH/Spreadsheet-ConvertAA-%{V_spreadsheet_convertaa}.tar.gz
Source10:     http://www.cpan.org/authors/id/N/NK/NKH/Spreadsheet-Perl-%{V_spreadsheet_perl}.tar.gz
Source11:     http://www.cpan.org/authors/id/T/TM/TMTM/Spreadsheet-Engine-%{V_spreadsheet_engine}.tar.gz

#   build information
BuildPreReq:  OpenPKG, openpkg >= 20160101, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126
PreReq:       OpenPKG, openpkg >= 20160101, perl >= %{V_perl}
BuildPreReq:  perl-parse, perl-util, perl-term, perl-devel, perl-text
PreReq:       perl-parse, perl-util, perl-term, perl-devel, perl-text

%description
    Perl modules for use with OLE documents:
    - OLE::Storage (%{V_ole_storage})
    - OLE::Storage::Light (%{V_ole_storage_lite})
    - Spreadsheet::WriteExcel (%{V_spreadsheet_writeexcel})
    - Spreadsheet::WriteExcel::Simple (%{V_spreadsheet_writeexcel_simple})
    - Spreadsheet::WriteExcel::FromXML (%{V_spreadsheet_writeexcel_fromxml})
    - Spreadsheet::WriteExcelXML (%{V_spreadsheet_writeexcelxml})
    - Spreadsheet::ParseExcel (%{V_spreadsheet_parseexcel})
    - Spreadsheet::ParseExcel::Simple (%{V_spreadsheet_parseexcel_simple})
    - Spreadsheet::BasicRead (%{V_spreadsheet_basicread})
    - Spreadsheet::ConvertAA (%{V_spreadsheet_convertaa})
    - Spreadsheet::Perl (%{V_spreadsheet_perl})
    - Spreadsheet::Engine (%{V_spreadsheet_engine})

%track
    prog perl-ole:OLE-Storage = {
        version   = %{V_ole_storage}
        url       = http://www.cpan.org/authors/id/M/MS/MSCHWARTZ/
        regex     = OLE-Storage-(__VER__)\.tar\.gz
    }
    prog perl-ole:OLE-Storage-Lite = {
        version   = %{V_ole_storage_lite}
        url       = http://www.cpan.org/authors/id/J/JM/JMCNAMARA/
        regex     = OLE-Storage_Lite-(__VER__)\.tar\.gz
    }
    prog perl-ole:Spreadsheet-WriteExcel = {
        version   = %{V_spreadsheet_writeexcel}
        url       = http://www.cpan.org/authors/id/J/JM/JMCNAMARA/
        regex     = Spreadsheet-WriteExcel-(__VER__)\.tar\.gz
    }
    prog perl-ole:Spreadsheet-WriteExcel-Simple = {
        version   = %{V_spreadsheet_writeexcel_simple}
        url       = http://www.cpan.org/authors/id/T/TM/TMTM/
        regex     = Spreadsheet-WriteExcel-Simple-(__VER__)\.tar\.gz
    }
    prog perl-ole:Spreadsheet-WriteExcel-FromXML = {
        version   = %{V_spreadsheet_writeexcel_fromxml}
        url       = http://www.cpan.org/authors/id/B/BW/BWMCADAMS/
        regex     = Spreadsheet-WriteExcel-FromXML-(__VER__)\.tar\.gz
    }
    prog perl-ole:Spreadsheet-WriteExcelXML = {
        version   = %{V_spreadsheet_writeexcelxml}
        url       = http://www.cpan.org/authors/id/J/JM/JMCNAMARA/
        regex     = Spreadsheet-WriteExcelXML-(__VER__)\.tar\.gz
    }
    prog perl-ole:Spreadsheet-ParseExcel = {
        version   = %{V_spreadsheet_parseexcel}
        url       = http://www.cpan.org/authors/id/J/JM/JMCNAMARA/
        regex     = Spreadsheet-ParseExcel-(\d+.\d\d)\.tar\.gz
    }
    prog perl-ole:Spreadsheet-ParseExcel-Simple = {
        version   = %{V_spreadsheet_parseexcel_simple}
        url       = http://www.cpan.org/authors/id/T/TM/TMTM/
        regex     = Spreadsheet-ParseExcel-Simple-(__VER__)\.tar\.gz
    }
    prog perl-ole:Spreadsheet-BasicRead = {
        version   = %{V_spreadsheet_basicread}
        url       = http://www.cpan.org/authors/id/G/GN/GNG/
        regex     = Spreadsheet-BasicRead-(__VER__)\.tar\.gz
    }
    prog perl-ole:Spreadsheet-ConvertAA = {
        version   = %{V_spreadsheet_convertaa}
        url       = http://www.cpan.org/authors/id/N/NK/NKH/
        regex     = Spreadsheet-ConvertAA-(__VER__)\.tar\.gz
    }
    prog perl-ole:Spreadsheet-Perl = {
        version   = %{V_spreadsheet_perl}
        url       = http://www.cpan.org/authors/id/N/NK/NKH/
        regex     = Spreadsheet-Perl-(__VER__)\.tar\.gz
    }
    prog perl-ole:Spreadsheet-Engine = {
        version   = %{V_spreadsheet_engine}
        url       = http://www.cpan.org/authors/id/T/TM/TMTM/
        regex     = Spreadsheet-Engine-(__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

%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 -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

