From 1b05b0ca2a1c58fa9eeee68440d19506bb238846 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Sun, 8 Aug 2021 05:21:18 +0100 Subject: [PATCH] Remove non-Free test and demo files from source tarball. --- .gitignore | 1 + generate_source_tarball.sh | 61 +++++++++++++++++++++++++++++--------- java-1.8.0-openjdk.spec | 9 ++++-- jconsole-plugin.patch | 31 +++++++++++++++++++ sources | 2 +- 5 files changed, 86 insertions(+), 18 deletions(-) create mode 100644 jconsole-plugin.patch diff --git a/.gitignore b/.gitignore index a4aa037..67c9eb6 100644 --- a/.gitignore +++ b/.gitignore @@ -238,3 +238,4 @@ /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u302-b06-4curve.tar.xz /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u302-b07-4curve.tar.xz /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u302-b08-4curve.tar.xz +/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u302-b08-4curve-clean.tar.xz diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index 94b75e7..e9eed11 100755 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -19,12 +19,25 @@ # level folder, name is created, based on parameter # +SCRIPT_DIR=$(dirname $0) +JCONSOLE_JS_PATCH_DEFAULT=${SCRIPT_DIR}/jconsole-plugin.patch + if [ ! "x$PR3822" = "x" ] ; then if [ ! -f "$PR3822" ] ; then - echo "You have specified PR3822 as $PR3822 but it does not exists. exiting" + echo "You have specified PR3822 as $PR3822 but it does not exist. Exiting" exit 1 fi fi + +if [ "x${JCONSOLE_JS_PATCH}" != "x" ] ; then + if [ ! -f "${JCONSOLE_JS_PATCH}" ] ; then + echo "You have specified the jconsole.js patch as ${JCONSOLE_JS_PATCH} but it does not exist. Exiting."; + exit 2; + fi +else + JCONSOLE_JS_PATCH=${JCONSOLE_JS_PATCH_DEFAULT} +fi + set -e OPENJDK_URL_DEFAULT=http://hg.openjdk.java.net @@ -42,6 +55,7 @@ if [ "x$1" = "xhelp" ] ; then echo "FILE_NAME_ROOT - name of the archive, minus extensions (optional; defaults to PROJECT_NAME-REPO_NAME-VERSION)" echo "REPO_ROOT - the location of the Mercurial repository to archive (optional; defaults to OPENJDK_URL/PROJECT_NAME/REPO_NAME)" echo "PR3822 - the path to the PR3822 patch to apply (optional; downloaded if unavailable)" + echo "JCONSOLE_JS_PATCH - the path to a patch to fix non-availiability of jconsole.js (optional; defaults to ${JCONSOLE_JS_PATCH_DEFAULT})" echo "REPOS - specify the repositories to use (optional; defaults to ${REPOS_DEFAULT})" exit 1; fi @@ -88,6 +102,22 @@ if [ "x$REPO_ROOT" = "x" ] ; then REPO_ROOT="${OPENJDK_URL}/${PROJECT_NAME}/${REPO_NAME}" echo "No repository root specified; default to ${REPO_ROOT}" fi; +if [ "x$REPOS" = "x" ] ; then + REPOS=${REPOS_DEFAULT} + echo "No repositories specified; defaulting to ${REPOS}" +fi; + +echo -e "Settings:" +echo -e "\tVERSION: ${VERSION}" +echo -e "\tPROJECT_NAME: ${PROJECT_NAME}" +echo -e "\tREPO_NAME: ${REPO_NAME}" +echo -e "\tOPENJDK_URL: ${OPENJDK_URL}" +echo -e "\tCOMPRESSION: ${COMPRESSION}" +echo -e "\tFILE_NAME_ROOT: ${FILE_NAME_ROOT}" +echo -e "\tREPO_ROOT: ${REPO_ROOT}" +echo -e "\tPR3822: ${PR3822}" +echo -e "\tJCONSOLE_JS_PATCH: ${JCONSOLE_JS_PATCH}" +echo -e "\tREPOS: ${REPOS}" mkdir "${FILE_NAME_ROOT}" pushd "${FILE_NAME_ROOT}" @@ -96,22 +126,22 @@ echo "Cloning ${VERSION} root repository from ${REPO_ROOT}" hg clone ${REPO_ROOT} openjdk -r ${VERSION} pushd openjdk - -if [ "x$REPOS" = "x" ] ; then - repos=${REPOS_DEFAULT} - echo "No repositories specified; defaulting to ${repos}" -else - repos=$REPOS - echo "Repositories: ${repos}" -fi; - -for subrepo in $repos +for subrepo in ${REPOS} do echo "Cloning ${VERSION} ${subrepo} repository from ${REPO_ROOT}" hg clone ${REPO_ROOT}/${subrepo} -r ${VERSION} done -if [ -d jdk ]; then +# UnderlineTaglet.java has a BSD license with a field-of-use restriction, making it non-Free +if [ -d langtools ] ; then + echo "Removing langtools test case with non-Free license" + rm -vf langtools/test/tools/javadoc/api/basic/TagletPathTest.java + rm -vf langtools/test/tools/javadoc/api/basic/taglets/UnderlineTaglet.java +fi +if [ -d jdk ]; then +# jconsole.js has a BSD license with a field-of-use restriction, making it non-Free +echo "Removing jconsole-plugin file with non-Free license" +rm -vf jdk/src/share/demo/scripting/jconsole-plugin/src/resources/jconsole.js echo "Removing EC source code we don't build" rm -vf jdk/src/share/native/sun/security/ec/impl/ec2.h rm -vf jdk/src/share/native/sun/security/ec/impl/ec2_163.c @@ -123,7 +153,6 @@ rm -vf jdk/src/share/native/sun/security/ec/impl/ecp_192.c rm -vf jdk/src/share/native/sun/security/ec/impl/ecp_224.c echo "Syncing EC list with NSS" - if [ "x$PR3822" = "x" ] ; then # get pr3822.patch (from http://icedtea.classpath.org/hg/icedtea8) from most correct tag # Do not push it or publish it (see http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=3822) @@ -135,6 +164,10 @@ else patch -Np1 < $PR3822 fi; fi + +echo "Patching out use of jconsole.js" +patch -Np1 < ${JCONSOLE_JS_PATCH} + find . -name '*.orig' -exec rm -vf '{}' ';' popd @@ -144,7 +177,7 @@ if [ "X$COMPRESSION" = "Xxz" ] ; then else SWITCH=czf fi -TARBALL_NAME=${FILE_NAME_ROOT}-4curve.tar.${COMPRESSION} +TARBALL_NAME=${FILE_NAME_ROOT}-4curve-clean.tar.${COMPRESSION} tar --exclude-vcs -$SWITCH ${TARBALL_NAME} openjdk mv ${TARBALL_NAME} .. diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index b5067ff..53718f7 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -309,7 +309,7 @@ %global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) # eg jdk8u60-b27 -> b27 %global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-}) -%global rpmrelease 0 +%global rpmrelease 1 # Define milestone (EA for pre-releases, GA ("fcs") for releases) # Release will be (where N is usually a number starting at 1): # - 0.N%%{?extraver}%%{?dist} for EA releases, @@ -1202,7 +1202,7 @@ Provides: java-%{origin}-src%{?1} = %{epoch}:%{version}-%{release} Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever}.%{buildver} -Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}.1 +Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist} # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -1237,7 +1237,7 @@ URL: http://openjdk.java.net/ # FILE_NAME_ROOT=%%{shenandoah_project}-%%{shenandoah_repo}-${VERSION} # REPO_ROOT= generate_source_tarball.sh # where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo} -Source0: %{shenandoah_project}-%{shenandoah_repo}-%{shenandoah_revision}-4curve.tar.xz +Source0: %{shenandoah_project}-%{shenandoah_repo}-%{shenandoah_revision}-4curve-clean.tar.xz # Custom README for -src subpackage Source2: README.md @@ -2580,6 +2580,9 @@ cjc.mainProgram(args) %endif %changelog +* Sun Aug 08 2021 Andrew Hughes - 1:1.8.0.302.b08-1 +- Remove non-Free test and demo files from source tarball. + * Thu Jul 22 2021 Fedora Release Engineering - 1:1.8.0.302.b08-0.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/jconsole-plugin.patch b/jconsole-plugin.patch new file mode 100644 index 0000000..b015a78 --- /dev/null +++ b/jconsole-plugin.patch @@ -0,0 +1,31 @@ +diff --git openjdk.orig/jdk/src/share/demo/scripting/jconsole-plugin/README.txt openjdk/jdk/src/share/demo/scripting/jconsole-plugin/README.txt +--- openjdk.orig/jdk/src/share/demo/scripting/jconsole-plugin/README.txt ++++ openjdk/jdk/src/share/demo/scripting/jconsole-plugin/README.txt +@@ -18,11 +18,9 @@ + engine javax.script.ScriptEngine + plugin com.sun.tools.jconsole.JConsolePlugin + +-If you use JavaScript, there are many useful global functions defined in +-./src/resources/jconsole.js. This is built into the script plugin jar file. +-In addition, you can add other global functions and global variables by +-defining those in ~/jconsole.js (or jconsole. where is the file +-extension for your scripting language of choice under your home directory). ++You can add global functions and global variables by defining those in ++~/jconsole.js (or jconsole. where is the file extension for ++your scripting language of choice under your home directory). + + How do I compile script console plugin? + +diff --git openjdk.orig/jdk/src/share/demo/scripting/jconsole-plugin/build.xml openjdk/jdk/src/share/demo/scripting/jconsole-plugin/build.xml +--- openjdk.orig/jdk/src/share/demo/scripting/jconsole-plugin/build.xml ++++ openjdk/jdk/src/share/demo/scripting/jconsole-plugin/build.xml +@@ -73,9 +73,6 @@ + + + +- +- +- + + + diff --git a/sources b/sources index 0357887..3236329 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (tapsets-icedtea-3.15.0.tar.xz) = c752a197cb3d812d50c35e11e4722772be40096c81d2a57933e0d9b8a3c708b9c157b8108a4e33a06ca7bb81648170994408c75d6f69d5ff12785d0c31009671 -SHA512 (aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u302-b08-4curve.tar.xz) = 938b3308357c5be40fd474e861f5a612e758520988588b633791ada742fdaef522ecc05f4b2a0c40799a01e1b5d33960c1b76deb2089e36b6d92b0788a74bf74 +SHA512 (aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u302-b08-4curve-clean.tar.xz) = 04ecdcde841038c0042b44fb3c5303a08616864566fb918ab261fc381fae8804a21f875b1645538e864a1c6db5985f16dfc13b91eb1caeeab54d6d07828c7657