b45dbae
Name:           scala
c95eb99
Version:        2.7.7
582ff34
%define fullversion %{version}.final
099dbe4
Release:        1%{?dist}
b45dbae
Summary:        A hybrid functional/object-oriented language for the JVM
b45dbae
BuildArch:      noarch
b45dbae
Group:          Development/Languages
b45dbae
# License was confirmed to be standard BSD by fedora-legal
b45dbae
# https://www.redhat.com/archives/fedora-legal-list/2007-December/msg00012.html
b45dbae
License:        BSD
b45dbae
URL:            http://www.scala-lang.org/
b45dbae
b45dbae
# Source
b45dbae
Source0:        http://www.scala-lang.org/downloads/distrib/files/scala-%{fullversion}-sources.tgz
b45dbae
c95eb99
%define msilversion 2.7.5.final
b45dbae
# Exported from upstream vcs
099dbe4
#   svn export http://lampsvn.epfl.ch/svn-repos/scala/msil/tags/R_2_7_5_final msil-2.7.5.final
099dbe4
#   tar cjf msil-2.7.5.final.tar.bz2 msil-2.7.5.final
b45dbae
Source1:      msil-%{msilversion}.tar.bz2
b45dbae
90bcc1c
%define fjbgversion r17392
b45dbae
# Exported from upstream vcs
90bcc1c
# No tag for 2.7.4
90bcc1c
#   svn export -r 17392 http://lampsvn.epfl.ch/svn-repos/scala/fjbg/trunk fjbg-r17392
90bcc1c
#   tar cjf fjbg-r17392.tar.bz2 fjbg-r17392
b45dbae
Source2:        fjbg-%{fjbgversion}.tar.bz2
b45dbae
b45dbae
Source21:       scala.keys
b45dbae
Source22:       scala.mime
b45dbae
Source23:       scala-mime-info.xml
b45dbae
Source24:       scala.ant.d
b45dbae
04175ee
Patch0:         scala-buildfile.patch
9975819
Patch1:         scala-tooltemplate.patch
b45dbae
b45dbae
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
b45dbae
b45dbae
%if 0%{fedora} == 8
b45dbae
%define java_sdk icedtea
b45dbae
%else
b45dbae
%define java_sdk openjdk
b45dbae
%endif
b45dbae
b45dbae
# Force build with openjdk/icedtea because gij is horribly slow and I haven't
b45dbae
# been successful at integrating aot compilation with the build process
b45dbae
BuildRequires:  java-devel-%{java_sdk}
b45dbae
BuildRequires:  ant
b45dbae
BuildRequires:  ant-contrib
b45dbae
BuildRequires:  ant-nodeps
b45dbae
BuildRequires:  jline
b45dbae
BuildRequires:  jpackage-utils, java-devel
b45dbae
Requires:       java
b45dbae
Requires:       jline
b45dbae
Requires:       jpackage-utils
b45dbae
b45dbae
%description
b45dbae
Scala is a general purpose programming language designed to express common
b45dbae
programming patterns in a concise, elegant, and type-safe way. It smoothly
b45dbae
integrates features of object-oriented and functional languages. It is also
b45dbae
fully interoperable with Java.
b45dbae
b45dbae
%package apidoc
b45dbae
Summary:        Documentation for the Scala programming language
b45dbae
Group:          Documentation
b45dbae
b45dbae
%description apidoc
b45dbae
Scala is a general purpose programming language for the JVM that blends
b45dbae
object-oriented and functional programming. This package provides
b45dbae
reference and API documentation for the Scala programming language.
b45dbae
b45dbae
%package -n ant-scala
b45dbae
Summary:        Development files for Scala
b45dbae
Group:          Development/Languages
b45dbae
Requires:       scala = %{version}-%{release}, ant
b45dbae
b45dbae
%description -n ant-scala
b45dbae
Scala is a general purpose programming language for the JVM that blends
b45dbae
object-oriented and functional programming. This package enables support for
b45dbae
the scala ant tasks.
b45dbae
b45dbae
%package examples
b45dbae
Summary:        Examples for the Scala programming language
b45dbae
Group:          Development/Languages
b45dbae
# Otherwise it will pick up some perl module
b45dbae
Autoprov:       0
b45dbae
Requires:       scala = %{version}-%{release}
b45dbae
b45dbae
%description examples
b45dbae
Scala is a general purpose programming language for the JVM that blends
b45dbae
object-oriented and functional programming. This package contains examples for
b45dbae
the Scala programming language
b45dbae
b45dbae
%define scaladir %{_datadir}/scala
b45dbae
b45dbae
%prep
04175ee
%setup -q -a 1 -a 2 -n scala-%{fullversion}-sources
04175ee
%patch0 -b .build
9975819
%patch1 -b .tooltemplate
b45dbae
# remove all jar files except scala-library and scala-compiler needed
b45dbae
# for bootstrap
b45dbae
find . -not \( -name 'scala-library.jar' -or -name 'scala-compiler.jar' \) -and -name '*.jar' | xargs rm -f
b45dbae
find . -name '*.dll' -or -name '*.so' -or -name '*.exe' | xargs rm -f
b45dbae
ln -s `find-jar ant-contrib` lib/ant/ant-contrib.jar
b45dbae
b45dbae
%build
b45dbae
# Scala is written in itself and therefore requires boot-strapping from an
b45dbae
# initial binary build. The dist target of the ant build is a staged build
b45dbae
# that makes sure that the package bootstraps properly. The bundled binary
b45dbae
# compiler is used to compile the source code. That binary is used to 
b45dbae
# compile the source code again. That binary is used to compile the code
b45dbae
# again and the output is checked that it is exactly the same.  This makes
b45dbae
# sure that the build is repeatable and that the bootstrap compiler could
b45dbae
# be replaced with this one and successfully build the whole distribution
b45dbae
# again
b45dbae
b45dbae
# Force build with openjdk/icedtea because gij is horribly slow and I haven't
b45dbae
# been successful at integrating aot compilation with the build process
b45dbae
%define java_home %{_jvmdir}/java-%{java_sdk}
b45dbae
b45dbae
%define scala_ant %ant -Dsvn.out="" -Dant.jar="`find-jar ant`" -Dant-contrib.jar="`find-jar ant-contrib`" -Djline.jar="`find-jar jline`" -Dversion.number="%{fullversion}"
b45dbae
b45dbae
# Build FJBG
b45dbae
export ANT_OPTS=-Xmx1024M
b45dbae
(cd fjbg-%{fjbgversion}; %ant -Djar-file=fjbg.jar jar) || exit 1
b45dbae
cp fjbg-%{fjbgversion}/fjbg.jar lib/fjbg.jar
b45dbae
b45dbae
# Build msil with bootstrap compiler
b45dbae
(cd msil-%{msilversion}; make SCALAC="java -Xbootclasspath/a:../lib/scala-library.jar -cp ../lib/scala-library.jar:../lib/scala-compiler.jar:../lib/fjbg.jar scala.tools.nsc.Main" jar) || exit 1
b45dbae
cp msil-%{msilversion}/lib/msil.jar lib/msil.jar
b45dbae
b45dbae
# Build scala binaries
b45dbae
%scala_ant pack.comp || exit 1
b45dbae
b45dbae
# Rebuild msil with freshly compiled scala
b45dbae
(cd msil-%{msilversion}; make SCALAC="java -Xbootclasspath/a:../build/pack/lib/scala-library.jar -cp ../build/pack/lib/scala-library.jar:../build/pack/lib/scala-compiler.jar scala.tools.nsc.Main" clean jar) || exit 1
b45dbae
cp msil-%{msilversion}/lib/msil.jar lib/msil.jar
b45dbae
b45dbae
# Rebuild scala with freshly compiled msil
b45dbae
%scala_ant clean fastdist || exit 1
b45dbae
b45dbae
b45dbae
%install
b45dbae
rm -rf $RPM_BUILD_ROOT
b45dbae
b45dbae
function relativepath {
b45dbae
  UPDIRS=""
b45dbae
  PATHA="$1"
b45dbae
  PATHB="$2"
b45dbae
  while [ "$PATHA" == "${PATHA#$PATHB}" ] ; do
b45dbae
    UPDIRS="../$UPDIRS"
b45dbae
    PATHB="`dirname "$PATHB"`"
b45dbae
  done
b45dbae
  echo $UPDIRS${PATHA#$PATHB/}
b45dbae
}
b45dbae
b45dbae
install -d $RPM_BUILD_ROOT%{_mandir}/man1 $RPM_BUILD_ROOT%{_bindir}
b45dbae
for prog in scaladoc fsc scala scalac; do
b45dbae
        install -p -m 755 dists/scala-%{fullversion}/bin/$prog $RPM_BUILD_ROOT%{_bindir}
b45dbae
        install -p -m 644 dists/scala-%{fullversion}/man/man1/$prog.1 $RPM_BUILD_ROOT%{_mandir}/man1
b45dbae
done
b45dbae
b45dbae
install -p -m 755 -d $RPM_BUILD_ROOT%{_javadir}/scala
b45dbae
install -p -m 755 -d $RPM_BUILD_ROOT%{scaladir}/lib
b45dbae
for libname in library compiler dbc partest swing; do
b45dbae
        install -m 644 dists/scala-%{fullversion}/lib/scala-$libname.jar $RPM_BUILD_ROOT%{_javadir}/scala/scala-$libname-%{fullversion}.jar
b45dbae
        ln -s scala-$libname-%{fullversion}.jar $RPM_BUILD_ROOT%{_javadir}/scala/scala-$libname.jar
b45dbae
        ln -s `relativepath %{_javadir}/scala/scala-$libname.jar %{scaladir}/lib` $RPM_BUILD_ROOT%{scaladir}/lib
b45dbae
done
7721e49
jline_jar=`find-jar jline`
7721e49
ln -s `relativepath $jline_jar %{scaladir}/lib` $RPM_BUILD_ROOT%{scaladir}/lib
b45dbae
b45dbae
install -d $RPM_BUILD_ROOT%{_sysconfdir}/ant.d
b45dbae
install -p -m 644 %{SOURCE24} $RPM_BUILD_ROOT%{_sysconfdir}/ant.d/scala
b45dbae
b45dbae
cp -pr dists/scala-%{fullversion}/doc/scala-devel-docs/examples $RPM_BUILD_ROOT%{_datadir}/scala/
b45dbae
b45dbae
install -d $RPM_BUILD_ROOT%{_datadir}/mime-info
b45dbae
install -p -m 644 %{SOURCE21} %{SOURCE22} $RPM_BUILD_ROOT%{_datadir}/mime-info/
b45dbae
b45dbae
install -d $RPM_BUILD_ROOT%{_datadir}/mime/packages/
b45dbae
install -p -m 644 %{SOURCE23} $RPM_BUILD_ROOT%{_datadir}/mime/packages/
b45dbae
f205252
sed -i -e 's,@JAVADIR@,%{_javadir},g' -e 's,@DATADIR@,%{_datadir},g' $RPM_BUILD_ROOT%{_bindir}/*
9975819
b45dbae
%post
b45dbae
update-mime-database %{_datadir}/mime &> /dev/null || :
b45dbae
b45dbae
%postun
b45dbae
update-mime-database %{_datadir}/mime &> /dev/null || :
b45dbae
b45dbae
%clean
b45dbae
rm -rf $RPM_BUILD_ROOT
b45dbae
b45dbae
%files
b45dbae
%defattr(-,root,root,-)
b45dbae
%{_bindir}/*
b45dbae
%{_javadir}/scala
b45dbae
%dir %{_datadir}/scala
b45dbae
%{_datadir}/scala/lib
b45dbae
%{_mandir}/man1/*
90bcc1c
%doc dists/scala-%{fullversion}/doc/LICENSE
90bcc1c
%doc dists/scala-%{fullversion}/doc/README
b45dbae
%{_datadir}/mime-info/*
b45dbae
%{_datadir}/mime/packages/*
b45dbae
b45dbae
%files -n ant-scala
b45dbae
%defattr(-,root,root,-)
b45dbae
# Following is plain config because the ant task classpath could change from
b45dbae
# release to release
b45dbae
%config %{_sysconfdir}/ant.d/*
b45dbae
b45dbae
%files apidoc
b45dbae
%defattr(-,root,root,-)
b45dbae
%doc dists/scala-%{fullversion}/doc/scala-devel-docs/api
90bcc1c
%doc dists/scala-%{fullversion}/doc/LICENSE
b45dbae
b45dbae
%files examples
b45dbae
%defattr(-,root,root,-)
b45dbae
%{_datadir}/scala/examples
b45dbae
b45dbae
%changelog
c95eb99
* Thu Oct 29 2009 Geoff Reedy <geoff@programmer-monk.net> - 2.7.7-1
c95eb99
- Update to upstream 2.7.7 release
c95eb99
099dbe4
* Sat Sep 19 2009 Geoff Reedy <geoff@programmer-monk.net> - 2.7.5-1
099dbe4
- Update to upstream 2.7.5 release
099dbe4
0d43cd6
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.4-6
0d43cd6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
0d43cd6
66f4000
* Mon May 18 2009 Geoff Reedy <geoff@programmer-monk.net> - 2.7.4-5
66f4000
- fix problem in tooltemplate patch
66f4000
7721e49
* Mon May 18 2009 Geoff Reedy <geoff@programmer-monk.net> - 2.7.4-4
7721e49
- make jline implicitly available to match upstream behavior
7721e49
f205252
* Mon May 18 2009 Geoff Reedy <geoff@programmer-monk.net> - 2.7.4-3
f205252
- fix problem with substitutions to scripts in %%install
f205252
9975819
* Mon May 18 2009 Geoff Reedy <geoff@programmer-monk.net> - 2.7.4-2
9975819
- fix launcher scripts by modifying template, not overriding them
9975819
9618463
* Tue May 12 2009 Geoff Reedy <geoff@programmer-monk.net> - 2.7.4-1
90bcc1c
- update to 2.7.4 final
90bcc1c
2864170
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.3-2
2864170
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
2864170
fec349d
* Wed Jan 21 2009 Geoff Reedy <geoff@programmer-monk.net> - 2.7.3-1
fec349d
- update to 2.7.3 final
fec349d
582ff34
* Sun Nov 09 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.7.2-1
582ff34
- update to 2.7.2 final
582ff34
cf44f64
* Mon Nov 03 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.7.2-0.3.RC6
cf44f64
- bump release to fix upgrade path
cf44f64
e7d8a6c
* Thu Nov 01 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.7.2-0.1.RC6
e7d8a6c
- update to 2.7.2-RC6
e7d8a6c
04175ee
* Thu Oct 30 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.7.2-0.1.RC5
04175ee
- update to 2.7.2-RC5
04175ee
04175ee
* Sat Sep 06 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.7.2-0.2.RC1
b45dbae
- All code is now under BSD license
b45dbae
- Remove dll so and exe binaries in prep
b45dbae
- Add BuildRequires required by Java packaging guidelines
b45dbae
- Add missing defattr for examples and ant-scala
b45dbae
04175ee
* Wed Aug 20 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.7.2-0.1.RC1
b45dbae
- update to 2.7.2-RC1
b45dbae
b45dbae
* Wed Aug 13 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.7.1-3
b45dbae
- regenerate classpath in manifest patch to apply cleanly to 2.7.1
b45dbae
b45dbae
* Wed Aug 13 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.7.1-2
b45dbae
- no changes, accidental release bump
b45dbae
b45dbae
* Mon May 05 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.7.1-1
b45dbae
- Update to 2.7.1
b45dbae
b45dbae
* Fri May 02 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.7.0-2
b45dbae
- Use java-sdk-openjdk for non-fc8 builds
b45dbae
b45dbae
* Mon Mar 10 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.7.0-1
b45dbae
- Update to 2.7.0
b45dbae
- License now correctly indicated as BSD and LGPLv2+
b45dbae
- Include LICENSE file in apidoc subpackage
b45dbae
b45dbae
* Mon Feb 11 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.6.1-8
b45dbae
- Adhere more strongly to the emacs package guidelines
b45dbae
- Include some comments regarding the boot-strapping process
b45dbae
b45dbae
* Wed Jan 16 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.6.1-7
b45dbae
- Add dist tag to release
b45dbae
- Fix directory ownership issues in %%_datadir/scala
b45dbae
- Remove source code from -devel package
b45dbae
- Rename -devel package to ant-scala
b45dbae
- Fix packaging of gtksourceview2 language spec
b45dbae
- Preserve timestamps when installing and cping
b45dbae
- Add patch to remove Class-Path entries from jar manifests
b45dbae
- Fix line endings in enscript/README
b45dbae
 
b45dbae
* Sun Jan 13 2008 Geoff Reedy <geoff@programmer-monk.net> - 2.6.1-6
b45dbae
- Include further information about inclusion of binary distribution
b45dbae
- Unpack only those files needed from the binary distribution
b45dbae
- Include note about license approval
b45dbae
b45dbae
* Thu Dec 27 2007 Geoff Reedy <geoff@programmer-monk.net> - 2.6.1-5
b45dbae
- Add emacs(bin) BR
b45dbae
- Patch out call to subversion in build.xml
b45dbae
- Add pkgconfig to BuildRequires
b45dbae
b45dbae
* Thu Dec 27 2007 Geoff Reedy <geoff@programmer-monk.net> - 2.6.1-4
b45dbae
- Reformat emacs-scala description
b45dbae
- Expand tabs to spaces
b45dbae
- Fix -devel symlinks
b45dbae
- Better base package summary
b45dbae
b45dbae
* Wed Dec 26 2007 Geoff Reedy <geoff@programmer-monk.net> - 2.6.1-3
b45dbae
- Add ant config to devel package
b45dbae
- Require icedtea for build
b45dbae
- Move examples to %%{_datadir}/scala/examples
b45dbae
- Clean up package descriptions
b45dbae
- Add base package requirement for scala-examples and scala-devel
b45dbae
b45dbae
* Wed Dec 26 2007 Geoff Reedy <geoff@programmer-monk.net> - 2.6.1-2
b45dbae
- Fix post scripts
b45dbae
- Use spaces instead of tabs
b45dbae
b45dbae
* Wed Dec 26 2007 Geoff Reedy <geoff@programmer-monk.net> - 2.6.1-1
b45dbae
- Initial build.