Blame SPECS/jmc.spec

95ad29
# Version
8e0cd2
%global major 8
8e0cd2
%global minor 0
b18727
%global patchlevel 1
95ad29
95ad29
# Revision
b18727
%global revnum 2
8e0cd2
# set to 1 for snapshots, 0 for release
95ad29
%global usesnapshot 0
95ad29
95ad29
# SNAPSHOT version
b18727
%global revhash 699a121bd449fe8a9350221282bd3f809691a766
b18727
%global revdate 20210623
95ad29
8e0cd2
%global tarball_name jmc-%{revhash}
95ad29
95ad29
# Install jmc in /usr/lib/jmc (arch-specific and multilib exempt)
95ad29
%global _jmcdir %{_prefix}/lib/%{name}
95ad29
95ad29
%global debug_package %{nil}
95ad29
95ad29
%if %{usesnapshot}
8e0cd2
  %global releasestr %{revnum}.%{revdate}
95ad29
%else
95ad29
  %global releasestr %{revnum}
95ad29
%endif
95ad29
95ad29
%ifarch %{ix86}
95ad29
    %global eclipse_arch x86
95ad29
%endif
95ad29
%ifarch %{arm}
95ad29
    %global eclipse_arch arm
95ad29
%endif
95ad29
%ifarch s390x x86_64 aarch64 ppc64le
95ad29
    %global eclipse_arch %{_arch}
95ad29
%endif
95ad29
95ad29
# Don't export Eclipse libraries
95ad29
%global __provides_exclude_from ^%{_jmcdir}/plugins/org.eclipse.*$
95ad29
%global __requires_exclude_from ^%{_jmcdir}/plugins/org.eclipse.*$
95ad29
95ad29
%global __requires_exclude ^osgi\\((javax|org\\.apache|org\\.eclipse|org\\.sat4j).*$
95ad29
%global __provides_exclude ^osgi\\((com|javax|org\\.apache|org\\.glassfish|org\\.kxml2|org\\.sat4j|org\\.tukaani|org\\.w3c|org\\.xmlpull).*$
95ad29
95ad29
Name:       jmc
95ad29
Version:    %{major}.%{minor}.%{patchlevel}
95ad29
Release:    %{releasestr}%{?dist}
95ad29
Summary:    JDK Mission Control is a profiling and diagnostics tool
95ad29
95ad29
License:    UPL
95ad29
URL:        http://openjdk.java.net/projects/jmc/
95ad29
8e0cd2
Source0:    https://github.com/openjdk/jmc/archive/%{revhash}.tar.gz
95ad29
Source1:    %{name}.desktop
95ad29
Source2:    %{name}.1
95ad29
Source3:    symlink_libs.sh
95ad29
95ad29
# Remove optional twitter related functionality
95ad29
Patch0:     0-remove-twitter.patch
95ad29
# Remove maven build profiles that won't be used in local build
8e0cd2
Patch1:     1-remove-profiles.patch
95ad29
# Remove localization files that currently cannot be supported
95ad29
# due to a packaging issue for Eclipse language packs
95ad29
# eclipse-nls-ja and eclipse-nls-zh
95ad29
# They currently provide multiple archs within the same package
95ad29
# and the local build system cannot fulfill dependencies from them
8e0cd2
Patch2:     2-remove-localization.patch
95ad29
# Remove unused module org.openjdk.jmc.ide.jdt
8e0cd2
Patch3:     3-remove-ide-jdt.patch
95ad29
# Remove unused remote repository definition
8e0cd2
Patch4:     4-remove-buchen-repo.patch
95ad29
# Add dependency on org. hamcrest-core to provide class used in unit tests
8e0cd2
Patch5:     5-add-hamcrest.patch
95ad29
# Remove windows and mac arches
8e0cd2
Patch6:     6-remove-arch.patch
95ad29
# Remove unnecessary dependency
8e0cd2
Patch7:     7-remove-jacoco-dep.patch
95ad29
# Revert downloading of flameview assets from the web
8e0cd2
Patch8:     8-revert-flameview.patch
8e0cd2
# Drop JFR flags (temporary)
8e0cd2
Patch9:     9-update-flags.patch
8e0cd2
# Revert the adjusted lz4-java name as seen in jmc
8e0cd2
Patch10:    10-revert-lz4-java-name-override.patch
8e0cd2
# Patch pom.xml Use to tycho version 2.1
8e0cd2
Patch11:    11-tycho.patch
8e0cd2
# Revert downloading of graphview assets from the web
b18727
Patch12:    12-revert-graphview.patch
8e0cd2
# Simplify the path to the jmc product
b18727
Patch13:    13-revert-6852.patch
8e0cd2
# Update javamail dependency names
b18727
Patch14:    14-fix-javamail.patch
8e0cd2
# Revert usage of ResourceLocator as it isn't available in Eclipse 4.12
b18727
Patch15:    15-revert-resourcelocator.patch
b18727
# Remove Chromium (currently Windows-only) from the plugin list
b18727
Patch16:    16-remove-chromium.patch
8e0cd2
# Revert usage of List.of in GraphView
8e0cd2
Patch17:    17-revert-list-of.patch
95ad29
95ad29
ExclusiveArch: x86_64
95ad29
95ad29
BuildRequires:  desktop-file-utils
8e0cd2
BuildRequires:  java-11-openjdk
8e0cd2
BuildRequires:  libappstream-glib
95ad29
BuildRequires:  maven-local
95ad29
95ad29
BuildRequires:  eclipse-pde
95ad29
BuildRequires:  tycho
95ad29
8e0cd2
BuildRequires:  HdrHistogram >= 2.1.11
95ad29
BuildRequires:  javamail
95ad29
BuildRequires:  mvn(org.commonjava.maven.plugins:directory-maven-plugin)
95ad29
BuildRequires:  mvn(com.sun.activation:jakarta.activation)
95ad29
BuildRequires:  mvn(org.openjdk.jmc:common)
8e0cd2
BuildRequires:  osgi(org.openjdk.jmc.flightrecorder.test)
8e0cd2
BuildRequires:  osgi(javax.annotation-api)
95ad29
95ad29
Requires:  java-openjdk >= 1:1.8
b18727
Requires:  lz4-java
95ad29
95ad29
Requires:  osgi(com.sun.activation.jakarta.activation)
95ad29
Requires:  osgi(org.openjdk.jmc.common)
95ad29
Requires:  osgi(org.openjdk.jmc.flightrecorder)
95ad29
Requires:  osgi(org.openjdk.jmc.flightrecorder.rules)
95ad29
Requires:  osgi(org.openjdk.jmc.flightrecorder.rules.jdk)
95ad29
Requires:  osgi(org.owasp.encoder)
95ad29
Requires:  osgi(org.hdrhistogram.HdrHistogram) >= 2.1.11
95ad29
95ad29
Requires: gtk3
95ad29
Requires: webkitgtk4
95ad29
Requires: libGLU.so.1()(64bit)
95ad29
95ad29
%description
95ad29
JDK Mission Control is a powerful profiler for HotSpot JVMs and has an
95ad29
advanced set of tools that enables efficient and detailed analysis of the
95ad29
extensive data collected by JDK Flight Recorder. The tool chain enables
95ad29
developers and administrators to collect and analyze data from Java
95ad29
applications running locally or deployed in production environments.
95ad29
95ad29
%prep
95ad29
%setup -q -n %{tarball_name}
95ad29
95ad29
%patch0 -p1
95ad29
%patch1 -p1
95ad29
%patch2 -p1
95ad29
%patch3 -p1
95ad29
%patch4 -p1
95ad29
%patch5 -p1
95ad29
%patch6 -p1
95ad29
%patch7 -p1
95ad29
%patch8 -p1
95ad29
%patch9 -p1
95ad29
%patch10 -p1
95ad29
%patch11 -p1
95ad29
%patch12 -p1
8e0cd2
%patch13 -p1
8e0cd2
%patch14 -p1
8e0cd2
%patch15 -p1
8e0cd2
%patch16 -p1
8e0cd2
%patch17 -p1
95ad29
95ad29
%pom_disable_module releng
95ad29
%pom_disable_module l10n application
95ad29
%pom_disable_module org.openjdk.jmc.updatesite.ide application
95ad29
%pom_disable_module org.openjdk.jmc.updatesite.rcp application
95ad29
8e0cd2
# disable tests that require the use of jfr
8e0cd2
%pom_disable_module org.openjdk.jmc.rjmx.services.jfr.test application/tests
8e0cd2
%pom_disable_module org.openjdk.jmc.flightrecorder.controlpanel.ui.test application/tests
8e0cd2
95ad29
%pom_remove_plugin com.github.spotbugs:spotbugs-maven-plugin
95ad29
%pom_remove_plugin :maven-enforcer-plugin
95ad29
95ad29
%pom_remove_plugin :jacoco-maven-plugin application/tests
95ad29
%pom_remove_plugin :jacoco-maven-plugin application/uitests
95ad29
%pom_disable_module coverage application
95ad29
95ad29
# Info.plist are mac files and we only build for Linux
95ad29
%pom_remove_plugin name.abuchen:fix-info-plist-maven-plugin application/org.openjdk.jmc.rcp.product
95ad29
95ad29
%pom_remove_plugin org.codehaus.mojo:buildnumber-maven-plugin
95ad29
%pom_remove_plugin org.apache.maven.plugins:maven-deploy-plugin
95ad29
95ad29
TYCHO_ENV="<environment><os>linux</os><ws>gtk</ws><arch>%{eclipse_arch}</arch></environment>"
95ad29
%pom_xpath_set "pom:configuration/pom:environments" "$TYCHO_ENV"
95ad29
95ad29
%build
8e0cd2
95ad29
# some tests require large heap and fail with OOM
95ad29
# depending on the builder resources
b9c444
%mvn_build -j -- -Dmaven.test.failure.ignore=true -DbuildId=rhel -DbuildNumber=%{revhash} -Dbuild.date=%{revdate}
95ad29
95ad29
%install
95ad29
95ad29
# not using mvn_install macro because it installs JMC as an Eclipse plugin
95ad29
# we want to install JMC as an RCP application
95ad29
95ad29
# change jmc.ini to use system java (remove -vm option line)
95ad29
sed -i '/^-vm$/d' %{_builddir}/%{tarball_name}/target/products/org.openjdk.jmc/%{_os}/gtk/%{eclipse_arch}/%{name}.ini
95ad29
sed -i '/^..\/..\/bin\/$/d' %{_builddir}/%{tarball_name}/target/products/org.openjdk.jmc/%{_os}/gtk/%{eclipse_arch}/%{name}.ini
95ad29
95ad29
# add IgnoreUnrecognizedVMOptions flag to allow running on OpenJDK 8 without 'Unrecognized VM option' error
95ad29
sed -i '/^-vmargs$/a -XX:+IgnoreUnrecognizedVMOptions' %{_builddir}/%{tarball_name}/target/products/org.openjdk.jmc/%{_os}/gtk/%{eclipse_arch}/%{name}.ini
95ad29
95ad29
# move contents of target/products/org.openjdk.jmc/${_os}/gtk/%{eclipse_arch}/ to /usr/lib/jmc/
95ad29
install -d -m 755 %{buildroot}%{_jmcdir}
95ad29
cp -p -r %{_builddir}/%{tarball_name}/target/products/org.openjdk.jmc/%{_os}/gtk/%{eclipse_arch}/* %{buildroot}%{_jmcdir}/
95ad29
95ad29
# move jmc.ini to /etc/jmc.ini
95ad29
install -d -m 755 %{buildroot}%{_sysconfdir}
95ad29
mv %{buildroot}%{_jmcdir}/%{name}.ini %{buildroot}%{_sysconfdir}/%{name}.ini
95ad29
ln -s %{_sysconfdir}/%{name}.ini %{buildroot}%{_jmcdir}/%{name}.ini
95ad29
95ad29
# create symlink to jmc in /usr/bin/
95ad29
install -d -m 755 %{buildroot}%{_bindir}
95ad29
ln -s %{_jmcdir}/%{name} %{buildroot}%{_bindir}/%{name}
95ad29
95ad29
# replace jars with symlinks to installed libraries
95ad29
bash %{SOURCE3} %{buildroot}%{_jmcdir}/plugins %{_javadir} %{_jnidir} %{_javadir_maven} %{_jnidir_maven} %{_javadir}/jmc-core
95ad29
95ad29
# create application launcher in desktop menu
95ad29
install -d -m 755 %{buildroot}%{_datadir}/pixmaps
95ad29
mv %{buildroot}%{_jmcdir}/icon.xpm %{buildroot}%{_datadir}/pixmaps/%{name}.xpm
95ad29
chmod 644 %{buildroot}%{_datadir}/pixmaps/%{name}.xpm
95ad29
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
95ad29
95ad29
# install pom file
95ad29
install -d -m 755 %{buildroot}%{_datadir}/maven-poms/%{name}
95ad29
install -p -m 644 %{_builddir}/%{tarball_name}/pom.xml %{buildroot}%{_datadir}/maven-poms/%{name}/%{name}.pom
95ad29
95ad29
# install manpage and insert location of config file
95ad29
install -d -m 755 %{buildroot}%{_mandir}/man1
95ad29
install -p -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man1/%{name}.1
95ad29
sed -i "/.SH FILES/a .I %{_sysconfdir}/%{name}.ini" %{buildroot}%{_mandir}/man1/%{name}.1
95ad29
95ad29
%files
95ad29
%license license/LICENSE.txt
95ad29
%license license/THIRDPARTYREADME.txt
95ad29
%doc README.md
95ad29
%config(noreplace) %{_sysconfdir}/%{name}.ini
95ad29
%{_jmcdir}
95ad29
%{_mandir}/man1/%{name}.1*
95ad29
%{_bindir}/%{name}
95ad29
%{_datadir}/maven-poms/%{name}
95ad29
%{_datadir}/pixmaps/%{name}.xpm
95ad29
%{_datadir}/applications/%{name}.desktop
95ad29
95ad29
%changelog
b18727
* Wed Aug 19 2021 Alex Macdonald <almacdon@redhat.com> - 8.0.1-2
b18727
- Re-set the buildId, buildNumber, and build.date during maven build
b18727
b18727
* Tue Aug 10 2021 Alex Macdonald <almacdon@redhat.com> - 8.0.0-1
b18727
- Update to jmc 8.0.1-ga
b18727
b18727
* Tue Aug 10 2021 Alex Macdonald <almacdon@redhat.com> - 8.1.0-1
b18727
- Update to jmc-ga tagged commit d0f89f0
b18727
b9c444
* Wed Feb 24 2021 Alex Macdonald <almacdon@redhat.com> - 8.0.0-8
b9c444
- Set the buildId, buildNumber, and build.date during maven build
b9c444
8e0cd2
* Fri Feb 19 2021 Alex Macdonald <almacdon@redhat.com> - 8.0.0-7
8e0cd2
- Fix incorrect macro for name
8e0cd2
8e0cd2
* Fri Feb 19 2021 Alex Macdonald <almacdon@redhat.com> - 8.0.0-6
8e0cd2
- Revert previous JAVA_HOME export
8e0cd2
- Add patch to remove use of List.of in GraphView
8e0cd2
8e0cd2
* Fri Feb 19 2021 Alex Macdonald <almacdon@redhat.com> - 8.0.0-5
8e0cd2
- Export JAVA_HOME to be openjdk 11 
8e0cd2
8e0cd2
* Thu Feb 18 2021 Alex Macdonald <almacdon@redhat.com> - 8.0.0-4
8e0cd2
- Revert usage of ResourceLocator to be eclipse 4.12 compliant
8e0cd2
8e0cd2
* Wed Feb 17 2021 Alex Macdonald <almacdon@redhat.com> - 8.0.0-3
8e0cd2
- Revert removal of fix-javamail patch
8e0cd2
8e0cd2
* Wed Feb 17 2021 Alex Macdonald <almacdon@redhat.com> - 8.0.0-2
8e0cd2
- Revert osgi reference from jakarta.annotation to javax.annotation
8e0cd2
8e0cd2
* Fri Feb 12 2021 Alex Macdonald <almacdon@redhat.com> - 8.0.0-1
8e0cd2
- Update to jmc8 branch commit 8ab40bf
8e0cd2
95ad29
* Thu Apr 23 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-5
95ad29
- Update jacoco removal patch
8e0cd2
95ad29
* Thu Apr 23 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-4
95ad29
- Update to latest commit e67446b5fc9d
8e0cd2
95ad29
* Fri Apr 17 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-3
95ad29
- include jmc-core in the directories to search in symlink_libs.sh
8e0cd2
95ad29
* Fri Apr 17 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-2
95ad29
- Remove jacoco from the pom and disable coverage
8e0cd2
95ad29
* Thu Apr 16 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-1
95ad29
- Updated to version 7.1.1
8e0cd2
95ad29
* Thu Nov 14 2019 Jie Kang <jkang@redhat.com> - 7.0.0-4
95ad29
- Fix requires
8e0cd2
95ad29
* Wed Nov 13 2019 Jie Kang <jkang@redhat.com> - 7.0.0-3
95ad29
- Fix exclusions
8e0cd2
95ad29
* Wed Nov 13 2019 Jie Kang <jkang@redhat.com> - 7.0.0-2
95ad29
- Update require and provide exclusions
8e0cd2
95ad29
* Tue Mar 12 2019 Jie Kang <jkang@redhat.com> - 7.0.0-1
95ad29
- Initial package