File jruby.spec of Package jruby-9.1.17.0
#
# spec file for package jruby
#
# Copyright (c) 2017 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 http://bugs.opensuse.org/
#
Name: jruby-9.1.17.0
Version: 9.1.17.0_ruby2.3
Release: 1
%define destdir %{_builddir}/jruby-9.1.17.0
Summary: This is the jruby binary used in buildpacks in SUSE CloudFoundry (SCF)
License: Ruby
Group: Cloud/Platform/scf
Url: http://jruby.org
Source0: https://s3.amazonaws.com/jruby.org/downloads/9.1.17.0/jruby-src-9.1.17.0.tar.gz
Source1: sources.yml
Source2: jruby-kit.tar.xz
BuildRequires: maven
BuildRequires: ca-certificates-mozilla
BuildRequires: java-1_8_0-openjdk-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# BEGIN shared macros for all dependency packages
BuildRequires: aaa_stack_build_requires
%if 0%{?suse_version} == 1315
%if 0%{?is_opensuse}
%define stack opensuse42
%else
%define stack sle12
%endif
%else
%define stack sle15
%endif
%define otherdir %{_topdir}/OTHER
%define prefix_path /app/vendor/%{name}
%define destdir /tmp/%{name}
%define dependencydir %{destdir}%{prefix_path}
# END shared macros
%description
%prep
%setup -q -n %{name}
tar xf %{SOURCE2}
%build
mkdir -p %{destdir}
cp %{SOURCE1} ./
mvn -P '!truffle' -Djruby.default.ruby.version=2.3 \
-Dmaven.repo.local=kit/m2 \
--settings kit/m2/settings.xml \
%install
TARBALL=%{otherdir}/jruby-%{version}.tgz
# The upstream binary-builder is using `cp -r` which has the same effect
# as the --hard-dereference flag here.
# (https://github.com/cloudfoundry/binary-builder/blob/master/lib/archive_recipe.rb#L20)
tar czvf ${TARBALL} --hard-dereference bin/ lib/ sources.yml --owner=0 --group=0
CHECKSUM=`sha256sum ${TARBALL}`
NEW_TARBALL=%{otherdir}/jruby-%{version}-linux-x64-%{stack}-${CHECKSUM:0:8}.tgz
mv ${TARBALL} ${NEW_TARBALL}
pushd $(dirname ${NEW_TARBALL})
sha256sum $(basename ${NEW_TARBALL}) > ${NEW_TARBALL}.sha256
popd
%post
%postun
%files
%defattr(-,root,root)
%changelog