Blame SPECS/jmc.spec

95ad29
# Version
95ad29
%global major 7
95ad29
%global minor 1
95ad29
%global patchlevel 1
95ad29
95ad29
# Revision
95ad29
%global revnum 5
95ad29
# set to 1 for hg snapshots, 0 for release
95ad29
%global usesnapshot 0
95ad29
95ad29
# SNAPSHOT version
95ad29
%global hgrevhash e67446b5fc9d
95ad29
%global hgrevdate 20200422
95ad29
95ad29
%global tarball_name jmc7-%{hgrevhash}
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}
95ad29
  %global releasestr %{revnum}.%{hgrevdate}hg%{hgrevhash}
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
95ad29
Source0:    https://hg.openjdk.java.net/jmc/jmc7/archive/%{hgrevhash}.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
# Update javamail dependency names
95ad29
Patch1:     1-fix-javamail.patch
95ad29
# Update javax dependency names to match what is found in Fedora
95ad29
Patch2:     2-javax.patch
95ad29
# Remove maven build profiles that won't be used in local build
95ad29
Patch3:     3-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
95ad29
Patch4:     4-remove-localization.patch
95ad29
# Remove unused module org.openjdk.jmc.ide.jdt
95ad29
Patch5:     5-remove-ide-jdt.patch
95ad29
# Remove unused remote repository definition
95ad29
Patch6:     6-remove-buchen-repo.patch
95ad29
# Add dependency on org. hamcrest-core to provide class used in unit tests
95ad29
Patch7:     7-add-hamcrest.patch
95ad29
# Remove windows and mac arches
95ad29
Patch8:     8-remove-arch.patch
95ad29
# Remove unnecessary dependency
95ad29
Patch9:     9-remove-jacoco-dep.patch
95ad29
# Revert downloading of flameview assets from the web
95ad29
Patch10:    10-revert-flameview.patch
95ad29
# Backport of JMC-6554 to add jvm vendor information retrieval and commercial features checks
95ad29
Patch11:    11-6554.patch
95ad29
# Backport of JMC-6692 to prevent JMC from prompting the user
95ad29
# to enable commercial features when using a JDK8 JFR-enabled JVM
95ad29
Patch12:    12-6692.patch
95ad29
95ad29
ExclusiveArch: x86_64
95ad29
95ad29
BuildRequires:  desktop-file-utils
95ad29
BuildRequires:  maven-local
95ad29
BuildRequires:  osgi(javax.annotation-api)
95ad29
95ad29
BuildRequires:  eclipse-pde
95ad29
BuildRequires:  tycho
95ad29
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)
95ad29
BuildRequires:  HdrHistogram >= 2.1.11
95ad29
95ad29
Requires:  java-openjdk >= 1:1.8
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
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
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
95ad29
# some tests require large heap and fail with OOM
95ad29
# depending on the builder resources
95ad29
%mvn_build -j -- -Dmaven.test.failure.ignore=true
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
95ad29
* Thu Apr 23 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-5
95ad29
- Update jacoco removal patch
95ad29
* Thu Apr 23 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-4
95ad29
- Update to latest commit e67446b5fc9d
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
95ad29
* Fri Apr 17 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-2
95ad29
- Remove jacoco from the pom and disable coverage
95ad29
* Thu Apr 16 2020 Alex Macdonald <almacdon@redhat.com> - 7.1.1-1
95ad29
- Updated to version 7.1.1
95ad29
* Thu Nov 14 2019 Jie Kang <jkang@redhat.com> - 7.0.0-4
95ad29
- Fix requires
95ad29
* Wed Nov 13 2019 Jie Kang <jkang@redhat.com> - 7.0.0-3
95ad29
- Fix exclusions
95ad29
* Wed Nov 13 2019 Jie Kang <jkang@redhat.com> - 7.0.0-2
95ad29
- Update require and provide exclusions
95ad29
* Tue Mar 12 2019 Jie Kang <jkang@redhat.com> - 7.0.0-1
95ad29
- Initial package