Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > 8733a9bd36d16f142089d02323a50387 > files > 2

rakudo-star-0.0.2013.05_5.2.0-1.fc18.src.rpm

%global year 2013
%global month 05
%global parrot_version 5.2.0

%define PAR_LIB_DIR %{_libdir}/parrot/%{parrot_version}
%define parrot_dynext %{PAR_LIB_DIR}/dynext
%define parrot_lang_perl6 %{PAR_LIB_DIR}/languages/perl6

Name:           rakudo-star
Version:        0.0.%{year}.%{month}_%{parrot_version}
Release:        1%{?dist}
Summary:        Rakudo, Perl6-modules and documentation
License:        Artistic 2.0
Group:          Development/Languages
URL:            http://www.rakudo.org/

Source0:        http://rakudo.org/downloads/star/rakudo-star-%{year}.%{month}.tar.gz
# sources for desktop files are added here
Source1:        http://github.com/downloads/gerd/desktop-files/rakudo.desk.in.tar.gz

# This librarys are needed while "pbc_to_exe" include them
#BuildRequires:  ncurses-devel
BuildRequires:  readline-devel
BuildRequires:  gmp-devel
BuildRequires:  libicu-devel

BuildRequires:  parrot >= %{parrot_version}
BuildRequires:  parrot-devel >= %{parrot_version}
BuildRequires:  parrot-tools >= %{parrot_version}

BuildRequires:  nqp >= 0.0.%{year}.%{month}
Requires:  nqp >= 0.0.%{year}.%{month}

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

# Replacing existing "rakudo" package
Obsoletes:      rakudo <= 0.0.2010.08_2.7.0-2
Provides:       rakudo = %{version}-%{release}


# filter out the perl5 modules requires for perl6 modules
%filter_from_requires /perl(/d; /perl6/d
%filter_setup


%description
Rakudo Perl 6, or just Rakudo, is a Perl 6 compiler for the Parrot virtual
machine. Rakudo is an implementation of the Perl 6 specification that runs
on the Parrot VM. More information about Perl 6 is available from:
http://perl6.org
Rakudo Star is a collection of things around Rakudo. It installs Perl 6 modules.
The documentation includes a PDF-document that describes the using of Perl 6.


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


%build
%{__perl} Configure.pl

# add flags like '-g' to CFLAGS
%{__sed} -i -e "/^CFLAGS/ s/$/ $RPM_OPT_FLAGS/" Makefile
%{__sed} -i -e "/^CFLAGS/ s/$/ @optimize@/" rakudo/tools/build/Makefile.in

%{__make}


%install
%{__rm} -rf $RPM_BUILD_ROOT


# Rakudo installation
%{__sed} -i -e 's&$(DESTDIR)$(DOCDIR)/rakudo&$(DESTDIR)$(DOCDIR)/rakudo-star-%{version}&' rakudo/Makefile

%{__make} rakudo-install DESTDIR=$RPM_BUILD_ROOT


# Vielleicht zuerst eingenes nqp bauen
#cd nqp-%{year}.%{month}
#perl Configure.pl
#make
#cd ..

# First install modules files to "m_install" subdirectory und then copy it
# to $RPM_BUILD_ROOT, to avoid having the $RPM_BUILD_ROOT in installed files
export PERL6LIB=$( pwd )/m_install%{parrot_lang_perl6}/lib:$( pwd )/rakudo/lib

cp -r rakudo/blib/Perl6 .
cp rakudo/*.pbc .

export LD_LIBRARY_PATH=$( pwd )/rakudo/dynext

%{__mkdir} -p m_install/usr/bin
%{__ln_s} ../../../perl6 m_install/usr/bin/perl6
%{__make} modules-install DESTDIR=$( pwd )/m_install
%{__rm} m_install/usr/bin/perl6
# move ufo
%{__mv} m_install/usr/bin m_install%{parrot_lang_perl6}

# Now copy to $RPM_BUILD_ROOT
%{__cp} -r m_install/* $RPM_BUILD_ROOT


# Force executable permission on shared objects so they get stripped
%{__chmod} 755 $RPM_BUILD_ROOT%{parrot_dynext}/perl6*.so


# install desktop files
%define DESK_TARGET $RPM_BUILD_ROOT%{_datadir}/applications/
%{__mkdir} -p %{DESK_TARGET}
# specs-URL
%{__tar} xzf %{SOURCE1} --directory=%{DESK_TARGET} perl6_specs_link.desktop
# UsingPerl6-PDF-document
%{__tar} xzf %{SOURCE1} --to-stdout rakudo_guide_pdf.desk.in | %{__sed} "s|@VERSION@|%{version}|g" > %{DESK_TARGET}rakudo_guide_pdf.desktop

desktop-file-install --delete-original --add-category="Documentation"  \
    --dir=%{DESK_TARGET} %{DESK_TARGET}perl6_specs_link.desktop
desktop-file-install --delete-original --add-category="Documentation"  \
    --dir=%{DESK_TARGET} %{DESK_TARGET}rakudo_guide_pdf.desktop


%check
%{?!_without_tests:
%{__make} rakudo-test

# testing the modules
export PERL6LIB=$( pwd )/m_install%{parrot_lang_perl6}/lib:$( pwd )/rakudo/lib
export LD_LIBRARY_PATH=$( pwd )/rakudo/dynext
#%{__cp} rakudo/Test.p* m_install%{parrot_lang_perl6}/lib
#
#prove -e ./perl6 modules/Bailador/t
#prove -e ./perl6 -r modules/DBIish/t
#prove -e ./perl6 -r modules/doc/t
prove -e ./perl6 -r modules/json/t
#prove -e ./perl6 -r modules/jsonrpc/t
prove -e ./perl6 -r modules/Math-Model/t
prove -e ./perl6 -r modules/Math-RungeKutta/t
#prove -e ./perl6 -r modules/panda/t
prove -e ./perl6 -r modules/perl6-digest-md5/t
#prove -e ./perl6 -r modules/perl6-File-Tools/t
#prove -e ./perl6 -r modules/perl6-http-easy/???
#prove -e ./perl6 -r modules/perl6-http-status/t
# this test fails with koji
#    prove -e ./perl6 -r modules/perl6-lwp-simple/t
prove -e ./perl6 -r modules/Perl6-MIME-Base64/t
prove -e ./perl6 -r modules/perl6-Term-ANSIColor/t
prove -e ./perl6 -r modules/svg/t
prove -e ./perl6 -r modules/svg-plot/t
#prove -e ./perl6 -r modules/Template-Mojo/t
prove -e ./perl6 -r modules/test-mock/t
prove -e ./perl6 -r modules/uri/t
prove -e ./perl6 -r modules/xml-writer/t
#prove -e ./perl6 -r modules/zavolaj/t
}


%clean
%{__rm} -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc LICENSE README docs/CREDITS docs/cheatsheet.txt docs/UsingPerl6-draft.pdf
%{_bindir}/perl6
%{parrot_dynext}/perl6_group.so
%{parrot_dynext}/perl6_ops.so
%{parrot_lang_perl6}
%{PAR_LIB_DIR}/languages/nqp/lib/Perl6
%{_mandir}/man1/perl6.1.gz
%{_mandir}/man1/rakudo.1.gz


# modules part
# %%{_bindir}/ufo is moved to %%{parrot_lang_perl6}/bin/ufo
# the other modules files are in %%{parrot_lang_perl6}/lib placed with
# %%{parrot_lang_perl6} above

# desktop files
%{_datadir}/applications/perl6_specs_link.desktop
%{_datadir}/applications/rakudo_guide_pdf.desktop


%changelog
* Sat Jun 01 2013 Gerd Pokorra <gp@zimt.uni-siegen.de> - 0.0.2013.05_5.2.0-1
- updated to 2013.05

* Thu Jan 31 2013 Gerd Pokorra <gp@zimt.uni-siegen.de> - 0.0.2013.01_5.0.0-1 
- updated to 2013.01
- change source to new download URL
- rebuild with new ICU
- add nqp-requires

* Wed Nov 07 2012 Gerd Pokorra <gp@zimt.uni-siegen.de> - 0.0.2012.10_4.9.0-1 
- updated to 2012.10

* Wed Sep 05 2012 Gerd Pokorra <gp@zimt.uni-siegen.de> - 0.0.2012.08_4.7.0-2
- BuildRoot tag removed
- first build on top of NQP
- extended requires filter
- updated to 2012.08

* Fri Aug 05 2011 Gerd Pokorra <gp@zimt.uni-siegen.de> - 0.0.2011.07_3.6.0-1
- updated to 2011.07

* Thu Apr 28 2011 Gerd Pokorra <gp@zimt.uni-siegen.de> - 0.0.2011.04_3.3.0-1
- updated to 2011.04

* Sat Jan 29 2011 Gerd Pokorra <gp@zimt.uni-siegen.de> - 0.0.2011.01_3.0.0-1
- updated to 2011.01

* Wed Sep 08 2010 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.0.2010.08_2.7.0-6
- changed provides/obseletes for "rakudo" package

* Wed Sep 08 2010 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.0.2010.08_2.7.0-5
- add provides/obseletes for replacing the existing "rakudo" package

* Wed Sep 08 2010 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.0.2010.08_2.7.0-4
- let rakudo read the 'optimize' value of the parrot configuration this add flags like '-g' to CFLAGS

* Fri Sep 03 2010 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.0.2010.08_2.7.0-3
- consistent use of $RPM_BUILD_ROOT

* Thu Sep 02 2010 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.0.2010.08_2.7.0-2
- changed permission of source files
- added tests for modules
- changed the place of the installed perl-script "ufo" 

* Tue Aug 31 2010 Gerd Pokorra <gp@zimt.uni-siegen.de> 0.0.2010.08_2.7.0-1
- filter out the perl5 modules requires for perl6 modules
- desktop files added
- initial .spec file