# # spec file for package scala # # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "bootstrap" %bcond_without bootstrap %else %bcond_with bootstrap %endif %global fullversion %{version} %global release_repository http://nexus.scala-tools.org/content/repositories/releases %global snapshot_repository http://nexus.scala-tools.org/content/repositories/snapshots %global jansi_jar %{_javadir}/jansi/jansi.jar %global jline2_jar %{_javadir}/jline/jline.jar %global scaladir %{_datadir}/scala %global base_name scala %global want_jdk8 1 %define __requires_exclude .*org\.apache\.ant.* Version: 2.10.6 Release: 0 Summary: A hybrid functional/object-oriented language for the JVM # License was confirmed to be standard BSD by fedora-legal # https://www.redhat.com/archives/fedora-legal-list/2007-December/msg00012.html # files in forkjoin module are under CC0 # files in threadpool module are under Public Domain License: BSD AND CC0 AND SUSE-Public-Domain Group: Development/Libraries/Java URL: http://www.scala-lang.org/ # ./generate-tarball.sh Source0: %{base_name}-%{version}.tar.gz Source1: scala-library-2.10.0-bnd.properties # Bootstrap file generated by ./get-sources.sh Source2: scala-2.10.3-bootstrap.tgz # git information generated by ./get-sources.sh Source3: scala.gitinfo # we need this binary copy of the scala 2.10.4 compiler # for bootstrapping under Java 8; this can be removed if # necessary after Scala 2.10.5 is released if it uses 2.10.4 # for bootstrapping. Source4: http://www.scala-lang.org/files/archive/scala-2.10.4.tgz # Remove bundled binaries which are possibly proprietary Source5: generate-tarball.sh Source21: scala.keys Source22: scala.mime Source23: scala-mime-info.xml Source24: scala.ant.d Source31: scala-bootstript.xml # Source0: http://www.scala-lang.org/downloads/distrib/files/scala-sources-%%{fullversion}.tgz # Change the default classpath (SCALA_HOME) Patch1: scala-2.10.0-tooltemplate.patch # Use system jline2 instead of bundled jline2 Patch2: scala-2.10.3-use_system_jline.patch # change org.scala-lang jline in org.sonatype.jline jline Patch3: scala-2.10.3-compiler-pom.patch # Patch Swing module for JDK 1.7 Patch4: scala-2.10.2-java7.patch # fix incompatibilities with JLine 2.7 Patch6: scala-2.10-jline.patch # work around a known bug when running binary-compatibility tests against # non-optimized builds (we can't do optimized builds due to another bug): # http://grokbase.com/t/gg/scala-internals/1347g1jahq/2-10-x-bc-test-fails # Patch7: scala-2.10.1-bc.patch Patch8: scala-2.10.4-build_xml.patch # Stop scaladoc from trying to bundle non-existent resources that were # removed due to being in object form only, whithout sources Patch9: scala-2.10.6-scaladoc-resources.patch BuildRequires: ant BuildRequires: ant-contrib BuildRequires: ant-junit BuildRequires: aqute-bnd BuildRequires: graphviz BuildRequires: java-devel >= 1.7 BuildRequires: javapackages-local BuildRequires: jline >= 2.10 BuildRequires: junit BuildConflicts: java-devel >= 9 Requires: jansi Requires: java-headless >= 1.7 # Require full javapackages-tools since scripts use # /usr/share/java-utils/java-functions Requires: javapackages-tools Requires: jline >= 2.10 BuildArch: noarch %if %{with bootstrap} Name: %{base_name}-bootstrap Provides: %{base_name} %else Name: %{base_name} BuildRequires: %{base_name} Provides: %{base_name}-bootstrap Obsoletes: %{base_name}-bootstrap %endif %description Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages. It is also fully interoperable with Java. %package apidoc Summary: Documentation for the Scala programming language %description apidoc Scala is a general purpose programming language for the JVM that blends object-oriented and functional programming. This package provides reference and API documentation for the Scala programming language. %package swing Summary: The swing library for the scala programming languages Requires: java >= 1.7 Requires: scala = %{version}-%{release} %description swing This package contains the swing library for the scala programming languages. This library is required to develope GUI-releate applications in scala. The release provided by this package is not the original version from upstream because this version is not compatible with JDK-1.7. %package -n ant-%{name} Summary: Development files for Scala Requires: ant Requires: scala = %{version}-%{release} %description -n ant-%{name} Scala is a general purpose programming language for the JVM that blends object-oriented and functional programming. This package enables support for the scala ant tasks. %if 0 %package examples Summary: Examples for the Scala programming language Requires: ant Requires: scala = %{version}-%{release} # Otherwise it will pick up some perl module Autoprov: 0 %description examples Scala is a general purpose programming language for the JVM that blends object-oriented and functional programming. This package contains examples for the Scala programming language %package swing-examples Summary: Examples for the Scala Swing library Requires: ant Requires: scala = %{version}-%{release} %description swing-examples This package contains examples for the Swing library of the Scala language which is required to create GUI applications in the Scala programming language. %endif %prep %global _default_patch_fuzz 2 %setup -q -n %{base_name}-%{version} %patch1 -p1 -b .tool %patch2 -p1 -b .sysjline %patch3 -p1 -b .compiler-pom %patch4 -p1 -b .jdk7 %patch6 -p1 -b .rvk # %patch7 -p1 -b .bc %patch8 -p1 -b .bld %patch9 -p1 -b .scaladoc echo "starr.version=2.10.4\nstarr.use.released=0" > starr.number pushd src rm -rf jline popd sed -i '/is not supported by/d' build.xml sed -i '/exec.*pull-binary-libs.sh/d' build.xml %if %{with bootstrap} %global do_bootstrap -DdoBootstrapBuild=yes tar -xzvf %{SOURCE2} %if %{want_jdk8} tar -xzvf %{SOURCE4} --strip-components=1 scala-2.10.4/lib %endif %else %global do_bootstrap %{nil} %endif pushd lib %if %{without bootstrap} rm -rf scala-compiler.jar ln -s $(build-classpath scala/scala-compiler.jar) scala-compiler.jar rm -rf scala-library.jar ln -s $(build-classpath scala/scala-library.jar) scala-library.jar rm -rf scala-reflect.jar ln -s $(build-classpath scala/scala-reflect.jar) scala-reflect.jar %endif pushd ant rm -rf ant.jar rm -rf ant-contrib.jar ln -s $(build-classpath ant.jar) ant.jar ln -s $(build-classpath ant/ant-contrib) ant-contrib.jar popd popd cp -rf %{SOURCE31} . sed -i -e 's!@JLINE@!%{jline2_jar}!g' build.xml echo echo $(head -n 1 %{SOURCE3}) > tools/get-scala-commit-sha echo echo $(tail -n 1 %{SOURCE3}) > tools/get-scala-commit-date chmod 755 tools/get-scala-* %build export ANT_OPTS="-Xms2048m -Xmx2048m %{do_bootstrap}" ant build docs || exit 1 pushd build/pack/lib mv scala-library.jar scala-library.jar.no bnd wrap --properties %{SOURCE1} --output scala-library.jar \ --version "%{version}" scala-library.jar.no popd %check # these tests fail, but their failures appear spurious rm -f test/files/run/parserJavaIdent.scala rm -rf test/files/presentation/implicit-member rm -rf test/files/presentation/t5708 rm -rf test/files/presentation/ide-bug-1000349 rm -rf test/files/presentation/ide-bug-1000475 rm -rf test/files/presentation/callcc-interpreter rm -rf test/files/presentation/ide-bug-1000531 rm -rf test/files/presentation/visibility rm -rf test/files/presentation/ping-pong rm -f test/osgi/src/ReflectionToolboxTest.scala # fails under mock but not under rpmbuild rm -f test/files/run/t6223.scala ## Most test dependencies still aren't available in Fedora # ant test %install install -d %{buildroot}%{_bindir} for prog in scaladoc fsc scala scalac scalap; do install -p -m 755 build/pack/bin/$prog %{buildroot}%{_bindir} done install -p -m 755 -d %{buildroot}%{scaladir}/lib # Add symlinks in lib directory %{mvn_file} ':{*}:jar:' %{base_name}/@1 %{scaladir}/lib/@1 # Add compat symlinks to POMs because climbing-nemesis uses the old JPP naming convention %{mvn_file} ':{*}:pom:' %{base_name}/@1 JPP.%{base_name}-@1 %{mvn_package} :scala-swing swing # XXX: add scala-partest when it works again for libname in scala-compiler \ scala-library \ scala-reflect \ scalap \ scala-swing ; do sed -i "s|@VERSION@|%{fullversion}|" src/build/maven/$libname-pom.xml sed -i "s|@RELEASE_REPOSITORY@|%{release_repository}|" src/build/maven/$libname-pom.xml sed -i "s|@SNAPSHOT_REPOSITORY@|%{snapshot_repository}|" src/build/maven/$libname-pom.xml %{mvn_artifact} src/build/maven/$libname-pom.xml build/pack/lib/$libname.jar done ln -s $(abs2rel %{jline2_jar} %{scaladir}/lib) %{buildroot}%{scaladir}/lib ln -s $(abs2rel %{jansi_jar} %{scaladir}/lib) %{buildroot}%{scaladir}/lib %mvn_install install -d %{buildroot}%{_sysconfdir}/ant.d install -p -m 644 %{SOURCE24} %{buildroot}%{_sysconfdir}/ant.d/scala %if 0 cp -pr docs/examples %{buildroot}%{_datadir}/scala/ %endif install -d %{buildroot}%{_datadir}/mime-info install -p -m 644 %{SOURCE21} %{SOURCE22} %{buildroot}%{_datadir}/mime-info/ install -d %{buildroot}%{_datadir}/mime/packages/ install -p -m 644 %{SOURCE23} %{buildroot}%{_datadir}/mime/packages/ sed -i -e 's,@JAVADIR@,%{_javadir},g' -e 's,@DATADIR@,%{_datadir},g' %{buildroot}%{_bindir}/* install -d %{buildroot}%{_mandir}/man1 install -p -m 644 build/scaladoc/manual/man/man1/* %{buildroot}%{_mandir}/man1 %post touch --no-create %{_datadir}/mime/packages &> /dev/null || : %postun if [ $1 -eq 0 ]; then update-mime-database %{_datadir}/mime &> /dev/null || : fi %posttrans update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || : %files -f .mfiles %{_bindir}/* %dir %{_datadir}/%{base_name} %dir %{_datadir}/%{base_name}/lib %{_datadir}/%{base_name}/lib/j*.jar %{_datadir}/mime-info %{_datadir}/mime/packages/* %{_mandir}/man1/* %license docs/LICENSE %files swing -f .mfiles-swing %license docs/LICENSE %files -n ant-%{name} # Following is plain config because the ant task classpath could change from # release to release %config %{_sysconfdir}/ant.d/* %license docs/LICENSE %files apidoc %doc build/scaladoc/library/* %license docs/LICENSE %if 0 %files examples %{_datadir}/scala/examples %exclude %{_datadir}/scala/examples/swing %license docs/LICENSE %files swing-examples %{_datadir}/scala/examples/swing %license docs/LICENSE %endif %changelog