Blob Blame History Raw
%global year 2017
%global month 08

%global __provides_exclude_from ^.*libperl6_ops_moar\\.so.*$

Name:           rakudo
Version:        0.%{year}.%{month}
Release:        3%{?dist}
Summary:        Perl 6 compiler implementation that runs on MoarVM
License:        Artistic 2.0
URL:            http://rakudo.org/

Source0:        http://rakudo.org/downloads/rakudo/rakudo-%{year}.%{month}.tar.gz
# sources for desktop files are added here
Source1:        ftp://ftp.uni-siegen.de/pub/desk/rakudo.desk.tar.gz
Source2:        macros.perl6

# general BuildRequires
BuildRequires:  perl-interpreter, make, perl-podlators, coreutils

# general perl-package BuildRequires
BuildRequires:  perl(base), perl(Cwd), perl(Exporter), perl(File::Copy)
BuildRequires:  perl(File::Spec), perl(Getopt::Long), perl(lib), perl(strict)
BuildRequires:  perl(Text::ParseWords), perl(warnings)

# gcc
BuildRequires:  gcc

# general perl-test-package BuildRequires
BuildRequires:  perl(FindBin), perl(List::Util) 

BuildRequires:  perl(ExtUtils::Command)
BuildRequires:  perl(Test::Harness)

ExcludeArch:    s390x ppc64


# BuildRequires for MoarVM
BuildRequires:  nqp >= 0.0.%{year}.%{month}
Requires:       nqp >= 0.0.%{year}.%{month}
BuildRequires:  moarvm-devel >= 0.%{year}.%{month}
# Needed for the header files, (#include <uv.h> - libuv-devel)
BuildRequires:  libuv-devel
BuildRequires:  libatomic_ops-devel
BuildRequires:  libtommath-devel
BuildRequires:  libffi-devel


# Needed for desktop-file-install usage
BuildRequires:  desktop-file-utils


%description
Rakudo Perl 6, or just Rakudo, is an implementation of the
Perl 6 language specification. More information about Perl 6 is available
from <http://perl6.org/>. This package provides a Perl 6 compiler built for
MoarVM virtual machine.


%prep
%setup -q -n rakudo-%{year}.%{month}


%build
%{__perl} Configure.pl --prefix=%{_prefix} --libdir=%{_libdir} --backends=moar
CFLAGS=$RPM_OPT_FLAGS make %{?_smp_mflags}


%install
CFLAGS=$RPM_OPT_FLAGS %make_install

# Generating man-pages
%{__perl} -MExtUtils::Command -e mkpath $RPM_BUILD_ROOT%{_mandir}/man1
pod2man --section=1 --name=perl6 docs/running.pod | %{__gzip} -c > $RPM_BUILD_ROOT%{_mandir}/man1/perl6.1.gz
pod2man --section=1 --name=perl6-m docs/running.pod | %{__gzip} -c > $RPM_BUILD_ROOT%{_mandir}/man1/perl6-m.1.gz


# install desktop files for the URLs: docs.perl6.org and perl6intro.com
%define DESK_TARGET $RPM_BUILD_ROOT%{_datadir}/applications/
%{__mkdir} -p %{DESK_TARGET}
%{__tar} xzf %{SOURCE1}

desktop-file-install --delete-original --dir=%{DESK_TARGET} \
  perl6_doc_link.desktop intro_link.desktop usr_bin_perl6.desktop \
  2015-perl6-course-pdf.desktop intro_pdf.desktop

install icon/browser_world.png -D $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/browser_world.png
install icon/pdf_doc.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/

# install script for installing perl6 modules
sed -i -e '1 s&#!.*\(perl6\)&#!/usr/bin/\1&' tools/install-dist.pl
install tools/install-dist.pl -D $RPM_BUILD_ROOT%{_libdir}/perl6/bin/mod_inst.pl

# remove zero-length files
rm -f $RPM_BUILD_ROOT/%{_libdir}/perl6/precomp/.lock
rm -f $RPM_BUILD_ROOT/%{_libdir}/perl6/repo.lock

#
# perl6 RPM macros
#
mkdir -p ${RPM_BUILD_ROOT}%{_rpmconfigdir}/macros.d
install -p -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_rpmconfigdir}/macros.d/
sed -i -e 's/HARDCODED_VERSION/%{version}/' \
       -e 's#HC_LIBDIR#%{_libdir}#g' \
   ${RPM_BUILD_ROOT}%{_rpmconfigdir}/macros.d/macros.perl6


%check
%{?!_without_tests:

%ifarch ppc64 ppc64le armv7hl
rm -f t/04-nativecall/02-simple-args.t
%endif

%ifarch armv7hl
rm -f t/04-nativecall/08-callbacks.t
%endif

%{__make} test
}


%files
%doc README.md CREDITS docs/module_management.md docs/ChangeLog
%doc from_rakudo-star/cheatsheet.txt from_rakudo-star/perl6intro.pdf
%doc from_rakudo-star/2015-spw-perl6-course.pdf
%license LICENSE

%{_bindir}/perl6*
%{_mandir}/man1/perl6.1.gz
%{_mandir}/man1/perl6-m.1.gz

# macro file
%{_rpmconfigdir}/macros.d/macros.perl6

# desktop files
%{_datadir}/applications/*.desktop

# icon files
%{_datadir}/icons/hicolor/16x16/apps/*.png

%{_libdir}/perl6
%{_libdir}/nqp/lib


%changelog
* Fri Sep 15 2017  Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.08-3
- rebuild on top of rebuilds from nqp and moarvm

* Mon Aug 28 2017  Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.08-2
- rebuild to install to _libdir again

* Tue Aug 22 2017  Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.08-1
- exclude architectures s390x ppc64
- update to 2017.08

* Mon Jun 19 2017  Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.06-2
- rebuild with changed macros.perl6 source file

* Sun Jun 18 2017  Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.06-1
- install file tools/install-dist.pl
- update to 2017.06

* Wed Jun 07 2017  Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.04.2-4
- add a rpm macro file for Perl 6

* Wed May 24 2017  Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.04.2-3
- build with new desktop file sources

* Mon May 08 2017  Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.04.2-2
- rebuild with changed moarvm build and new nqp rebuild

* Wed Mar 15 2017 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.04.2-1
- update to 2017.04.2
- build with patch to add libdir option

* Wed Mar 15 2017 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.02-1
- update to 2017.02
- initial epel7 branch upload

* Thu Mar 09 2017 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.01-5
- fix the rakudo-star version that is provided
- group tag removed
- remove zero-length files
- preventing to provides libperl6_ops_moar.so from non-standard path

* Tue Mar 07 2017 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.01-4
- install to _libdir/nqp instead of /usr/share/nqp/lib

* Wed Mar 01 2017 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.01-3
- install to _libdir/perl6 instead of /usr/share/perl6 

* Thu Feb 23 2017 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.01-2
- summary tab, description and operator in obsoletes tag is changed
- dependency on readline-devel is removed
- _prefix marcro is used
- docs/ChangeLog is packaged as documentation
- general build-requires are added

* Tue Feb 21 2017 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.2017.01-1
- initial spec file for the new review