Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 54aa6ecd14884734d69ea69cddf7d856 > files > 2

rakudo-star-0.0.2011.01_3.0.0-1.fc13.src.rpm

%global year 2011
%global month 01
%global parrot_version 3.0.0

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

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

Source0:        http://github.com/downloads/rakudo/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

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# 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}

# Needed for building blizkost
BuildRequires:  perl(ExtUtils::Embed)

# 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
%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.
Rakudo Star also includes Blizkost, which enables you to use Perl 5
modules from Perl 6.
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/build/Makefile.in

%{__make}
%{__make} blizkost


%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


# Blizkost installation
%{__mkdir} -p $RPM_BUILD_ROOT/usr/bin
%{__make} blizkost-install DESTDIR=$RPM_BUILD_ROOT
%{__rm} -f $RPM_BUILD_ROOT/usr/share/doc/parrot/%{parrot_version}/languages/perl5/README


# 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
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
%{__chmod} 755 $RPM_BUILD_ROOT%{parrot_dynext}/blizkost_group.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
export LD_LIBRARY_PATH=$( pwd )/rakudo/dynext
%{__cp} rakudo/Test.p* m_install%{parrot_lang_perl6}/lib
#
#prove -e ./perl6 -r modules/Algorithm-Viterbi/t
# Configure.p* -> modules/mainline/lib/Test/
#prove -e ./perl6 -r modules/perl6-File-Find/t
#prove -e ./perl6 -r modules/form/t
prove -e ./perl6 -r modules/json/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/Math-Model/t
prove -e ./perl6 -r modules/Math-RungeKutta/t
#prove -e ./perl6 -r modules/MiniDBI/t
#prove -e ./perl6 -r modules/svg/t
#prove -e ./perl6 -r modules/svg-plot/t
prove -e ./perl6 -r modules/perl6-Term-ANSIColor/t
prove -e ./perl6 -r modules/xml-writer/t
#prove -e ./perl6 -r modules/yaml-pm6/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}
%{_mandir}/man1/perl6.1.gz
%{_mandir}/man1/rakudo.1.gz

# Blizkost files
%{_bindir}/parrot-blizkost
%{_libdir}/parrot/%{parrot_version}/languages/perl5
%{parrot_dynext}/blizkost_group.so

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