File eclipse-ptp.spec of Package eclipse-ptp

#
# spec file for package eclipse-ptp
#
# Copyright (c) 2023 SUSE LLC
#
# 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 ptp_git_tag 1158a49b8a3c4111f27360ba7dae74c3b5886c24
%ifarch s390x x86_64 aarch64 ppc64le
    %global eclipse_arch %{_arch}
%endif
# Set this to avoid dependency on unbuilt parts of tm-terminal
# during bootstrap phase
%bcond_with bootstrap
Name:           eclipse-ptp
Version:        9.3.0
Release:        0
Summary:        Eclipse Parallel Tools Platform
License:        EPL-1.0
URL:            https://www.eclipse.org/ptp
# The following tarballs were downloaded from the git repositories
Source0:        https://git.eclipse.org/c/ptp/org.eclipse.ptp.git/snapshot/org.eclipse.ptp-%{ptp_git_tag}.tar.xz
Patch0:         docs.patch
Patch1:         new-jgit.patch
Patch2:         %{name}-gcc14.patch
Patch3:         %{name}-gcc15.patch
BuildRequires:  eclipse-cdt eclipse-cdt-native
BuildRequires:  eclipse-jgit
BuildRequires:  eclipse-license
BuildRequires:  eclipse-pde
BuildRequires:  eclipse-remote
BuildRequires:  gcc
BuildRequires:  glassfish-activation
BuildRequires:  glassfish-activation-api
BuildRequires:  glassfish-jaxb-runtime
BuildRequires:  maven-antrun-plugin
BuildRequires:  maven-dependency-plugin
BuildRequires:  maven-plugin-build-helper
BuildRequires:  tycho
BuildConflicts: java-devel >= 12 java >= 12 java-headless >= 12
# Upstream Eclipse no longer supports non-64bit arches
ExcludeArch:    s390 %{arm} %{ix86}
%if %{without bootstrap}
BuildRequires:  eclipse-cdt-terminal
%endif

%description
The aim of the parallel tools platform project is to produce an open-source
industry-strength platform that provides a highly integrated environment
specifically designed for parallel application development. The project will
provide:

 - a standard, portable parallel IDE that supports a wide range of parallel
   architectures and run-time systems
 - a scalable parallel debugger
 - support for the integration of a wide range of parallel tools
 - an environment that simplifies the end-user interaction with parallel
   systems

This package contains the main PTP run-time features.

%package        master
Summary:        Complete PTP package
#master package is a virtual package that requires all of the components
Requires:       %{name} = %{version}-%{release}
Requires:       %{name}-rm-contrib = %{version}-%{release}
Requires:       %{name}-sdm = %{version}-%{release}

%description    master
The package will bring in all of the PTP components.

%package        rm-contrib
Summary:        PTP Contributed Resource Manager Definitions
BuildArch:      noarch

%description    rm-contrib
Adds resource managers for a number of different systems.

%package        sdk
Summary:        Parallel Tools Platform SDK
Requires:       %{name}-master = %{version}-%{release}
BuildArch:      noarch

%description    sdk
Eclipse Parallel Tools Platform. Software development kit including source
code and developer documentation.

%package        sdm
Summary:        PTP Scalable Debug Manager (SDM)

%description    sdm
Parallel Tools Platform components that implement a parallel debug server
using the Scalable Debug Manager (SDM).

NOTE: The sdm binary for the architecture of the host machine is available
in the sdm plugin and at %{_libdir}/ptp/sdm.  If the target system is of
a different archicture, you will need to build and install it by hand.

%prep
%setup -q -n org.eclipse.ptp-%{ptp_git_tag}

%patch -P 0 -p1
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1

# Fix target platform environments
TYCHO_ENV="<environment><os>linux</os><ws>gtk</ws><arch>%{eclipse_arch}</arch></environment>"
%pom_xpath_set "pom:configuration/pom:environments" "$TYCHO_ENV"
%pom_xpath_remove "pom:configuration/pom:target"

# This feature requires parts of CDT that we don't ship (because it cannot be
# used with any compiler shipped in Fedora)
%pom_disable_module releng/org.eclipse.ptp.pldt.upc-feature
%pom_disable_module tools/pldt/org.eclipse.ptp.pldt.upc

%pom_disable_module rdt/org.eclipse.ptp.rdt.sync.fortran.ui
%pom_disable_module releng/org.eclipse.ptp.etfw.tau-feature
%pom_disable_module releng/org.eclipse.ptp.etfw.tau.fortran-feature
%pom_disable_module releng/org.eclipse.ptp.fortran-feature
%pom_disable_module releng/org.eclipse.ptp.pldt.fortran-feature
%pom_disable_module releng/org.eclipse.ptp.rdt.sync.fortran-feature
%pom_disable_module releng/org.eclipse.ptp.rm.ibm.ll-feature
%pom_disable_module releng/org.eclipse.ptp.rm.ibm.pe-feature
%pom_disable_module releng/org.eclipse.ptp.rm.ibm.platform.lsf-feature
%pom_disable_module releng/org.eclipse.ptp.rm.slurm-feature
%pom_disable_module rms/org.eclipse.ptp.rm.ibm.ll.doc.user
%pom_disable_module rms/org.eclipse.ptp.rm.ibm.ll.ui
%pom_disable_module rms/org.eclipse.ptp.rm.ibm.pe.doc.user
%pom_disable_module rms/org.eclipse.ptp.rm.ibm.pe.ui
%pom_disable_module rms/org.eclipse.ptp.rm.ibm.platform.lsf.doc.user
%pom_disable_module rms/org.eclipse.ptp.rm.ibm.platform.lsf.ui
%pom_disable_module rms/org.eclipse.ptp.rm.slurm.help
%pom_disable_module tools/etfw/org.eclipse.ptp.etfw.tau
%pom_disable_module tools/etfw/org.eclipse.ptp.etfw.tau.papiselect
%pom_disable_module tools/etfw/org.eclipse.ptp.etfw.tau.perfdmf
%pom_disable_module tools/etfw/org.eclipse.ptp.etfw.tau.selinst
%pom_disable_module tools/etfw/org.eclipse.ptp.etfw.tau.selinstfort
%pom_disable_module tools/etfw/org.eclipse.ptp.etfw.tau.ui
%pom_disable_module tools/pldt/org.eclipse.ptp.pldt.mpi.fortran
%pom_disable_module tools/pldt/org.eclipse.ptp.pldt.openacc.fortran
%pom_disable_module tools/pldt/org.eclipse.ptp.pldt.openmp.fortran
%pom_xpath_remove "includes[@id='org.eclipse.ptp.rm.ibm.ll']" releng/org.eclipse.ptp-feature/feature.xml
%pom_xpath_remove "includes[@id='org.eclipse.ptp.rm.ibm.pe']" releng/org.eclipse.ptp-feature/feature.xml
%pom_xpath_remove "includes[@id='org.eclipse.ptp.rm.slurm']" releng/org.eclipse.ptp-feature/feature.xml
%pom_xpath_remove "includes[@id='org.eclipse.ptp.rm.ibm.platform.lsf']" releng/org.eclipse.ptp-feature/feature.xml

# % pom_disable_module core/org.eclipse.ptp.doc.isv

# Disable remote terminal feature when bootstrapping
%if %{with bootstrap}
%pom_disable_module core/org.eclipse.ptp.remote.terminal
%pom_disable_module releng/org.eclipse.ptp.remote.terminal-feature
%pom_xpath_remove "includes[@id='org.eclipse.ptp.remote.terminal']" releng/org.eclipse.ptp-feature/feature.xml
%endif

# Remove dep on ant-trax
%pom_remove_dep ant:ant-trax rms/org.eclipse.ptp.rm.lml.da.server

# No need to build repo when using xmvn
%pom_disable_module releng/org.eclipse.ptp.repo

# Remove pre-built binaries
rm -r releng/org.eclipse.ptp.linux/os/linux

# Disable bundles for non-linux platforms
%pom_disable_module releng/org.eclipse.ptp.aix
%pom_disable_module releng/org.eclipse.ptp.macosx
%pom_xpath_remove "plugin[@id='org.eclipse.ptp.aix']" releng/org.eclipse.ptp.sdm-feature/feature.xml
%pom_xpath_remove "plugin[@id='org.eclipse.ptp.macosx']" releng/org.eclipse.ptp.sdm-feature/feature.xml

%{mvn_package} "::{pom,target}::" __noinstall
%{mvn_package} "::jar:sources{,-feature}:" sdk
%{mvn_package} ":*.{sdk,core.source,doc.isv}" sdk
%{mvn_package} ":*.pldt.*fortran" pldt-fortran
%{mvn_package} ":*.etfw.tau.{fortran,selinstfort}" etfw-tau-fortran
%{mvn_package} ":*.etfw.tau*" etfw-tau
%{mvn_package} ":*.rm.jaxb.contrib" rm-contrib
%{mvn_package} ":*.ptp.{proxy,utils,debug.sdm,linux}" sdm
%{mvn_package} ":*.rdt.sync.fortran{,.ui}" rdt-sync-fortran
%{mvn_package} ":*.ptp.fortran" fortran
%{mvn_package} ":"

sed -i -e 's#tasks\>#target\>#g' \
  core/org.eclipse.ptp.proxy/pom.xml core/org.eclipse.ptp.utils/pom.xml \
  rms/org.eclipse.ptp.rm.lml.da.server/pom.xml releng/org.eclipse.ptp.repo/pom.xml \
  debug/org.eclipse.ptp.debug.sdm/pom.xml tools/sci/org.eclipse.ptp.sci/pom.xml

%build
export JAVA_HOME=%{_jvmdir}/java
export MAVEN_OPTS="-Xmx1024m -XX:CompileCommand=exclude,org/eclipse/tycho/core/osgitools/EquinoxResolver,newState ${MAVEN_OPTS}"

# Build the sdm binary
pushd debug/org.eclipse.ptp.debug.sdm
export CFLAGS="%{optflags} -fno-strict-overflow"
sh BUILD
sh BUILD clean
popd

# Put binary in place and make sure bundle is dir-shaped when installed
mkdir -p releng/org.eclipse.ptp.linux/os/linux/%{eclipse_arch}
cp -p debug/org.eclipse.ptp.debug.sdm/bin/sdm releng/org.eclipse.ptp.linux/os/linux/%{eclipse_arch}/sdm
echo -e "Eclipse-BundleShape: dir\n\n" >> releng/org.eclipse.ptp.linux/META-INF/MANIFEST.MF

# Qualifier generated from last modification time of source tarball
QUALIFIER=$(date -u -d"$(stat --format=%%y %{SOURCE0})" +%%Y%%m%%d%%H%%M)
%{mvn_build} -j -- -DforceContextQualifier=$QUALIFIER

%install
%mvn_install

# Install sdm binary so debuginfo is created
mkdir -p %{buildroot}%{_libdir}/ptp
plugin=$(ls %{buildroot}%{_libdir}/eclipse/droplets/ptp-sdm/plugins | grep org.eclipse.ptp.linux_)
chmod +x %{buildroot}%{_libdir}/eclipse/droplets/ptp-sdm/plugins/$plugin/os/linux/%{eclipse_arch}/sdm
ln -s %{_libdir}/eclipse/droplets/ptp-sdm/plugins/$plugin/os/linux/%{eclipse_arch}/sdm \
  %{buildroot}%{_libdir}/ptp/

%files -f .mfiles
%doc releng/org.eclipse.ptp-feature/epl-v10.html

%files master
%doc releng/org.eclipse.ptp-feature/epl-v10.html

%files rm-contrib -f .mfiles-rm-contrib
%doc releng/org.eclipse.ptp-feature/epl-v10.html

%files sdk -f .mfiles-sdk
%doc releng/org.eclipse.ptp-feature/epl-v10.html

%files sdm -f .mfiles-sdm
%doc releng/org.eclipse.ptp-feature/epl-v10.html
%{_libdir}/ptp/

%changelog
openSUSE Build Service is sponsored by