File jruby.spec of Package jruby-9.1.17.0_ruby2.3.3

#
# 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_ruby2.3.3
Version:        9.1.17.0_ruby2.3.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:        cacerts.pem
Source2:        jruby-kit.tar.xz
Source3:        sources.yml
BuildRequires:  maven
BuildRequires:  java-1_8_0-openjdk-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description

%prep
# Set up keystore
mkdir -p cacerts
awk '/-----BEGIN CERTIFICATE-----/,/-----END CERTIFICATE-----/{ print $0; }' %{SOURCE1} | csplit -n 3 -s -f cacerts/ - '/-----BEGIN CERTIFICATE-----/' {*}
rm cacerts/000

for PEM in $(find cacerts -type f | sort); do
  keytool -importcert -noprompt -keystore cacerts.jks -storepass changeit -file $PEM -alias $(basename $PEM)
done

%setup -q -n jruby-9.1.17.0
tar xfv %{SOURCE2}

%build
mkdir -p %{destdir}
cp %{SOURCE3} %{destdir}

mvn -P '!truffle' -Djruby.default.ruby.version=2.3.3 \
  -Dmaven.repo.local=kit/m2 \
  --settings kit/m2/settings.xml \

%install
tar czvf /home/abuild/rpmbuild/OTHER/jruby-%{version}.tgz -C %{destdir} bin/ lib/ sources.yml --owner=0 --group=0

%post
%postun

%files
%defattr(-,root,root)

%changelog

openSUSE Build Service is sponsored by