# Version %global major 7 %global minor 0 %global patchlevel 0 # Revision %global revnum 0 # set to 1 for hg snapshots, 0 for release %global usesnapshot 1 # SNAPSHOT version %global hgrevhash 1ddf3baa4e26 %global hgrevdate 20181130 # Install jmc in _libdir because it is arch-specific %global _jmcdir %{_libdir}/%{name} %global debug_package %{nil} %if %{usesnapshot} %global releasestr %{revnum}.%{hgrevdate}hg%{hgrevhash} %else %global releasestr %{revnum} %endif Name: jmc Version: %{major}.%{minor}.%{patchlevel} Release: %{releasestr}%{?dist} Summary: Java Mission Control is a profiling and diagnostics tool License: UPL URL: http://openjdk.java.net/projects/jmc/ # bash generate_jmc_tarball.sh Source0: %{name}-%{version}.tar.gz Source1: %{name}.desktop Source2: %{name}.1 Source3: generate_jmc_tarball.sh Source4: symlink_libs.sh # Remove optional twitter related functionality Patch0: 0_remove_twitter.patch # Update javamail dependency names to match what is found in Fedora Patch1: 1_javamail.patch # Update javax dependency names to match what is found in Fedora Patch2: 2_javax.patch # Remove maven build profiles that won't be used in local build Patch3: 3_remove_profiles.patch # Remove localization files that currently cannot be supported # due to a packaging issue for Eclipse language packs # eclipse-nls-ja and eclipse-nls-zh # They currently provide multiple archs within the same package # and the local build system cannot fulfill dependencies from them Patch4: 4_remove_localization.patch # Remove optional openjfx related functionality Patch5: 5_remove_jfx.patch # Remove unused module org.openjdk.jmc.ide.jdt Patch6: 6_remove_ide_jdt.patch # Remove unused remote repository definition Patch7: 7_remove_buchen_repo.patch # Add dependency on org. hamcrest-core to provide class used in unit tests Patch8: 8_add_hamcrest.patch BuildRequires: desktop-file-utils BuildRequires: maven-local BuildRequires: mvn(org.apache.maven.plugins:maven-deploy-plugin:pom:) BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin:pom:) BuildRequires: mvn(org.apache.maven.plugins:maven-install-plugin:pom:) BuildRequires: mvn(org.apache.maven.plugins:maven-site-plugin:pom:) BuildRequires: mvn(org.codehaus.mojo:buildnumber-maven-plugin) BuildRequires: mvn(org.commonjava.maven.plugins:directory-maven-plugin) BuildRequires: mvn(name.abuchen:fix-info-plist-maven-plugin) BuildRequires: osgi(com.sun.activation.jakarta.activation) BuildRequires: osgi(jakarta.mail.api) BuildRequires: osgi(javax.annotation-api) BuildRequires: osgi(org.eclipse.equinox.p2.core) BuildRequires: osgi(org.eclipse.pde.ui) BuildRequires: osgi(org.eclipse.swt) BuildRequires: osgi(org.fedoraproject.p2) BuildRequires: osgi(org.openjdk.jmc.common) # most requires are auto-generated Requires: osgi(com.sun.activation.jakarta.activation) Requires: osgi(jakarta.mail.api) Requires: osgi(org.openjdk.jmc.common) %description Java Mission Control is a powerful profiler for HotSpot JVMs and has an advanced set of tools that enables efficient and detailed analysis of the extensive data collected by Java Flight Recorder. The tool chain enables developers and administrators to collect and analyze data from Java applications running locally or deployed in production environments. %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %pom_disable_module releng %pom_disable_module l10n application %pom_disable_module org.openjdk.jmc.updatesite.ide application %pom_disable_module org.openjdk.jmc.updatesite.rcp application %pom_remove_plugin com.github.spotbugs:spotbugs-maven-plugin %build %mvn_build -j -- -Dspotbugs.skip=true %install # change jmc.ini to use system java (remove -vm option line) sed -i '/^-vm$/d' %{_builddir}/%{name}-%{version}/target/products/org.openjdk.jmc/%{_os}/gtk/%{_arch}/%{name}.ini sed -i '/^..\/..\/bin\/$/d' %{_builddir}/%{name}-%{version}/target/products/org.openjdk.jmc/%{_os}/gtk/%{_arch}/%{name}.ini # add IgnoreUnrecognizedVMOptions flag to allow running on OpenJDK 8 without 'Unrecognized VM option' error sed -i '/^-vmargs$/a -XX:+IgnoreUnrecognizedVMOptions' %{_builddir}/%{name}-%{version}/target/products/org.openjdk.jmc/%{_os}/gtk/%{_arch}/%{name}.ini # delete unnecessary files rm -r %{_builddir}/%{name}-%{version}/target/products/org.openjdk.jmc/%{_os}/gtk/%{_arch}/p2/ # move contents of target/products/org.openjdk.jmc/linux/gtk/x86_64/ to /usr/lib/jmc/ install -d -m 755 %{buildroot}%{_jmcdir}/ cp -p -r %{_builddir}/%{name}-%{version}/target/products/org.openjdk.jmc/%{_os}/gtk/%{_arch}/* %{buildroot}%{_jmcdir}/ # create symlink to jmc in /usr/bin/ install -d -m 755 %{buildroot}%{_bindir} ln -s %{_jmcdir}/%{name} %{buildroot}%{_bindir}/%{name} # replace jars with symlinks to installed libraries # pushd % {buildroot}% {_jmcdir}/plugins # xmvn-subst -L true -R % {buildroot}% {_javadir} . # xmvn-subst -L true -R % {buildroot}% {_eclipsepluginsdir} . # popd bash %{SOURCE4} %{buildroot}%{_jmcdir}/plugins # create application launcher in desktop menu install -d -m 755 %{buildroot}%{_datadir}/pixmaps mv %{buildroot}%{_jmcdir}/icon.xpm %{buildroot}%{_datadir}/pixmaps/%{name}.xpm chmod 644 %{buildroot}%{_datadir}/pixmaps/%{name}.xpm desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1} # install pom file install -d -m 755 %{buildroot}%{_datadir}/maven-poms/%{name} install -p -m 644 %{_builddir}/%{name}-%{version}/pom.xml \ %{buildroot}%{_datadir}/maven-poms/%{name}/%{name}.pom # install manpage install -d -m 755 %{buildroot}%{_mandir}/man1 install -p -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man1/%{name}.1 %files %license license/LICENSE.txt %license license/THIRDPARTYREADME.txt %doc README.md %{_jmcdir} %{_mandir}/man1/%{name}.1* %{_bindir}/%{name} %{_datadir}/maven-poms/%{name} %{_datadir}/pixmaps/%{name}.xpm %{_datadir}/applications/%{name}.desktop %changelog * Fri Nov 30 2018 Salman Siddiqui - 7.0.0-0.20181130hg1ddf3baa4e26 - Update to latest snapshot version * Fri Sep 14 2018 Salman Siddiqui - 7.0.0-0 - Initial packaging