From 628882a8b4860db598f29b95061ffcc08573f0d2 Mon Sep 17 00:00:00 2001 From: Salman Siddiqui Date: Nov 29 2018 17:54:23 +0000 Subject: [PATCH 1/8] use snapshot versioning for jmc --- diff --git a/jmc/generate_jmc_tarball.sh b/jmc/generate_jmc_tarball.sh index dfe912c..fe525f8 100755 --- a/jmc/generate_jmc_tarball.sh +++ b/jmc/generate_jmc_tarball.sh @@ -1,9 +1,21 @@ #!/bin/sh -wget http://hg.openjdk.java.net/jmc/jmc/archive/ecb68ef82eb7.tar.gz -tar xzf ecb68ef82eb7.tar.gz -rm ecb68ef82eb7.tar.gz -mv jmc-ecb68ef82eb7/ jmc-7.0.0/ -rm -r jmc-7.0.0/core/ -tar czf jmc-7.0.0.tar.gz jmc-7.0.0/ -rm -r jmc-7.0.0 +# get version info from spec +VER_MAJOR=$(awk '/%global major/{print $NF}' jmc.spec) +VER_MINOR=$(awk '/%global minor/{print $NF}' jmc.spec) +VER_PATCH=$(awk '/%global patchlevel/{print $NF}' jmc.spec) +VERSION=$VER_MAJOR.$VER_MINOR.$VER_PATCH +HGREVHASH=$(awk '/%global hgrevhash/{print $NF}' jmc.spec) + +# retrieve jmc tarball +wget http://hg.openjdk.java.net/jmc/jmc/archive/$HGREVHASH.tar.gz +tar xzf $HGREVHASH.tar.gz +rm $HGREVHASH.tar.gz +mv jmc-$HGREVHASH/ jmc-$VERSION/ + +# delete unnecessary core module +rm -r jmc-$VERSION/core/ + +# create jmc tarball +tar czf jmc-$VERSION.tar.gz jmc-$VERSION/ +rm -r jmc-$VERSION diff --git a/jmc/jmc.spec b/jmc/jmc.spec index a44fb4a..820193d 100644 --- a/jmc/jmc.spec +++ b/jmc/jmc.spec @@ -1,17 +1,41 @@ +# 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 9aa7085f938b +%global hgrevdate 20181122 + +# 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: 7.0.0 -Release: 2%{?dist} +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/ -# original source: http://hg.openjdk.java.net/jmc/jmc/archive/tip.tar.gz -# Execute this script to download and generate source tarball: -# ./generate_jmc_tarball.sh +# bash generate_jmc_tarball.sh Source0: %{name}-%{version}.tar.gz Source1: %{name}.desktop Source2: %{name}.1 +Source3: generate_jmc_tarball.sh # Remove optional twitter related functionality Patch0: 0_remove_twitter.patch @@ -59,10 +83,6 @@ 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. -%global debug_package %{nil} - -%global _jmcdir %{_libdir}/%{name} - %prep %setup -q @@ -130,8 +150,8 @@ install -p -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man1/%{name}.1 %{_datadir}/applications/%{name}.desktop %changelog -* Mon Nov 05 2018 Salman Siddiqui - 7.0.0-2 -- Changed installation directory from /usr/share/java/jmc to /usr/share/jmc +* Fri Nov 23 2018 Salman Siddiqui - 7.0.0-0.20181122hg9aa7085f938b +- Update to latest snapshot version -* Fri Sep 14 2018 Salman Siddiqui - 7.0.0-1 +* Fri Sep 14 2018 Salman Siddiqui - 7.0.0-0 - Initial packaging From ba0da1ac5c452eb50a0810e906b894c4c902179a Mon Sep 17 00:00:00 2001 From: Salman Siddiqui Date: Nov 29 2018 17:57:05 +0000 Subject: [PATCH 2/8] use mvn() and osgi() BRs for jmc --- diff --git a/jmc/jmc.spec b/jmc/jmc.spec index 820193d..81e61b5 100644 --- a/jmc/jmc.spec +++ b/jmc/jmc.spec @@ -60,21 +60,23 @@ 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: buildnumber-maven-plugin BuildRequires: desktop-file-utils -BuildRequires: directory-maven-plugin -BuildRequires: eclipse-tests -BuildRequires: fix-info-plist-maven-plugin -BuildRequires: glassfish-annotation-api -BuildRequires: jaf -BuildRequires: javamail -BuildRequires: jmc-core -BuildRequires: maven-deploy-plugin -BuildRequires: maven-enforcer-plugin BuildRequires: maven-local -BuildRequires: tycho - -Requires: java-11-openjdk +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(com.sun.mail.javax.mail) +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) +BuildRequires: osgi(javax.annotation-api) %description Java Mission Control is a powerful profiler for HotSpot JVMs and has an From 17e993c3dc5adc9f4cb4ac55426004c9dd15798b Mon Sep 17 00:00:00 2001 From: Salman Siddiqui Date: Nov 29 2018 19:07:08 +0000 Subject: [PATCH 3/8] minor tweaks to jmc patch files --- diff --git a/jmc/0_remove_twitter.patch b/jmc/0_remove_twitter.patch index 545e843..1904edb 100644 --- a/jmc/0_remove_twitter.patch +++ b/jmc/0_remove_twitter.patch @@ -1,7 +1,8 @@ diff --git a/application/org.openjdk.jmc.rjmx/META-INF/MANIFEST.MF b/application/org.openjdk.jmc.rjmx/META-INF/MANIFEST.MF +index 6c32b74..02e0724 100644 --- a/application/org.openjdk.jmc.rjmx/META-INF/MANIFEST.MF +++ b/application/org.openjdk.jmc.rjmx/META-INF/MANIFEST.MF -@@ -54,7 +54,6 @@ +@@ -54,7 +54,6 @@ Export-Package: org.openjdk.jmc.rjmx, org.openjdk.jmc.rjmx.triggers; x-friends:="org.openjdk.jmc.console.ui.notification, org.openjdk.jmc.alert, @@ -9,63 +10,8 @@ diff --git a/application/org.openjdk.jmc.rjmx/META-INF/MANIFEST.MF b/application org.openjdk.jmc.rjmx.test", org.openjdk.jmc.rjmx.triggers.actions.internal;x-friends:="org.openjdk.jmc.console.ui.notification", org.openjdk.jmc.rjmx.triggers.condition.internal;x-friends:="org.openjdk.jmc.console.ui.notification,org.openjdk.jmc.test.jemmy", -diff --git a/application/org.openjdk.jmc.updatesite.ide/category.xml b/application/org.openjdk.jmc.updatesite.ide/category.xml ---- a/application/org.openjdk.jmc.updatesite.ide/category.xml -+++ b/application/org.openjdk.jmc.updatesite.ide/category.xml -@@ -55,10 +55,6 @@ - id="org.openjdk.jmc.feature.console.ui.subscriptions" version="0.0.0"> - - -- -- -- - -diff --git a/application/org.openjdk.jmc.updatesite.ide/feature.xml b/application/org.openjdk.jmc.updatesite.ide/feature.xml ---- a/application/org.openjdk.jmc.updatesite.ide/feature.xml -+++ b/application/org.openjdk.jmc.updatesite.ide/feature.xml -@@ -67,10 +67,6 @@ - version="0.0.0"/> - - -- -- - -diff --git a/application/org.openjdk.jmc.updatesite.rcp/category.xml b/application/org.openjdk.jmc.updatesite.rcp/category.xml ---- a/application/org.openjdk.jmc.updatesite.rcp/category.xml -+++ b/application/org.openjdk.jmc.updatesite.rcp/category.xml -@@ -55,10 +55,6 @@ - id="org.openjdk.jmc.feature.console.ui.subscriptions" version="0.0.0"> - - -- -- -- - -diff --git a/application/org.openjdk.jmc.updatesite.rcp/feature.xml b/application/org.openjdk.jmc.updatesite.rcp/feature.xml ---- a/application/org.openjdk.jmc.updatesite.rcp/feature.xml -+++ b/application/org.openjdk.jmc.updatesite.rcp/feature.xml -@@ -67,10 +67,6 @@ - version="0.0.0"/> - - -- -- - diff --git a/application/pom.xml b/application/pom.xml +index 73d3bf5..35e2765 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -50,7 +50,6 @@ @@ -85,9 +31,10 @@ diff --git a/application/pom.xml b/application/pom.xml org.openjdk.jmc.flightrecorder.controlpanel.ui org.openjdk.jmc.flightrecorder.controlpanel.ui.configuration diff --git a/license/THIRDPARTYREADME.txt b/license/THIRDPARTYREADME.txt +index 9feab81..edb98dc 100644 --- a/license/THIRDPARTYREADME.txt +++ b/license/THIRDPARTYREADME.txt -@@ -367,187 +367,3 @@ +@@ -367,187 +367,3 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/jmc/1_javamail.patch b/jmc/1_javamail.patch index b16787e..9c14323 100644 --- a/jmc/1_javamail.patch +++ b/jmc/1_javamail.patch @@ -1,15 +1,17 @@ diff --git a/application/org.openjdk.jmc.feature.core/feature.xml b/application/org.openjdk.jmc.feature.core/feature.xml +index 87eb827..6f259cc 100644 --- a/application/org.openjdk.jmc.feature.core/feature.xml +++ b/application/org.openjdk.jmc.feature.core/feature.xml -@@ -161,35 +161,7 @@ +@@ -161,38 +161,9 @@ unpack="false"/> ++ id="com.sun.mail.jakarta.mail" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> - - +- + +\ No newline at end of file diff --git a/jmc/2_javax.patch b/jmc/2_javax.patch index e9456f6..4ae9650 100644 --- a/jmc/2_javax.patch +++ b/jmc/2_javax.patch @@ -1,7 +1,8 @@ diff --git a/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF b/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF +index 3fa571d..c24c1c1 100644 --- a/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF +++ b/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF -@@ -10,7 +10,7 @@ +@@ -10,7 +10,7 @@ Bundle-Localization: plugin Require-Bundle: org.openjdk.jmc.rjmx.ui;visibility:=reexport, org.eclipse.e4.core.contexts;bundle-version="1.3.0", org.eclipse.e4.core.di;bundle-version="1.3.0";visibility:=reexport, @@ -10,7 +11,7 @@ diff --git a/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF b/appli javax.inject;bundle-version="1.0.0";visibility:=reexport, org.openjdk.jmc.commands Bundle-ActivationPolicy: lazy -@@ -22,7 +22,7 @@ +@@ -22,7 +22,7 @@ Export-Package: org.openjdk.jmc.console.ui.actions; org.openjdk.jmc.console.ui.editor, org.openjdk.jmc.console.ui.editor.internal;x-friends:="org.openjdk.jmc.console.ui.mbeanbrowser,org.openjdk.jmc.rcp.intro" Bundle-ClassPath: . @@ -20,6 +21,7 @@ diff --git a/application/org.openjdk.jmc.console.ui/META-INF/MANIFEST.MF b/appli Automatic-Module-Name: org.openjdk.jmc.console.ui diff --git a/application/org.openjdk.jmc.feature.rcp/feature.xml b/application/org.openjdk.jmc.feature.rcp/feature.xml +index 268b595..1e295ca 100644 --- a/application/org.openjdk.jmc.feature.rcp/feature.xml +++ b/application/org.openjdk.jmc.feature.rcp/feature.xml @@ -84,7 +84,8 @@ @@ -28,7 +30,7 @@ diff --git a/application/org.openjdk.jmc.feature.rcp/feature.xml b/application/o - + -+ ++ diff --git a/jmc/3_remove_profiles.patch b/jmc/3_remove_profiles.patch index 70be804..91cc790 100644 --- a/jmc/3_remove_profiles.patch +++ b/jmc/3_remove_profiles.patch @@ -1,7 +1,8 @@ diff --git a/pom.xml b/pom.xml +index fb12f05..0538111 100644 --- a/pom.xml +++ b/pom.xml -@@ -88,53 +88,6 @@ +@@ -95,53 +95,6 @@ ${snapshot.repo} @@ -16,7 +17,7 @@ diff --git a/pom.xml b/pom.xml - - org.eclipse.tycho - target-platform-configuration -- ${tycho-version} +- ${tycho.version} - - - @@ -37,7 +38,7 @@ diff --git a/pom.xml b/pom.xml - - org.eclipse.tycho - target-platform-configuration -- ${tycho-version} +- ${tycho.version} - - - diff --git a/jmc/4_remove_localization.patch b/jmc/4_remove_localization.patch index 4ba10d2..271e118 100644 --- a/jmc/4_remove_localization.patch +++ b/jmc/4_remove_localization.patch @@ -1,32 +1,31 @@ -# HG changeset patch -# Parent 6dfe58a53a9c2f2148ff30f94b9859112ca05bad - diff --git a/application/org.openjdk.jmc.feature.rcp/feature.xml b/application/org.openjdk.jmc.feature.rcp/feature.xml +index 1e295ca..9687dd4 100644 --- a/application/org.openjdk.jmc.feature.rcp/feature.xml +++ b/application/org.openjdk.jmc.feature.rcp/feature.xml -@@ -52,18 +52,10 @@ +@@ -51,18 +51,10 @@ + id="org.openjdk.jmc.feature.console" version="0.0.0"/> - - -- - - -- - -@@ -103,24 +95,6 @@ +@@ -104,24 +96,6 @@ + version="0.0.0" unpack="false"/> - - -- - - -- org.openjdk.jmc.pde org.openjdk.jmc.rcp.application diff --git a/application/tests/pom.xml b/application/tests/pom.xml +index cc660ff..b7a85c7 100644 --- a/application/tests/pom.xml +++ b/application/tests/pom.xml @@ -48,7 +48,6 @@ diff --git a/jmc/6_remove_ide_jdt.patch b/jmc/6_remove_ide_jdt.patch index 3b2cae9..4618a36 100644 --- a/jmc/6_remove_ide_jdt.patch +++ b/jmc/6_remove_ide_jdt.patch @@ -1,7 +1,5 @@ -# HG changeset patch -# Parent 361c91e54fb1074e7483ec160a4dac6c1675d649 - diff --git a/application/org.openjdk.jmc.feature.ide/feature.xml b/application/org.openjdk.jmc.feature.ide/feature.xml +index d6db9f1..439c52a 100644 --- a/application/org.openjdk.jmc.feature.ide/feature.xml +++ b/application/org.openjdk.jmc.feature.ide/feature.xml @@ -65,11 +65,4 @@ @@ -18,6 +16,7 @@ diff --git a/application/org.openjdk.jmc.feature.ide/feature.xml b/application/o \ No newline at end of file diff --git a/application/pom.xml b/application/pom.xml +index d4616f7..ca4a7ff 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -79,7 +79,6 @@ diff --git a/jmc/7_remove_buchen_repo.patch b/jmc/7_remove_buchen_repo.patch index 3ad6bf3..6e60bee 100644 --- a/jmc/7_remove_buchen_repo.patch +++ b/jmc/7_remove_buchen_repo.patch @@ -1,7 +1,5 @@ -# HG changeset patch -# Parent e578b12592dbe1e92201ab61ccdb32a1205f9b37 - diff --git a/application/org.openjdk.jmc.rcp.product/pom.xml b/application/org.openjdk.jmc.rcp.product/pom.xml +index 8e6b303..8060da9 100644 --- a/application/org.openjdk.jmc.rcp.product/pom.xml +++ b/application/org.openjdk.jmc.rcp.product/pom.xml @@ -141,11 +141,4 @@ diff --git a/jmc/8_add_hamcrest.patch b/jmc/8_add_hamcrest.patch index 5d4bc88..6940f7d 100644 --- a/jmc/8_add_hamcrest.patch +++ b/jmc/8_add_hamcrest.patch @@ -1,7 +1,8 @@ diff --git a/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/META-INF/MANIFEST.MF b/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/META-INF/MANIFEST.MF +index bf02b43..a4d5a67 100644 --- a/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/META-INF/MANIFEST.MF +++ b/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/META-INF/MANIFEST.MF -@@ -12,7 +12,8 @@ +@@ -12,7 +12,9 @@ Require-Bundle: org.junit, org.openjdk.jmc.rjmx.services.jfr, org.openjdk.jmc.rjmx, org.openjdk.jmc.common, @@ -11,4 +12,5 @@ diff --git a/application/tests/org.openjdk.jmc.rjmx.services.jfr.test/META-INF/M Export-Package: org.openjdk.jmc.rjmx.services.jfr.test Automatic-Module-Name: org.openjdk.jmc.rjmx.services.jfr.test -Import-Package: org.openjdk.jmc.flightrecorder.jdk -+Import-Package: org.openjdk.jmc.flightrecorder.jdk, org.hamcrest.core ++Import-Package: org.openjdk.jmc.flightrecorder.jdk, ++ org.hamcrest.core diff --git a/jmc/jmc.spec b/jmc/jmc.spec index 81e61b5..151b636 100644 --- a/jmc/jmc.spec +++ b/jmc/jmc.spec @@ -114,6 +114,9 @@ applications running locally or deployed in production environments. 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/ From b528b5f1032ec99848ea322eaccb9cf85a66c763 Mon Sep 17 00:00:00 2001 From: Salman Siddiqui Date: Nov 30 2018 16:15:36 +0000 Subject: [PATCH 4/8] use replace_plugins_with_symlinks.sh script in jmc --- diff --git a/jmc/jmc.spec b/jmc/jmc.spec index 151b636..8d6dbb0 100644 --- a/jmc/jmc.spec +++ b/jmc/jmc.spec @@ -36,6 +36,7 @@ Source0: %{name}-%{version}.tar.gz Source1: %{name}.desktop Source2: %{name}.1 Source3: generate_jmc_tarball.sh +Source4: replace_plugins_with_symlinks.sh # Remove optional twitter related functionality Patch0: 0_remove_twitter.patch @@ -70,7 +71,7 @@ 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(com.sun.mail.javax.mail) +BuildRequires: osgi(jakarta.mail.api) BuildRequires: osgi(org.eclipse.equinox.p2.core) BuildRequires: osgi(org.eclipse.pde.ui) BuildRequires: osgi(org.eclipse.swt) @@ -128,6 +129,14 @@ cp -p -r %{_builddir}/%{name}-%{version}/target/products/org.openjdk.jmc/%{_os}/ 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 diff --git a/jmc/replace_plugins_with_symlinks.sh b/jmc/replace_plugins_with_symlinks.sh new file mode 100644 index 0000000..75c02ee --- /dev/null +++ b/jmc/replace_plugins_with_symlinks.sh @@ -0,0 +1,58 @@ +# This script replaces plugins with symlinks +# $1 : folder of jars to replace with symlinks +# $2 : folder of jars to be symlinked to +set -e + +ECLIPSE_DIR=/usr/lib/eclipse/plugins + +function _sym { + if [ -f $1 ] + then + echo "linking $1 to $2" + rm -rf $1 + ln -s $2 $1 + else + echo "failed to link $1 to $2" + exit 1 + fi +} + +pushd $1 + for i in org.eclipse.core*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done + for i in org.eclipse.e4*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done + for i in org.eclipse.ecf*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done + for i in org.eclipse.equinox*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done + for i in org.eclipse.help*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done + for i in org.eclipse.jdt*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done + for i in org.eclipse.jface*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done + for i in org.eclipse.rcp*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done + for i in org.eclipse.swt*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done + for i in org.eclipse.text*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done + for i in org.eclipse.ui*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done + for i in org.eclipse.update*.jar; do + _sym $i ${ECLIPSE_DIR}/$i + done +popd + From 1b10ba0ca864ab203bda75ae778edfdb25dedd17 Mon Sep 17 00:00:00 2001 From: Salman Siddiqui Date: Nov 30 2018 17:51:18 +0000 Subject: [PATCH 5/8] update jmc to latest snapshot version and add requires --- diff --git a/jmc/1_javamail.patch b/jmc/1_javamail.patch index 9c14323..207a685 100644 --- a/jmc/1_javamail.patch +++ b/jmc/1_javamail.patch @@ -1,18 +1,11 @@ diff --git a/application/org.openjdk.jmc.feature.core/feature.xml b/application/org.openjdk.jmc.feature.core/feature.xml -index 87eb827..6f259cc 100644 +index 6abbea0..d21a907 100644 --- a/application/org.openjdk.jmc.feature.core/feature.xml +++ b/application/org.openjdk.jmc.feature.core/feature.xml -@@ -161,38 +161,9 @@ - unpack="false"/> - - -- + - - -- -- -- -- -- -- \ No newline at end of file diff --git a/jmc/jmc.spec b/jmc/jmc.spec index 8d6dbb0..f72e79f 100644 --- a/jmc/jmc.spec +++ b/jmc/jmc.spec @@ -9,8 +9,8 @@ %global usesnapshot 1 # SNAPSHOT version -%global hgrevhash 9aa7085f938b -%global hgrevdate 20181122 +%global hgrevhash 1ddf3baa4e26 +%global hgrevdate 20181130 # Install jmc in _libdir because it is arch-specific %global _jmcdir %{_libdir}/%{name} @@ -79,6 +79,23 @@ BuildRequires: osgi(org.fedoraproject.p2) BuildRequires: osgi(org.openjdk.jmc.common) BuildRequires: osgi(javax.annotation-api) +# most requires are auto-generated +Requires: osgi(com.ibm.icu) +Requires: osgi(com.sun.el.javax.el) +Requires: osgi(com.sun.mail.jakarta.mail) +Requires: osgi(com.sun.activation.jakarta.activation) +Requires: osgi(javax.servlet.jsp) +Requires: osgi(org.apache.felix.gogo.command) +Requires: osgi(org.eclipse.equinox.http.servlet) +Requires: osgi(org.eclipse.jetty.continuation) +Requires: osgi(org.eclipse.jetty.http) +Requires: osgi(org.eclipse.jetty.io) +Requires: osgi(org.eclipse.jetty.security) +Requires: osgi(org.eclipse.jetty.server) +Requires: osgi(org.eclipse.jetty.servlet) +Requires: osgi(org.eclipse.jetty.util) +Requires: osgi(org.glassfish.web.javax.servlet.jsp) + %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 @@ -164,7 +181,7 @@ install -p -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man1/%{name}.1 %{_datadir}/applications/%{name}.desktop %changelog -* Fri Nov 23 2018 Salman Siddiqui - 7.0.0-0.20181122hg9aa7085f938b +* 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 From 10d951ebbdd95790e7882a26619ba8244a81e242 Mon Sep 17 00:00:00 2001 From: Salman Siddiqui Date: Nov 30 2018 19:41:24 +0000 Subject: [PATCH 6/8] modified script to symlink eclipse libs --- diff --git a/jmc/jmc.spec b/jmc/jmc.spec index f72e79f..18f6bd7 100644 --- a/jmc/jmc.spec +++ b/jmc/jmc.spec @@ -36,7 +36,7 @@ Source0: %{name}-%{version}.tar.gz Source1: %{name}.desktop Source2: %{name}.1 Source3: generate_jmc_tarball.sh -Source4: replace_plugins_with_symlinks.sh +Source4: symlink_eclipse_libs.sh # Remove optional twitter related functionality Patch0: 0_remove_twitter.patch @@ -72,29 +72,21 @@ 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) -BuildRequires: osgi(javax.annotation-api) # most requires are auto-generated -Requires: osgi(com.ibm.icu) -Requires: osgi(com.sun.el.javax.el) -Requires: osgi(com.sun.mail.jakarta.mail) -Requires: osgi(com.sun.activation.jakarta.activation) -Requires: osgi(javax.servlet.jsp) -Requires: osgi(org.apache.felix.gogo.command) -Requires: osgi(org.eclipse.equinox.http.servlet) -Requires: osgi(org.eclipse.jetty.continuation) -Requires: osgi(org.eclipse.jetty.http) -Requires: osgi(org.eclipse.jetty.io) -Requires: osgi(org.eclipse.jetty.security) -Requires: osgi(org.eclipse.jetty.server) -Requires: osgi(org.eclipse.jetty.servlet) -Requires: osgi(org.eclipse.jetty.util) -Requires: osgi(org.glassfish.web.javax.servlet.jsp) +Requires: osgi(com.sun.activation.jakarta.activation) +Requires: osgi(jakarta.mail.api) +Requires: osgi(javax.annotation-api) +Requires: osgi(org.eclipse.equinox.p2.core) +Requires: osgi(org.eclipse.pde.ui) +Requires: osgi(org.eclipse.swt) +Requires: osgi(org.openjdk.jmc.common) %description Java Mission Control is a powerful profiler for HotSpot JVMs and has an diff --git a/jmc/replace_plugins_with_symlinks.sh b/jmc/replace_plugins_with_symlinks.sh deleted file mode 100644 index 75c02ee..0000000 --- a/jmc/replace_plugins_with_symlinks.sh +++ /dev/null @@ -1,58 +0,0 @@ -# This script replaces plugins with symlinks -# $1 : folder of jars to replace with symlinks -# $2 : folder of jars to be symlinked to -set -e - -ECLIPSE_DIR=/usr/lib/eclipse/plugins - -function _sym { - if [ -f $1 ] - then - echo "linking $1 to $2" - rm -rf $1 - ln -s $2 $1 - else - echo "failed to link $1 to $2" - exit 1 - fi -} - -pushd $1 - for i in org.eclipse.core*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done - for i in org.eclipse.e4*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done - for i in org.eclipse.ecf*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done - for i in org.eclipse.equinox*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done - for i in org.eclipse.help*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done - for i in org.eclipse.jdt*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done - for i in org.eclipse.jface*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done - for i in org.eclipse.rcp*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done - for i in org.eclipse.swt*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done - for i in org.eclipse.text*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done - for i in org.eclipse.ui*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done - for i in org.eclipse.update*.jar; do - _sym $i ${ECLIPSE_DIR}/$i - done -popd - diff --git a/jmc/symlink_eclipse_libs.sh b/jmc/symlink_eclipse_libs.sh new file mode 100644 index 0000000..7460bfe --- /dev/null +++ b/jmc/symlink_eclipse_libs.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +# This script replaces plugins with symlinks +# $1 : folder of jars to replace with symlinks +# $2 : folder of jars to be symlinked to +set -e + +ECLIPSE_DIR=/usr/lib/eclipse/plugins + +JARS=" +org.eclipse.core*.jar +org.eclipse.e4*.jar +org.eclipse.ecf*.jar +org.eclipse.equinox.app*.jar +org.eclipse.equinox.bidi*.jar +org.eclipse.equinox.common*.jar +org.eclipse.equinox.concurrent*.jar +org.eclipse.equinox.ds*.jar +org.eclipse.equinox.event*.jar +org.eclipse.equinox.frameworkadmin*.jar +org.eclipse.equinox.http*.jar +org.eclipse.equinox.jsp*.jar +org.eclipse.equinox.p2*.jar +org.eclipse.equinox.preferences*.jar +org.eclipse.equinox.registry*.jar +org.eclipse.equinox.security*.jar +org.eclipse.equinox.simpleconfigurator*.jar +org.eclipse.equinox.util*.jar +org.eclipse.help*.jar +org.eclipse.jdt*.jar +org.eclipse.jface*.jar +org.eclipse.rcp*.jar +org.eclipse.swt*.jar +org.eclipse.text*.jar +org.eclipse.ui*.jar +org.eclipse.update*.jar +" + +# org.eclipse.equinox.launcher determines what launches + +function _sym { + if [ -f $1 ] + then + echo "linking $1 to $2" + rm -rf $1 + ln -s $2 $1 + else + echo "failed to link $1 to $2" + exit 1 + fi +} + +for name in ${JARS}; do + echo ${name} +done + +pushd $1 + for name in ${JARS}; do + for i in ${name}; do + _sym $i ${ECLIPSE_DIR}/$i + done + done +popd + From b0405a339d6ded28cba4926b82ecb30080e65568 Mon Sep 17 00:00:00 2001 From: Salman Siddiqui Date: Nov 30 2018 19:51:09 +0000 Subject: [PATCH 7/8] remove extra requires from jmc --- diff --git a/jmc/jmc.spec b/jmc/jmc.spec index 18f6bd7..8c93e32 100644 --- a/jmc/jmc.spec +++ b/jmc/jmc.spec @@ -82,10 +82,6 @@ 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(javax.annotation-api) -Requires: osgi(org.eclipse.equinox.p2.core) -Requires: osgi(org.eclipse.pde.ui) -Requires: osgi(org.eclipse.swt) Requires: osgi(org.openjdk.jmc.common) %description From 0864ee9a6da460abb52a5388ad6ae37b85d7fcdb Mon Sep 17 00:00:00 2001 From: Salman Siddiqui Date: Dec 04 2018 18:25:50 +0000 Subject: [PATCH 8/8] symlink all libs --- diff --git a/jmc/jmc.spec b/jmc/jmc.spec index 8c93e32..80b28ce 100644 --- a/jmc/jmc.spec +++ b/jmc/jmc.spec @@ -36,7 +36,7 @@ Source0: %{name}-%{version}.tar.gz Source1: %{name}.desktop Source2: %{name}.1 Source3: generate_jmc_tarball.sh -Source4: symlink_eclipse_libs.sh +Source4: symlink_libs.sh # Remove optional twitter related functionality Patch0: 0_remove_twitter.patch @@ -135,10 +135,10 @@ 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 +# pushd % {buildroot}% {_jmcdir}/plugins +# xmvn-subst -L true -R % {buildroot}% {_javadir} . +# xmvn-subst -L true -R % {buildroot}% {_eclipsepluginsdir} . +# popd bash %{SOURCE4} %{buildroot}%{_jmcdir}/plugins diff --git a/jmc/symlink_eclipse_libs.sh b/jmc/symlink_eclipse_libs.sh deleted file mode 100644 index 7460bfe..0000000 --- a/jmc/symlink_eclipse_libs.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -# This script replaces plugins with symlinks -# $1 : folder of jars to replace with symlinks -# $2 : folder of jars to be symlinked to -set -e - -ECLIPSE_DIR=/usr/lib/eclipse/plugins - -JARS=" -org.eclipse.core*.jar -org.eclipse.e4*.jar -org.eclipse.ecf*.jar -org.eclipse.equinox.app*.jar -org.eclipse.equinox.bidi*.jar -org.eclipse.equinox.common*.jar -org.eclipse.equinox.concurrent*.jar -org.eclipse.equinox.ds*.jar -org.eclipse.equinox.event*.jar -org.eclipse.equinox.frameworkadmin*.jar -org.eclipse.equinox.http*.jar -org.eclipse.equinox.jsp*.jar -org.eclipse.equinox.p2*.jar -org.eclipse.equinox.preferences*.jar -org.eclipse.equinox.registry*.jar -org.eclipse.equinox.security*.jar -org.eclipse.equinox.simpleconfigurator*.jar -org.eclipse.equinox.util*.jar -org.eclipse.help*.jar -org.eclipse.jdt*.jar -org.eclipse.jface*.jar -org.eclipse.rcp*.jar -org.eclipse.swt*.jar -org.eclipse.text*.jar -org.eclipse.ui*.jar -org.eclipse.update*.jar -" - -# org.eclipse.equinox.launcher determines what launches - -function _sym { - if [ -f $1 ] - then - echo "linking $1 to $2" - rm -rf $1 - ln -s $2 $1 - else - echo "failed to link $1 to $2" - exit 1 - fi -} - -for name in ${JARS}; do - echo ${name} -done - -pushd $1 - for name in ${JARS}; do - for i in ${name}; do - _sym $i ${ECLIPSE_DIR}/$i - done - done -popd - diff --git a/jmc/symlink_libs.sh b/jmc/symlink_libs.sh new file mode 100644 index 0000000..314cf69 --- /dev/null +++ b/jmc/symlink_libs.sh @@ -0,0 +1,163 @@ +#!/bin/bash + +# This script replaces plugins with symlinks +# $1 : folder of jars to replace with symlinks +# $2 : folder of jars to be symlinked to +set -e + +ECLIPSE_DIR=/usr/lib/eclipse/plugins +JAVA_DIR=/usr/share/java + +JMCCORE_DIR=$JAVA_DIR/jmc-core +OWASP_DIR=$JAVA_DIR/owasp-java-encoder +ICU4J_DIR=$JAVA_DIR/icu4j +JAVAMAIL_DIR=$JAVA_DIR/javamail +JAF_DIR=$JAVA_DIR/jaf +HTTPCOMPONENTS_DIR=$JAVA_DIR/httpcomponents + +JARS=" +org.eclipse.core*.jar +org.eclipse.e4*.jar +org.eclipse.ecf*.jar +org.eclipse.emf*.jar +org.eclipse.equinox.app*.jar +org.eclipse.equinox.bidi*.jar +org.eclipse.equinox.common*.jar +org.eclipse.equinox.concurrent*.jar +org.eclipse.equinox.console*.jar +org.eclipse.equinox.ds*.jar +org.eclipse.equinox.event*.jar +org.eclipse.equinox.frameworkadmin*.jar +org.eclipse.equinox.http*.jar +org.eclipse.equinox.jsp*.jar +org.eclipse.equinox.p2*.jar +org.eclipse.equinox.preferences*.jar +org.eclipse.equinox.registry*.jar +org.eclipse.equinox.security*.jar +org.eclipse.equinox.simpleconfigurator*.jar +org.eclipse.equinox.util*.jar +org.eclipse.help*.jar +org.eclipse.jdt*.jar +org.eclipse.jetty*.jar +org.eclipse.jface*.jar +org.eclipse.osgi*.jar +org.eclipse.rcp*.jar +org.eclipse.swt*.jar +org.eclipse.text*.jar +org.eclipse.ui*.jar +org.eclipse.update*.jar +com.sun.el.javax.el*.jar +javax.el-api*.jar +javax.inject*.jar +javax.servlet-api*.jar +javax.servlet.jsp*.jar +org.apache.batik.constants*.jar +org.apache.batik.css*.jar +org.apache.batik.i18n*.jar +org.apache.batik.util*.jar +org.apache.commons.codec*.jar +org.apache.commons.io*.jar +org.apache.commons.jxpath*.jar +org.apache.commons.logging*.jar +org.apache.felix.gogo.command*.jar +org.apache.felix.gogo.runtime*.jar +org.apache.felix.gogo.shell*.jar +org.apache.felix.scr*.jar +org.apache.lucene.analyzers-common*.jar +org.apache.lucene.analyzers-smartcn*.jar +org.apache.lucene.core*.jar +org.apache.xmlgraphics*.jar +org.glassfish.web.javax.servlet.jsp*.jar +org.kxml2*.jar +org.sat4j.core*.jar +org.sat4j.pb*.jar +org.tukaani.xz*.jar +org.w3c.css.sac*.jar +org.w3c.dom.svg*.jar +org.xmlpull*.jar +" + +# these JARs are in subdirectories within JAVA_DIR +JMC_COMMON_JAR="org.openjdk.jmc.common_*.jar" +JMC_JFR_JAR="org.openjdk.jmc.flightrecorder_*.jar" +JMC_JFR_RULES_JAR="org.openjdk.jmc.flightrecorder.rules_*.jar" +JMC_JFR_RULES_JDK_JAR="org.openjdk.jmc.flightrecorder.rules.jdk_*.jar" +OWASP_JAR="org.owasp.encoder*.jar" +ICU4J_JAR="com.ibm.icu_*.jar" +JAVAMAIL_JAR="com.sun.mail.jakarta.mail_*.jar" +JAF_JAR="com.sun.activation.jakarta.activation_*.jar" +JAF_API_JAR="jakarta.activation-api_*.jar" +HTTP_CORE_JAR="org.apache.httpcomponents.httpcore_*.jar" +HTTP_CLIENT_JAR="org.apache.httpcomponents.httpclient_*.jar" +JAVAX_ANNOTAION_JAR="javax.annotation-api*.jar" + +# org.eclipse.equinox.launcher determines what launches (don't symlink this jar) + +function _sym { + if [ -f $1 ] + then + echo "linking $1 to $2" + rm -rf $1 + ln -s $2 $1 + else + echo "failed to link $1 to $2" + exit 1 + fi +} + +for name in ${JARS}; do + for i in ${name}; do + echo $i + done +done + +pushd $1 + for name in ${JARS}; do + for i in ${name}; do + if [ -e ${ECLIPSE_DIR}/$i ]; then + echo ${ECLIPSE_DIR}/$i + _sym $i ${ECLIPSE_DIR}/$i + elif [ -e ${JAVA_DIR}/$i ]; then + echo ${JAVA_DIR}/$i + _sym $i ${JAVA_DIR}/$i + fi + done + done + for name in ${JMC_COMMON_JAR}; do + _sym $name ${JMCCORE_DIR}/common.jar + done + for name in ${JMC_JFR_JAR}; do + _sym $name ${JMCCORE_DIR}/flightrecorder.jar + done + for name in ${JMC_JFR_RULES_JAR}; do + _sym $name ${JMCCORE_DIR}/flightrecorder.rules.jar + done + for name in ${JMC_JFR_RULES_JDK_JAR}; do + _sym $name ${JMCCORE_DIR}/flightrecorder.rules.jdk.jar + done + for name in ${OWASP_JAR}; do + _sym $name ${OWASP_DIR}/encoder.jar + done + for name in ${ICU4J_JAR}; do + _sym $name ${ICU4J_DIR}/icu4j.jar + done + for name in ${JAVAMAIL_JAR}; do + _sym $name ${JAVAMAIL_DIR}/jakarta.mail.jar + done + for name in ${JAF_JAR}; do + _sym $name ${JAF_DIR}/jakarta.activation.jar + done + for name in ${JAF_API_JAR}; do + _sym $name ${JAF_DIR}/jakarta.activation-api.jar + done + for name in ${HTTP_CORE_JAR}; do + _sym $name ${HTTPCOMPONENTS_DIR}/httpcore.jar + done + for name in ${HTTP_CLIENT_JAR}; do + _sym $name ${HTTPCOMPONENTS_DIR}/httpclient.jar + done + for name in ${JAVAX_ANNOTAION_JAR}; do + _sym $name ${JAVA_DIR}/glassfish-annotation-api.jar + done +popd +