File java-1_8_0-openjdk-openjfx.spec of Package java-1_8_0-openjdk-openjfx

#
# spec file for package java-1_8_0-openjdk-openjfx
#
# 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/
#


%global javaname java-1_8_0-openjdk
%global openjfx_version 8u141-b14
%global openjdk8_install_dir %{_jvmdir}/java-1.8.0-openjdk-1.8.0
%global priority        1805
# There is no need for a debug package (for now)
%global debug_packages %{nil}
%{!?aarch64:%global aarch64 aarch64 arm64 armv8}
%global archinstall %{_arch}
%ifarch x86_64
%global archinstall amd64
%endif
%ifarch ppc
%global archinstall ppc
%endif
%ifarch ppc64
%global archinstall ppc64
%endif
%ifarch ppc64le
%global archinstall ppc64le
%endif
%ifarch %{ix86}
%global archinstall i386
%endif
%ifarch ia64
%global archinstall ia64
%endif
%ifarch s390
%global archinstall s390
%endif
%ifarch s390x
%global archinstall s390x
%endif
%ifarch %{arm}
%global archinstall aarch32
%endif
%ifarch %{aarch64}
%global archinstall aarch64
%endif
# 32 bit sparc, optimized for v9
%ifarch sparcv9
%global archinstall sparc
%endif
# 64 bit sparc
%ifarch sparc64
%global archinstall sparcv9
%endif
Name:           %{javaname}-openjfx
Version:        8.0.141
Release:        0
Summary:        Rich client application platform for Java
License:        GPL with the class path exception
Group:          Development/Languages/Java
Url:            https://wiki.openjdk.java.net/dashboard.action
Source0:        http://hg.openjdk.java.net/openjfx/8u/rt/archive/%{openjfx_version}.tar.bz2
Patch0:         openjfx-javaversion.patch
Patch1:         openjfx-getdefaultscale.patch
Patch2:         openjfx-wait.patch
BuildRequires:  %{javaname}-devel
BuildRequires:  ant
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  gperf
BuildRequires:  gradle
BuildRequires:  javapackages-tools
BuildRequires:  pkgconfig
BuildRequires:  ruby
BuildRequires:  pkgconfig(gthread-2.0)
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(xtst)
Requires:       %{javaname}

%description
JavaFX/OpenJFX is a set of graphics and media APIs that enables Java
developers to design, create, test, debug, and deploy rich client
applications that operate consistently across diverse platforms.

The media and web module have been removed due to missing dependencies.

%package devel
Summary:        OpenJFX development tools and libraries
Requires:       %{javaname}-devel
Requires:       %{name} = %{version}-%{release}
Requires(pre):  update-alternatives

%description devel
The OpenJFX development tools and libraries.

%package src
Summary:        OpenJFX Source Bundle

%description src
The OpenJFX Source Bundle.

%package javadoc
Summary:        Javadoc for %{name}
BuildArch:      noarch

%description javadoc
This package contains javadoc for %{name}.

%prep
%setup -q -n rt-%{openjfx_version}
%patch0 -p1
%patch1 -p1
%patch2 -p1

%define gradle_properties gradle.properties
echo "COMPILE_WEBKIT = false" >> %{gradle_properties}
echo "GRADLE_VERSION_CHECK = false" >> %{gradle_properties}
echo "COMPILE_MEDIA = false" >> %{gradle_properties}
echo "BUILD_JAVADOC = true" >> %{gradle_properties}
echo "BUILD_SRC_ZIP = true" >> %{gradle_properties}
echo "GRADLE_VERSION_CHECK = false" >> %{gradle_properties}

find -name '*.class' -delete
find -name '*.jar' -delete

#Bundled libraries
rm -rf modules/media/src/main/native/gstreamer/3rd_party/glib
rm -rf modules/media/src/main/native/gstreamer/gstreamer-lite
rm -rf modules/graphics/src/main/native-iio/libjpeg*

%build
export JAVA_HOME="%{openjdk8_install_dir}/jre"
export JAVA=${JAVA_HOME}/bin/java
export JDK_HOME="%{openjdk8_install_dir}"
export JAVAC=${JDK_HOME}/bin/javac
export CXXFLAGS="%{optflags} -fPIC"
export CFLAGS="%{optflags}-fPIC"
gradle --no-daemon --quiet

%install
install -d -m 755 %{buildroot}%{openjdk8_install_dir}
cp -a build/sdk/{bin,lib} %{buildroot}%{openjdk8_install_dir}

install -d -m 755 %{buildroot}%{openjdk8_install_dir}/jre
cp -a build/sdk/rt/* %{buildroot}%{openjdk8_install_dir}/jre

install -d -m 755 %{buildroot}%{openjdk8_install_dir}/man/man1
install -m 644 build/sdk/man/man1/* %{buildroot}%{openjdk8_install_dir}/man/man1/

install -d -m 755 %{buildroot}%{openjdk8_install_dir}/man/ja_JP/man1
install -m 644 build/sdk/man/ja_JP.UTF-8/man1/* %{buildroot}%{openjdk8_install_dir}/man/ja_JP/man1

install -m 644 build/sdk/javafx-src.zip %{buildroot}%{openjdk8_install_dir}/javafx-src.zip

install -d 755 %{buildroot}%{_javadocdir}/%{name}
cp -a build/sdk/docs/api/. %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}


%post devel
ext=.gz
update-alternatives \
  --install %{_bindir}/javapackager javapackager %{openjdk8_install_dir}/bin/javapackager %{priority}

%postun devel
if [ $1 -eq 0 ]
then
  update-alternatives --remove javapackager %{openjdk8_install_dir}/bin/javapackager
fi

%files
%dir %{openjdk8_install_dir}
%{openjdk8_install_dir}/jre
%doc README

%files devel
%{openjdk8_install_dir}/lib
%{openjdk8_install_dir}/bin
%{openjdk8_install_dir}/man/man1/javafxpackager.1*
%{openjdk8_install_dir}/man/man1/javapackager.1*
%{openjdk8_install_dir}/man/ja_JP/man1/javafxpackager.1*
%{openjdk8_install_dir}/man/ja_JP/man1/javapackager.1*
%doc README

%files src
%{openjdk8_install_dir}/javafx-src.zip

%files javadoc
%{_javadocdir}/%{name}
%license LICENSE

%changelog