37576b7
Name:           parrot
5576dba
Version:        1.4.0
621137f
Release:        8%{?dist}
37576b7
Summary:        Parrot is a virtual machine
37576b7
License:        Artistic 2.0
37576b7
Group:          Development/Libraries
37576b7
URL:            http://www.parrot.org/
37576b7
ed89438
Source0:        ftp://ftp.parrot.org/pub/parrot/releases/stable/%{version}/parrot-%{version}.tar.gz
5576dba
5576dba
Patch0:         parrot-1.x.0.patch
ed89438
# patches file:           tools/dev/install_files.pl
ed89438
# It is responsible to have no subdirectory under pkgconfig.
ed89438
#
ed89438
# patches file:           config/gen/makefiles/parrot_pc.in
ed89438
# So "pkg-config parrot --cflags" works correct
5576dba
#
5576dba
# see for upstream:       https://trac.parrot.org/parrot/ticket/509
5576dba
# patched file:           lib/Parrot/Install.pm
5576dba
# is to have the symlink:    libparrot.so  ->  libparrot.so.%{version}
5576dba
# Without this %{_libdir}/libparrot.so would not be a symbolic link to
37576b7
# %{_libdir}/libparrot.so.%{version}  
37576b7
37576b7
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
37576b7
BuildRequires:  readline-devel
37576b7
BuildRequires:  ncurses-devel
37576b7
BuildRequires:  gmp-devel
37576b7
BuildRequires:  gdbm-devel
37576b7
BuildRequires:  libicu-devel
37576b7
BuildRequires:  perl(Test::Harness)
37576b7
BuildRequires:  perl(Test::Simple)
37576b7
BuildRequires:  ctags
37576b7
BuildRequires:  openssl-devel
5576dba
BuildRequires:  flex
37576b7
 
37576b7
37576b7
%package docs
37576b7
Summary:        Parrot Virtual Machine documentation
37576b7
Group:          Documentation
37576b7
Requires:       perl(strict)
37576b7
Requires:       perl(warnings)
5576dba
BuildArch:      noarch
5576dba
5576dba
#--
37576b7
37576b7
%package devel
37576b7
Summary:        Parrot Virtual Machine development headers and libraries
37576b7
Group:          Development/Libraries
37576b7
Requires:       %{name} = %{version}-%{release}
37576b7
Requires:       pkgconfig
37576b7
5576dba
#--
5576dba
37576b7
%package tools
37576b7
Summary:        Parrot Virtual Machine development for languages
37576b7
Group:          Development/Libraries
37576b7
Requires:       %{name} = %{version}-%{release}
37576b7
Requires:       perl(Pod::Simple)
37576b7
Requires:       perl(File::Which) >= 0.05
2697c56
Requires:       perl(Parrot::OpLib::core)
37576b7
# It is necessary to have installed the package "perl-Perl-Critic" to install
37576b7
# the parrot-tools
37576b7
Provides:       perl(Parrot::Pmc2c::MethodEmitter) = %{version}
37576b7
Provides:       perl(Parrot::Pmc2c::PCCMETHOD_BITS) = %{version}
37576b7
Provides:       perl(Parrot::Pmc2c::PMCEmitter) = %{version}
2697c56
Provides:       perl(Parrot::OpLib::core) = %{version}
37576b7
5576dba
37576b7
%description
37576b7
Parrot is a virtual machine designed to efficiently compile and execute
37576b7
bytecode for dynamic languages. Parrot is the target for Rakudo Perl 6,
37576b7
as well as variety of other languages.
37576b7
5576dba
#--
5576dba
37576b7
%description docs
37576b7
Documentation in text-, POD- and HTML-format (docs/html-subdirectory) and also
37576b7
examples about the Parrot Virtual Machine.
37576b7
5576dba
#--
5576dba
37576b7
%description devel
37576b7
Parrot Virtual Machine development headers and libraries.
37576b7
5576dba
#--
5576dba
37576b7
%description tools
37576b7
Parrot Virtual Machine development files for building languages.
37576b7
5576dba
37576b7
%prep
37576b7
%setup -q
37576b7
%patch0 -p0
37576b7
ed89438
%{__perl} -pi -e "s,'/usr/lib','%{_libdir}'," tools/dev/install_files.pl
37576b7
37576b7
37576b7
cat << \EOF > %{name}-prov
37576b7
#!/bin/sh
ed89438
%{__perl_provides} $* | %{__sed} -e '/perl(A)/d' -e '/perl(B)/d' \
621137f
                            -e '/perl(DB)/d' -e '/perl(Parrot::OpLib::core)/d'
37576b7
EOF
37576b7
37576b7
%global __perl_provides %{_builddir}/%{name}-%{version}/%{name}-prov
37576b7
chmod +x %{__perl_provides}
37576b7
37576b7
37576b7
%build
37576b7
%ifarch %{ix86} x86_64
37576b7
    RPM_OPT_FLAGS="$RPM_OPT_FLAGS -maccumulate-outgoing-args"
37576b7
%else
0bb74fa
# The PowerPC-architecture do not build with the '-maccumulate-outgoing-args'
0bb74fa
# option.
0bb74fa
    RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
37576b7
%endif
37576b7
37576b7
%{__perl} Configure.pl \
37576b7
    --prefix=%{_usr} \
37576b7
    --libdir=%{_libdir} \
37576b7
    --sysconfdir=%{_sysconfdir} \
37576b7
    --infodir=%{_datadir}/info \
37576b7
    --mandir=%{_mandir} \
37576b7
    --cc="%{__cc}" \
37576b7
    --cxx=%{__cxx} \
37576b7
    --optimize="$RPM_OPT_FLAGS" \
37576b7
    --parrot_is_shared \
5576dba
    --disable-rpath \
37576b7
    --lex=%{_bindir}/flex \
37576b7
    --yacc=%{_bindir}/yacc \
37576b7
    --libs='-lcurses -lm'
37576b7
37576b7
# The LDD_LIBRARY_PATH hack is needed for "miniparrot"
37576b7
# to find his parrot-library in "blib/lib" 
37576b7
export LD_LIBRARY_PATH=$( pwd )/blib/lib
37576b7
37576b7
# pbc_to_exe would not build if %{_smp_mflags} would used
37576b7
make
37576b7
make parrot_utils
37576b7
make installable
37576b7
make html
37576b7
37576b7
37576b7
%install
37576b7
rm -rf $RPM_BUILD_ROOT
37576b7
37576b7
# This hack is needed for "miniparrot" to find his parrot-library in "blib/lib" 
37576b7
export LD_LIBRARY_PATH=$( pwd )/blib/lib
37576b7
37576b7
# install-dev: Same as 'install' taget but also install support for development.
37576b7
make install-dev DESTDIR=$RPM_BUILD_ROOT
37576b7
37576b7
%define RPM_PAR_LIB_DIR $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/
37576b7
37576b7
37576b7
# Drop the docs so rpm can pick them up itself.
37576b7
rm -rf $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}
37576b7
37576b7
# Force permissions on doc directories.
37576b7
find docs examples -type d -exec chmod 755 {} \;
37576b7
find docs examples -type f -exec chmod 644 {} \;
37576b7
37576b7
# Force permissions on shared versioned libs so they get stripped.
37576b7
# The parrot-install-script don't set the permissions right
37576b7
# With changed permissions the dependencies will be found
37576b7
find %{RPM_PAR_LIB_DIR}dynext -type f -name '*.so' -exec chmod 755 {} \;
37576b7
37576b7
# Remove module that should be install instead (perl(File::Which))
37576b7
rm -rf %{RPM_PAR_LIB_DIR}tools/lib/File
37576b7
37576b7
37576b7
# Added to reduce output errors when using rpmlint
37576b7
37576b7
# Force permission on perl-scripts in the "tools" subdirctory
37576b7
find %{RPM_PAR_LIB_DIR}tools -type f -name "*.pl" -exec chmod 755 {} \; \
37576b7
    -exec %{__sed} -i -e '1 s&#! perl&#!/usr/bin/perl&' {} \;
37576b7
# Set path to parrot binary and Force permission
37576b7
find %{RPM_PAR_LIB_DIR}tools/dev -type f -name "pbc_to_exe.pir" \
37576b7
    -exec %{__sed} -i -e '1 s&#! parrot&#!/usr/bin/parrot&' {} \; \
37576b7
    -exec chmod 755 {} \;
37576b7
37576b7
# Remove doc-files with zero-length
37576b7
find docs/html -type f -size 0 -exec rm -f {} \;
37576b7
37576b7
# Set path for installed programs in docs package
5576dba
find examples/json -type f -name "*.pir" \
5576dba
    -exec %{__sed} -i -e '1 s&#!../../parrot&#!/usr/bin/parrot&' {} \;
37576b7
find examples -type f -name "*.pl" \
37576b7
    -exec %{__sed} -i -e '1 s&#! perl&#!/usr/bin/perl&' {} \;
37576b7
find examples -wholename 'examples/pir/befunge/t/basic.t' \
37576b7
    -exec %{__sed} -i -e '1 s&#! perl&#!/usr/bin/perl&' {} \;
37576b7
find examples -type f -name "*.py" \
37576b7
    -exec %{__sed} -i -e '1 s&#! python&#!/usr/bin/python&' {} \;
37576b7
find examples -type f -name "*.rb" \
37576b7
    -exec %{__sed} -i -e '1 s&#! ruby&#!/usr/bin/ruby&' {} \;
37576b7
37576b7
find examples -type f -name "*.pir" \
37576b7
    -exec %{__sed} -i -e '1 s&#!./parrot&#!/usr/bin/parrot&' {} \;
37576b7
find examples/shootout -type f -name "random.pasm" \
37576b7
    -exec %{__sed} -i -e '1 s&#!./parrot&#!/usr/bin/parrot&' {} \;
37576b7
37576b7
find examples -wholename 'examples/languages/abc/t/01-tests.t' \
37576b7
    -exec %{__sed} -i -e '1 s&#!perl&#!/usr/bin/perl&' {} \;
37576b7
find examples -wholename 'examples/shootout/revcomp.pir' \
37576b7
    -exec %{__sed} -i -e '1 s&#!parrot&#!/usr/bin/parrot&' {} \;
37576b7
37576b7
find examples -wholename 'examples/languages/abc/t/harness' \
37576b7
    -exec %{__perl} -pi -e 's/\r$//' {} \;
37576b7
37576b7
find examples/languages -type f -name harness \
37576b7
    -exec %{__sed} -i -e '1 s&#! perl&#!/usr/bin/perl&' {} \;
5576dba
for file in docs/book/draft/ch05_pge.pod docs/memory_internals.pod; do
37576b7
        %{__mv} $file timestamp
37576b7
        iconv -f ISO-8859-1 -t UTF-8 -o $file timestamp
37576b7
        touch -r timestamp $file
37576b7
done
37576b7
%{__rm} -f timestamp
37576b7
37576b7
37576b7
%check
37576b7
# 'make fulltest' is done by default; it take a lot of time
37576b7
export LD_LIBRARY_PATH=$( pwd )/blib/lib
37576b7
FULL='full'
a972d15
%ifnarch ppc
a972d15
%{?_without_fulltest: FULL=''}
a972d15
%{?!_without_tests: make ${FULL}test}
a972d15
%endif
37576b7
37576b7
37576b7
%clean
37576b7
rm -rf $RPM_BUILD_ROOT
37576b7
37576b7
%post -p /sbin/ldconfig
37576b7
37576b7
%postun -p /sbin/ldconfig
37576b7
37576b7
%files
37576b7
%defattr(-,root,root,-)
37576b7
%doc ChangeLog CREDITS NEWS PBC_COMPAT PLATFORMS README
37576b7
%doc RESPONSIBLE_PARTIES TODO LICENSE
ed89438
%{_bindir}/parrot
37576b7
%{_libdir}/parrot/
37576b7
%exclude %{_libdir}/parrot/%{version}/tools
37576b7
%exclude %{_libdir}/parrot/%{version}/VERSION
37576b7
%{_libdir}/libparrot.so.*
37576b7
37576b7
%files docs
37576b7
%defattr(-,root,root,-)
37576b7
%doc docs examples
37576b7
37576b7
%files devel
37576b7
%defattr(-,root,root,-)
37576b7
%{_bindir}/parrot_config
37576b7
%{_bindir}/parrot_debugger
37576b7
%{_bindir}/pbc_disassemble
37576b7
%{_bindir}/pbc_info
37576b7
%{_bindir}/pbc_merge
37576b7
%{_bindir}/pbc_to_exe
37576b7
%{_bindir}/pbc_dump
37576b7
%{_includedir}/parrot
37576b7
%{_libdir}/libparrot.so
37576b7
%exclude %{_libdir}/libparrot.a
37576b7
%{_libdir}/pkgconfig/*
37576b7
37576b7
%files tools
37576b7
%defattr(-,root,root,-)
37576b7
# Files for building languages
37576b7
%{_libdir}/parrot/%{version}/tools/*
37576b7
%{_libdir}/parrot/%{version}/VERSION
ed89438
%{_usr}/src/parrot/*
37576b7
37576b7
37576b7
%changelog
621137f
* Sat Aug 1 2009 Gerd Pokorra <gp@zimt.uni-siegen.de> 1.4.0-8
ed89438
- include the necessary module Parrot::Oplib::core
ed89438
- change the place of header files to /usr/include/parrrot/<version>
1b74c1c
- install the files /usr/src/parrot/*
1b74c1c
1b74c1c
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.0-4
1b74c1c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
1b74c1c
5576dba
* Tue Jul 21 2009 Gerd Pokorra <gp@zimt.uni-siegen.de> 1.4.0-1
5576dba
- add the new disable-rpath configure option
5576dba
ed89438
* Wed Mar 25 2009 Gerd Pokorra <gp@zimt.uni-siegen.de> 1.0.0-6
37576b7
- add a list of changes from Lubomir Rintel
37576b7
- add filtering Provides
37576b7
- change requires for docs-subpackage
37576b7
- enable test suite
37576b7
- change the group of the subpackage "-docs" to Documentation
37576b7
- put the main-documentation from the docs-package to the main package
37576b7
- LICENSE file added
37576b7
- change 'make install' to 'make install-dev' to also install support for development (tools)
37576b7
- add Provides-lines
37576b7
- add patch for the file "tools/dev/install_files.pl"
37576b7
- add commands to reduce output of errors when using rpmlint
37576b7
- define RPM_PAR_LIB_DIR added
37576b7
- add subpackage "tools"
37576b7
- exclude tools directory from main-package
2697c56
- added make html
37576b7
37576b7
* Sun Mar 22 2009 Fabien Georget <fabien.georget@gmail.com> 1.0.0-4
37576b7
- add tools
37576b7
37576b7
* Sun Mar 22 2009 David Fetter <david@fetter.org> 1.0.0-3
37576b7
- Removed wrong prefix from pkgconfig per Christoph Wickert
37576b7
- Changed i386 to ix86 per Christoph Wickert
37576b7
- Changed hard-coded path requirement to perl.
37576b7
37576b7
* Tue Mar 17 2009 Allison Randal <allison@parrot.org> 1.0.0
37576b7
- updated to 1.0.0
37576b7
37576b7
* Tue Jan 23 2009 Reini Urban <rurban@x-ray.at> 0.9.0
37576b7
- added make installable, perl6 is still not installable
37576b7
- added parrot_utils to devel
37576b7
- fixed Source0 url
37576b7
37576b7
* Tue Dec 16 2008 Whiteknight <wknight8111@gmail.com> 0.8.2
37576b7
- updated to 0.8.2
37576b7
37576b7
* Tue Mar 18 2008 Bernhard Schmalhofer <Bernhard.Schmalhofer@gmx.de> 0.6.0
37576b7
- Update to 0.5.3.
37576b7
37576b7
* Wed Feb 20 2008 Patrick Michaud <pmichaud@pobox.com> 0.5.3
37576b7
- Update to 0.5.3.
37576b7
37576b7
* Sat Mar 10 2007 Steven Pritchard <steve@kspei.com> 0.4.9-1
37576b7
- Update to 0.4.9.
0bb74fa
- BuildRequires ncurses-devel.
37576b7
- For some reason now I need to force -lm too.
37576b7
- Remove some files/directories that shouldn't be included.
37576b7
- Override lib_dir and make various substitutions to try to fix multilib.
37576b7
- Remove rpath use from Makefile.
37576b7
- Fix a pod error in src/ops/experimental.ops.
37576b7
- Enable "make test" since t/doc/pod.t won't fail now.
37576b7
- Force permissions on shared libraries so rpmbuild strips them.
37576b7
- Fix URL, description, summary, etc.
37576b7
- Add post/postun.
37576b7
- Move parrot-config to the devel sub-package.
37576b7
- Force permissions on the doc directories.
37576b7
- Add -lcurses to get readline detection to work.
0bb74fa
- Add BuildRequires libicu-devel.
37576b7
37576b7
* Tue Mar 18 2003 Steve Fink <sfink@foxglove.localdomain> 0.0.11
37576b7
- first .spec file created