##
##  perl-module.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.
##

#   NOTICE: This is some sort of a Perl module bootstrapping package.
#   Hence keep this package as small as possible and especially make
#   sure that its modules do *NOT* depend on anything which is not
#   shipped with the standard Perl distribution.

#   versions of individual parts
%define       V_perl                     5.22
%define       V_extutils_depends         0.304
%define       V_extutils_pkgconfig       1.16
%define       V_extutils_modulemaker     0.63
%define       V_extutils_makemaker       7.76
%define       V_extutils_xsbuilder       0.28
%define       V_extutils_config          0.010
%define       V_extutils_helpers         0.028
%define       V_extutils_installpaths    0.015
%define       V_module_scandeps          1.37
%define       V_module_build             0.4234
%define       V_module_build_tiny        0.039
%define       V_module_corelist          5.20250923
%define       V_module_info              0.35
%define       V_module_locate            1.80
%define       V_module_pluggable         6.3
%define       V_module_pluggable_ordered 1.5
%define       V_module_install           1.14
%define       V_class_inspector          1.28
%define       V_file_sharedir            1.03
%define       V_file_sharedir_install    0.14
%define       V_cpan                     2.38
%define       V_cpan_wait                0.27-2
%define       V_version                  0.9924
%define       V_devel_checklib           1.16

#   package information
Name:         perl-module
Summary:      Perl Modules for use with Perl Archive
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:      20250927

#   list of sources
Source0:      http://www.cpan.org/authors/id/F/FL/FLORA/ExtUtils-Depends-%{V_extutils_depends}.tar.gz
Source1:      http://www.cpan.org/authors/id/X/XA/XAOC/ExtUtils-PkgConfig-%{V_extutils_pkgconfig}.tar.gz
Source2:      http://www.cpan.org/authors/id/J/JK/JKEENAN/ExtUtils-ModuleMaker-%{V_extutils_modulemaker}.tar.gz
Source3:      http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-%{V_extutils_makemaker}.tar.gz
Source4:      http://www.cpan.org/authors/id/R/RS/RSCHUPP/Module-ScanDeps-%{V_module_scandeps}.tar.gz
Source5:      http://www.cpan.org/authors/id/L/LE/LEONT/Module-Build-%{V_module_build}.tar.gz
Source6:      http://www.cpan.org/authors/id/B/BI/BINGOS/Module-CoreList-%{V_module_corelist}.tar.gz
Source7:      http://www.cpan.org/authors/id/M/MB/MBARBON/Module-Info-%{V_module_info}.tar.gz
Source8:      http://www.cpan.org/authors/id/N/NE/NEILB/Module-Locate-%{V_module_locate}.tar.gz
Source9:      http://www.cpan.org/authors/id/A/AD/ADAMK/Class-Inspector-%{V_class_inspector}.tar.gz
Source10:     http://www.cpan.org/authors/id/S/SI/SIMONW/Module-Pluggable-%{V_module_pluggable}.tar.gz
Source11:     http://www.cpan.org/authors/id/A/AP/APEIRON/Module-Pluggable-Ordered-%{V_module_pluggable_ordered}.tar.gz
Source12:     http://www.cpan.org/authors/id/A/AN/ANDK/CPAN-%{V_cpan}.tar.gz
Source13:     http://www.cpan.org/modules/by-module/CPAN/CPAN-WAIT-%{V_cpan_wait}.tar.gz
Source14:     http://www.cpan.org/authors/id/J/JP/JPEACOCK/version-%{V_version}.tar.gz
Source15:     http://www.cpan.org/authors/id/G/GR/GRICHTER/ExtUtils-XSBuilder-%{V_extutils_xsbuilder}.tar.gz
Source16:     http://www.cpan.org/authors/id/A/AD/ADAMK/File-ShareDir-%{V_file_sharedir}.tar.gz
Source17:     http://www.cpan.org/authors/id/E/ET/ETHER/File-ShareDir-Install-%{V_file_sharedir_install}.tar.gz
Source18:     http://www.cpan.org/authors/id/L/LE/LEONT/ExtUtils-Config-%{V_extutils_config}.tar.gz
Source19:     http://www.cpan.org/authors/id/L/LE/LEONT/ExtUtils-Helpers-%{V_extutils_helpers}.tar.gz
Source20:     http://www.cpan.org/authors/id/L/LE/LEONT/ExtUtils-InstallPaths-%{V_extutils_installpaths}.tar.gz
Source21:     http://www.cpan.org/authors/id/L/LE/LEONT/Module-Build-Tiny-%{V_module_build_tiny}.tar.gz
Source22:     http://www.cpan.org/authors/id/B/BI/BINGOS/Module-Install-%{V_module_install}.tar.gz
Source23:     http://www.cpan.org/authors/id/M/MA/MATTN/Devel-CheckLib-%{V_devel_checklib}.tar.gz
Patch0:       perl-module.patch

#   build information
BuildPreReq:  OpenPKG, openpkg >= 20160101, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20051031
PreReq:       OpenPKG, openpkg >= 20160101, perl >= %{V_perl}

%description
    Perl modules for use with networks:
    - ExtUtils::Depends (%{V_extutils_depends})
    - ExtUtils::PkgConfig (%{V_extutils_pkgconfig})
    - ExtUtils::ModuleMaker (%{V_extutils_modulemaker})
    - ExtUtils::MakeMaker (%{V_extutils_makemaker})
    - ExtUtils::XSBuilder (%{V_extutils_xsbuilder})
    - ExtUtils::Config (%{V_extutils_config})
    - ExtUtils::Helpers (%{V_extutils_helpers})
    - ExtUtils::InstallPaths (%{V_extutils_installpaths})
    - Module::ScanDeps (%{V_module_scandeps})
    - Module::Build (%{V_module_build})
    - Module::Build::Tiny (%{V_module_build_tiny})
    - Module::CoreList (%{V_module_corelist})
    - Module::Info (%{V_module_info})
    - Module::Locate (%{V_module_locate})
    - Module::Pluggable (%{V_module_pluggable})
    - Module::Pluggable::Ordered (%{V_module_pluggable_ordered})
    - Module::Install (%{V_module_install})
    - Class::Inspector (%{V_class_inspector})
    - File::ShareDir (%{V_file_sharedir})
    - File::ShareDir::Install (%{V_file_sharedir_install})
    - CPAN (%{V_cpan})
    - CPAN::WAIT (%{V_cpan_wait})
    - version (%{V_version})
    - Devel::CheckLib (%{V_devel_checklib})

%track
    prog perl-module:ExtUtils-Depends = {
        version   = %{V_extutils_depends}
        url       = http://www.cpan.org/authors/id/F/FL/FLORA/
        regex     = ExtUtils-Depends-(__VER__)\.tar\.gz
    }
    prog perl-module:ExtUtils-PkgConfig = {
        version   = %{V_extutils_pkgconfig}
        url       = http://www.cpan.org/authors/id/X/XA/XAOC/
        regex     = ExtUtils-PkgConfig-(__VER__)\.tar\.gz
    }
    prog perl-module:ExtUtils-ModuleMaker = {
        version   = %{V_extutils_modulemaker}
        url       = http://www.cpan.org/authors/id/J/JK/JKEENAN/
        regex     = ExtUtils-ModuleMaker-(\d+\.\d\d)\.tar\.gz
    }
    prog perl-module:ExtUtils-MakeMaker = {
        version   = %{V_extutils_makemaker}
        url       = http://www.cpan.org/authors/id/B/BI/BINGOS/
        regex     = ExtUtils-MakeMaker-(\d+\.\d\d)\.tar\.gz
    }
    prog perl-module:ExtUtils-XSBuilder = {
        version   = %{V_extutils_xsbuilder}
        url       = http://www.cpan.org/authors/id/G/GR/GRICHTER/
        regex     = ExtUtils-XSBuilder-(__VER__)\.tar\.gz
    }
    prog perl-module:ExtUtils-Config = {
        version   = %{V_extutils_config}
        url       = http://www.cpan.org/authors/id/L/LE/LEONT/
        regex     = ExtUtils-Config-(__VER__)\.tar\.gz
    }
    prog perl-module:ExtUtils-Helpers = {
        version   = %{V_extutils_helpers}
        url       = http://www.cpan.org/authors/id/L/LE/LEONT/
        regex     = ExtUtils-Helpers-(__VER__)\.tar\.gz
    }
    prog perl-module:ExtUtils-InstallPaths = {
        version   = %{V_extutils_installpaths}
        url       = http://www.cpan.org/authors/id/L/LE/LEONT/
        regex     = ExtUtils-InstallPaths-(__VER__)\.tar\.gz
    }
    prog perl-module:Module-ScanDeps = {
        version   = %{V_module_scandeps}
        url       = http://www.cpan.org/authors/id/R/RS/RSCHUPP/
        regex     = Module-ScanDeps-(__VER__)\.tar\.gz
    }
    prog perl-module:Module-Build = {
        version   = %{V_module_build}
        url       = http://www.cpan.org/authors/id/L/LE/LEONT/
        regex     = Module-Build-(__VER__)\.tar\.gz
    }
    prog perl-module:Module-Build-Tiny = {
        version   = %{V_module_build}
        url       = http://www.cpan.org/authors/id/L/LE/LEONT/
        regex     = Module-Build-Tiny-(__VER__)\.tar\.gz
    }
    prog perl-module:Module-CoreList = {
        version   = %{V_module_corelist}
        url       = http://www.cpan.org/authors/id/B/BI/BINGOS/
        regex     = Module-CoreList-(__VER__)\.tar\.gz
    }
    prog perl-module:Module-Info = {
        version   = %{V_module_info}
        url       = http://www.cpan.org/authors/id/M/MB/MBARBON/
        regex     = Module-Info-(__VER__)\.tar\.gz
    }
    prog perl-module:Module-Locate = {
        version   = %{V_module_locate}
        url       = http://www.cpan.org/authors/id/N/NE/NEILB/
        regex     = Module-Locate-(__VER__)\.tar\.gz
    }
    prog perl-module:Module-Pluggable = {
        version   = %{V_module_pluggable}
        url       = http://www.cpan.org/authors/id/S/SI/SIMONW/
        regex     = Module-Pluggable-(__VER__)\.tar\.gz
    }
    prog perl-module:Module-Pluggable-Ordered = {
        version   = %{V_module_pluggable_ordered}
        url       = http://www.cpan.org/authors/id/A/AP/APEIRON/
        regex     = Module-Pluggable-Ordered-(__VER__)\.tar\.gz
    }
    prog perl-module:Module-Install = {
        version   = %{V_module_install}
        url       = http://www.cpan.org/authors/id/B/BI/BINGOS/
        regex     = Module-Install-(__VER__)\.tar\.gz
    }
    prog perl-module:Class-Inspector = {
        version   = %{V_class_inspector}
        url       = http://www.cpan.org/authors/id/A/AD/ADAMK/
        regex     = Class-Inspector-(__VER__)\.tar\.gz
    }
    prog perl-module:File-ShareDir = {
        version   = %{V_file_sharedir}
        url       = http://www.cpan.org/authors/id/A/AD/ADAMK/
        regex     = File-ShareDir-(__VER__)\.tar\.gz
    }
    prog perl-module:File-ShareDir-Install = {
        version   = %{V_file_sharedir_install}
        url       = https://www.cpan.org/authors/id/E/ET/ETHER/
        regex     = File-ShareDir-Install-(__VER__)\.tar\.gz
    }
    prog perl-module:CPAN = {
        version   = %{V_cpan}
        url       = http://www.cpan.org/authors/id/A/AN/ANDK/
        regex     = CPAN-(__VER__)\.tar\.gz
    }
    prog perl-module:CPAN-WAIT = {
        version   = %{V_cpan_wait}
        url       = http://www.cpan.org/modules/by-module/CPAN/
        regex     = CPAN-WAIT-(__VER__)\.tar\.gz
    }
    prog perl-module:version = {
        version   = %{V_version}
        url       = http://www.cpan.org/authors/id/J/JP/JPEACOCK/
        regex     = version-(__VER__)\.tar\.gz
    }
    prog perl-module:Devel-CheckLib = {
        version   = %{V_devel_checklib}
        url       = http://www.cpan.org/authors/id/M/MA/MATTN/
        regex     = Devel-CheckLib-(__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
    %setup -q -T -D -a 15
    %setup -q -T -D -a 16
    %setup -q -T -D -a 17
    %setup -q -T -D -a 18
    %setup -q -T -D -a 19
    %setup -q -T -D -a 20
    %setup -q -T -D -a 21
    %setup -q -T -D -a 22
    %setup -q -T -D -a 23
    %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 -d %{SOURCE15} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE16} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE17} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE18} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE19} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE20} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE21} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE22} configure build install
    %{l_prefix}/bin/perl-openpkg -d %{SOURCE23} configure build install
    %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
    rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/{cpan,instmodsh}
    mv  $RPM_BUILD_ROOT%{l_prefix}/bin/scandeps.pl \
        $RPM_BUILD_ROOT%{l_prefix}/bin/scandeps
    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`

%files -f files

%clean

