##
##  perl-apache.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_apache_authcookie        3.32
%define       V_apache_authcookiedbi     2.19
%define       V_apache_admin_config      0.94
%define       V_apache_dbi               1.12
%define       V_apache_filter            1.024
%define       V_apache_htpasswd          1.9
%define       V_apache_proxyrewrite      0.17
%define       V_apache_ssi               2.19
%define       V_apache_session           1.94
%define       V_apache_session_lazy      0.05
%define       V_apache_session_sqlite    0.21
%define       V_apache_session_sharedmem 0.6
%define       V_apache_tempfile          0.05
%define       V_apache_db                0.14

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

#   list of sources
Source0:      http://www.cpan.org/authors/id/M/MS/MSCHOUT/Apache-AuthCookie-%{V_apache_authcookie}.tar.gz
Source1:      http://www.cpan.org/authors/id/M/MA/MATISSE/Apache2-AuthCookieDBI-%{V_apache_authcookiedbi}.tar.gz
Source2:      http://www.cpan.org/authors/id/R/RS/RSOLIV/Apache-Admin-Config-%{V_apache_admin_config}.tar.gz
Source3:      http://www.cpan.org/authors/id/P/PH/PHRED/Apache-DBI-%{V_apache_dbi}.tar.gz
Source4:      http://www.cpan.org/authors/id/K/KW/KWILLIAMS/Apache-Filter-%{V_apache_filter}.tar.gz
Source5:      http://www.cpan.org/authors/id/K/KM/KMELTZ/Apache-Htpasswd-%{V_apache_htpasswd}.tar.gz
Source6:      http://www.cpan.org/authors/id/C/CG/CGILMORE/Apache-ProxyRewrite-%{V_apache_proxyrewrite}.tar.gz
Source7:      http://www.cpan.org/authors/id/K/KW/KWILLIAMS/Apache-SSI-%{V_apache_ssi}.tar.gz
Source8:      http://www.cpan.org/authors/id/C/CH/CHORNY/Apache-Session-%{V_apache_session}.tar.gz
Source9:      http://www.cpan.org/authors/id/G/GK/GKAPUR/Apache-Session-Lazy-%{V_apache_session_lazy}.tar.gz
Source10:     http://www.cpan.org/authors/id/K/KO/KOBAYASI/Apache-Session-SQLite-%{V_apache_session_sqlite}.tar.gz
Source11:     http://www.cpan.org/authors/id/S/SI/SIMONW/Apache-Session-SharedMem-%{V_apache_session_sharedmem}.tar.gz
Source12:     http://www.cpan.org/authors/id/T/TO/TOMHUGHES/Apache-TempFile-%{V_apache_tempfile}.tar.gz
Source13:     http://www.cpan.org/authors/id/F/FW/FWILES/Apache-DB-%{V_apache_db}.tar.gz
Patch0:       perl-apache.patch

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

%description
    Perl modules for general utility usage:
    - Apache::AuthCookie (%{V_apache_authcookie})
    - Apache::AuthCookieDBI (%{V_apache_authcookiedbi})
    - Apache::Admin::Config (%{V_apache_admin_config})
    - Apache::DBI (%{V_apache_dbi})
    - Apache::Filter (%{V_apache_filter})
    - Apache::Htpasswd (%{V_apache_htpasswd})
    - Apache::ProxyRewrite (%{V_apache_proxyrewrite})
    - Apache::SSI (%{V_apache_ssi})
    - Apache::Session (%{V_apache_session})
    - Apache::Session::Lazy (%{V_apache_session_lazy})
    - Apache::Session::SQLite (%{V_apache_session_sqlite})
    - Apache::Session::SharedMem (%{V_apache_session_sharedmem})
    - Apache::TempFile (%{V_apache_tempfile})
    - Apache::DB (%{V_apache_db})

%track
    prog perl-apache:Apache-Admin-Config = {
        version   = %{V_apache_admin_config}
        url       = http://www.cpan.org/authors/id/R/RS/RSOLIV/
        regex     = Apache-Admin-Config-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-AuthCookie = {
        version   = %{V_apache_authcookie}
        url       = http://www.cpan.org/authors/id/M/MS/MSCHOUT/
        regex     = Apache-AuthCookie-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-AuthCookieDBI = {
        version   = %{V_apache_authcookiedbi}
        url       = http://www.cpan.org/authors/id/M/MA/MATISSE/
        regex     = Apache2-AuthCookieDBI-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-DB = {
        version   = %{V_apache_db}
        url       = http://www.cpan.org/authors/id/F/FW/FWILES/
        regex     = Apache-DB-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-DBI = {
        version   = %{V_apache_dbi}
        url       = http://www.cpan.org/authors/id/P/PH/PHRED/
        regex     = Apache-DBI-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-Filter = {
        version   = %{V_apache_filter}
        url       = http://www.cpan.org/authors/id/K/KW/KWILLIAMS/
        regex     = Apache-Filter-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-Htpasswd = {
        version   = %{V_apache_htpasswd}
        url       = http://www.cpan.org/authors/id/K/KM/KMELTZ/
        regex     = Apache-Htpasswd-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-ProxyRewrite = {
        version   = %{V_apache_proxyrewrite}
        url       = http://www.cpan.org/authors/id/C/CG/CGILMORE/
        regex     = Apache-ProxyRewrite-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-Session = {
        version   = %{V_apache_session}
        url       = http://www.cpan.org/authors/id/C/CH/CHORNY/
        regex     = Apache-Session-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-Session-Lazy = {
        version   = %{V_apache_session_lazy}
        url       = http://www.cpan.org/authors/id/G/GK/GKAPUR/
        regex     = Apache-Session-Lazy-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-Session-SharedMem = {
        version   = %{V_apache_session_sharedmem}
        url       = http://www.cpan.org/authors/id/S/SI/SIMONW/
        regex     = Apache-Session-SharedMem-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-Session-SQLite = {
        version   = %{V_apache_session_sqlite}
        url       = http://www.cpan.org/authors/id/K/KO/KOBAYASI/
        regex     = Apache-Session-SQLite-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-SSI = {
        version   = %{V_apache_ssi}
        url       = http://www.cpan.org/authors/id/K/KW/KWILLIAMS/
        regex     = Apache-SSI-(__VER__)\.tar\.gz
    }
    prog perl-apache:Apache-TempFile = {
        version   = %{V_apache_tempfile}
        url       = http://www.cpan.org/authors/id/T/TO/TOMHUGHES/
        regex     = Apache-TempFile-(__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
    %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 -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

