File sbt.spec of Package sbt
# openSUSE BUILD service build build script
# package: sbt - simple build tool for scala projects
#
%define _javadir %{_datadir}/java
Name: sbt
Summary: Simple build tool for scala projects
Version: 1.10.1
Release: 1
Group: Development/Tools/Building
License: Apache-2.0
Url: http://www.scala-sbt.org
Vendor: openSUSE
Requires: java >= 1.8.0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: https://github.com/sbt/sbt/releases/download/v%{version}/%{name}-%{version}.tgz
BuildArch: noarch
%description
Simple build tool for Scala projects that aims to do the basics well. It requires Java 1.8 or later.
Features
* Fairly fast, unintrusive, and easy to set up for simple projects
* Configuration, customization, and extension are done in Scala
* Accurate recompilation (in theory) is done using information extracted by a compiler plugin
* Continuous compilation and testing with triggered execution
* Supports mixed Scala/Java projects, packages jars, generates documentation with scaladoc
* Supports testing with ScalaCheck, specs, and ScalaTest
* Starts the Scala REPL with project classes and dependencies on the classpath
* Multiple project/subproject support
* Parallel task execution, including parallel test execution
* Dependency management support: inline declarations, external Ivy or Maven configuration files, or manual management
%prep
# nothing to do
%setup -c "%{name}"
%build
# nothing to do - just repackaging binary
%install
export NO_BRP_CHECK_BYTECODE_VERSION=true
%__install -d -m 755 %{buildroot}%{_javadir}
%__install -d -m 755 %{buildroot}%{_javadir}/%{name}
%__cp sbt/bin/sbt-launch.jar %{buildroot}%{_javadir}/%{name}/
# startscript
cat > /tmp/%{name} << EOF
#!/bin/sh
# %{name} startscript
echo "Starting %{name} version %{version} ..."
if [ -z "\$*" ]; then
java -XX:+UseG1GC -Xmx1024M -jar %{_javadir}/%{name}/%{name}-launch.jar
fi
if [ -n "\$*" ]; then
java -XX:+UseG1GC -Xmx1024M -jar %{_javadir}/%{name}/%{name}-launch.jar "\$*"
fi
EOF
%__install -d -m 755 %{buildroot}%{_bindir}
%__install -m 755 /tmp/sbt %{buildroot}%{_bindir}/
%files
%defattr(-,root,root)
%dir %{_javadir}/%{name}
%dir %{_javadir}
%{_bindir}/*
%{_javadir}/%{name}/*.jar
#%doc LICENSE README CHANGELOG
%changelog