##
##  rakudo.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.
##

#   package version
%define       V_opkg  2025.08
%define       V_dist  2025.08

#   package information
Name:         rakudo
Summary:      Raku Language Implementation
URL:          https://rakudo.org/
Vendor:       Rakudo Development Team
Packager:     OpenPKG Project
Distribution: OpenPKG Community
Class:        EVAL
Group:        Language
License:      Artistic
Version:      %{V_opkg}
Release:      20250829

#   list of sources
Source0:      https://rakudo.org/dl/rakudo/rakudo-%{V_dist}.tar.gz

#   build information
Prefix:       %{l_prefix}
BuildRoot:    %{l_buildroot}
BuildPreReq:  OpenPKG, openpkg >= 20160101, perl, bison
PreReq:       OpenPKG, openpkg >= 20160101
BuildPreReq:  moarvm >= 2023.05, nqp >= 2023.05, gmp, libffi
PreReq:       moarvm >= 2023.05, nqp >= 2023.05, gmp, libffi
AutoReq:      no
AutoReqProv:  no

%description
    Rakudo is the most mature, production-ready implementation of the
    Raku language (https://raku.org/), which in turn previously was
    considered Perl 6, based on the MoarVM virtual machine.

%track
    prog rakudo = {
        version   = %{V_dist}
        url       = https://rakudo.org/downloads/rakudo/
        regex     = rakudo-(__VER__)\.tar\.gz
    }

%prep
    %setup -q -n rakudo-%{V_dist}

%build
    %{l_prefix}/bin/perl Configure.pl \
        --prefix=%{l_prefix}
    %{l_make} %{l_mflags}

%install
    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
    rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/raku
    rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/raku-debug
    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}

%files -f files

%clean

