diff --git a/generate_source_tarball.sh b/generate_source_tarball.sh index d4e16ba..32dd399 100644 --- a/generate_source_tarball.sh +++ b/generate_source_tarball.sh @@ -7,9 +7,16 @@ # if you wont to use local copy of patch PR2126 set path to it to PR2126 variable # # In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg: -# PROJECT_NAME=jdk9 -# REPO_NAME=jdk9 -# VERSION=inDevelopment (but keyword tip will still do its job) +# PROJECT_NAME=jdk +# REPO_NAME=jdk +# VERSION=tip +# or to eg prepare systemtap: +# icedtea7's jstack and other tapsets +# VERSION=6327cf1cea9e +# REPO_NAME=icedtea7-2.6 +# PROJECT_NAME=release +# OPENJDK_URL=http://icedtea.classpath.org/hg/ +# TO_COMPRESS="*/tapset" # # They are used to create correct name and are used in construction of sources url (unless REPO_ROOT is set) @@ -25,6 +32,7 @@ if [ ! "x$PR2126" = "x" ] ; then exit 1 fi fi + set -e OPENJDK_URL_DEFAULT=http://hg.openjdk.java.net @@ -39,8 +47,8 @@ if [ "x$1" = "xhelp" ] ; then echo "COMPRESSION - the compression type to use (optional; defaults to ${COMPRESSION_DEFAULT})" 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 "TO_COMPRESS - what part of clone to pack (default is openjdk)" echo "PR2126 - the path to the PR2126 patch to apply (optional; downloaded if unavailable)" - echo "REPOS - specify the repositories to use (optional; defaults to ${REPOS_DEFAULT})" exit 1; fi @@ -87,10 +95,15 @@ if [ "x$REPO_ROOT" = "x" ] ; then echo "No repository root specified; default to ${REPO_ROOT}" fi; +if [ "x$TO_COMPRESS" = "x" ] ; then + TO_COMPRESS="openjdk" + echo "No to be compressed targets specified, ; default to ${TO_COMPRESS}" +fi; + if [ -d ${FILE_NAME_ROOT} ] ; then - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - echo "${FILE_NAME_ROOT} exists, reusing !!!!!!!" - echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "exists exists exists exists exists exists exists " + echo "reusing reusing reusing reusing reusing reusing " + echo ${FILE_NAME_ROOT} else mkdir "${FILE_NAME_ROOT}" pushd "${FILE_NAME_ROOT}" @@ -99,33 +112,34 @@ else popd fi pushd "${FILE_NAME_ROOT}" - pushd openjdk - if [ -d src ]; then - echo "Removing EC source code we don't build" - CRYPTO_PATH=src/jdk.crypto.ec/share/native/libsunec/impl - rm -vrf $CRYPTO_PATH - echo "Syncing EC list with NSS" - if [ "x$PR2126" = "x" ] ; then - # orriginally for 8: - # get pr2126.patch (from http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=8d2c9a898f50) from most correct tag - # Do not push it or publish it (see http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2126) - # there is currnetly no "upstram version of this patch, hardcoding custom version - PR2126="../../pr2126-10.patch" - fi; - echo "Applying ${PR2126}" - patch -Np1 < $PR2126 + if [ -d openjdk/src ]; then + pushd openjdk + echo "Removing EC source code we don't build" + CRYPTO_PATH=src/jdk.crypto.ec/share/native/libsunec/impl + rm -vrf $CRYPTO_PATH + echo "Syncing EC list with NSS" + if [ "x$PR2126" = "x" ] ; then + # orriginally for 8: + # get pr2126.patch (from http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=8d2c9a898f50) from most correct tag + # Do not push it or publish it (see http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2126) + # there is currnetly no "upstram version of this patch, hardcoding custom version + PR2126="../../pr2126-10.patch" + fi; + echo "Applying ${PR2126}" + patch -Np1 < $PR2126 + find . -name '*.orig' -exec rm -vf '{}' ';' + popd fi - find . -name '*.orig' -exec rm -vf '{}' ';' - popd - echo "Compressing remaining forest" - if [ "X$COMPRESSION" = "Xxz" ] ; then - tar --exclude-vcs -cJf ${FILE_NAME_ROOT}.tar.${COMPRESSION} openjdk - else - tar --exclude-vcs -czf ${FILE_NAME_ROOT}.tar.${COMPRESSION} openjdk - fi - mv ${FILE_NAME_ROOT}.tar.${COMPRESSION} .. + echo "Compressing remaining forest" + if [ "X$COMPRESSION" = "Xxz" ] ; then + SWITCH=cJf + else + SWITCH=czf + fi + tar --exclude-vcs -$SWITCH ${FILE_NAME_ROOT}.tar.${COMPRESSION} $TO_COMPRESS + mv ${FILE_NAME_ROOT}.tar.${COMPRESSION} .. popd -echo "Done. You may want to remove the uncompressed version." +echo "Done. You may want to remove the uncompressed version - $FILE_NAME_ROOT." diff --git a/generate_tarballs.sh b/generate_tarballs.sh deleted file mode 100644 index 0c5930d..0000000 --- a/generate_tarballs.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -VERSION=3506c375241e -ICEDTEA_URL=http://icedtea.classpath.org/hg/icedtea7/ - -wget -O icedtea7.tar.gz ${ICEDTEA_URL}/archive/${VERSION}.tar.gz -tar xzf icedtea7.tar.gz -rm -f icedtea7.tar.gz -pushd icedtea7-${VERSION} - -# desktop files -#mv jconsole.desktop ../jconsole.desktop.in -#mv policytool.desktop ../policytool.desktop.in -# Icons were generally cloned fromicedtea, but now are mucvh more specific - -# tapsets -mv tapset/hotspot{,-1.8.0}.stp.in || exit 1 -mv tapset/hotspot_gc{,-1.8.0}.stp.in || exit 1 -mv tapset/hotspot_jni{,-1.8.0}.stp.in || exit 1 -mv tapset/jstack{,-1.8.0}.stp.in || exit 1 -tar cvzf systemtap-tapset.tar.gz tapset -mv systemtap-tapset.tar.gz ../ - -popd -rm -rf icedtea7-${VERSION} diff --git a/java-openjdk.spec b/java-openjdk.spec index 3083f07..2f83dc9 100644 --- a/java-openjdk.spec +++ b/java-openjdk.spec @@ -23,7 +23,7 @@ # note: parametrized macros are order-sensitive (unlike not-parametrized) even with normal macros # also necessary when passing it as parameter to other macros. If not macro, then it is considered a switch -# see the difference between global and deffine: +# see the difference between global and define: # See https://github.com/rpm-software-management/rpm/issues/127 to comments at "pmatilai commented on Aug 18, 2017" # (initiated in https://bugzilla.redhat.com/show_bug.cgi?id=1482192) %global debug_suffix_unquoted -slowdebug @@ -95,8 +95,9 @@ %global targets all docs %endif + # Filter out flags from the optflags macro that cause problems with the OpenJDK build -# We filter out -O flags so that the optimisation of HotSpot is not lowered from O3 to O2 +# We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2 # We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs) # We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings # We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++ @@ -105,7 +106,7 @@ %global ourldflags %{__global_ldflags} # With disabled nss is NSS deactivated, so NSS_LIBDIR can contain the wrong path -# the initialisation must be here. Later the pkg-config have buggy behaviour +# the initialization must be here. Later the pkg-config have buggy behavior # looks like openjdk RPM specific bug # Always set this so the nss.cfg file is not broken %global NSS_LIBDIR %(pkg-config --variable=libdir nss) @@ -199,7 +200,6 @@ %global newjavaver %{majorver}.%{minorver}.%{securityver} %global javaver %{majorver} -%global systemtap_javaver 9 # parametrized macros are order-sensitive %global compatiblename java-%{majorver}-%{origin} @@ -226,9 +226,9 @@ %if %{with_systemtap} # Where to install systemtap tapset (links) -# We would like these to be in a package specific subdir, +# We would like these to be in a package specific sub-dir, # but currently systemtap doesn't support that, so we have to -# use the root tapset dir for now. To distinquish between 64 +# use the root tapset dir for now. To distinguish between 64 # and 32 bit architectures we place the tapsets under the arch # specific dir (note that systemtap will only pickup the tapset # for the primary arch for now). Systemtap uses the machine name @@ -308,7 +308,7 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : # see pretrans where this file is declared -# also see that pretrans is only for nondebug +# also see that pretrans is only for non-debug if [ ! "%{?1}" == %{debug_suffix} ]; then if [ -f %{_libexecdir}/copy_jdk_configs_fixFiles.sh ] ; then sh %{_libexecdir}/copy_jdk_configs_fixFiles.sh %{rpm_state_dir}/%{name}.%{_arch} %{_jvmdir}/%{sdkdir -- %{?1}} @@ -509,7 +509,6 @@ exit 0 %define files_jre_headless() %{expand: -%defattr(-,root,root,-) %license %{_jvmdir}/%{sdkdir -- %{?1}}/legal %dir %{_sysconfdir}/.java/.systemPrefs %dir %{_sysconfdir}/.java @@ -617,14 +616,11 @@ exit 0 %config(noreplace) %{etcjavadir -- %{?1}}/conf/management/management.properties %config(noreplace) %{etcjavadir -- %{?1}}/conf/net.properties %config(noreplace) %{etcjavadir -- %{?1}}/conf/sound.properties -# accessibility have package over user maintainnce, so not config-norepalce -%config %{etcjavadir -- %{?1}}/conf/accessibility.properties %{_jvmdir}/%{sdkdir -- %{?1}}/conf %{_jvmdir}/%{sdkdir -- %{?1}}/lib/security } %define files_devel() %{expand: -%defattr(-,root,root,-) %dir %{_jvmdir}/%{sdkdir -- %{?1}}/bin %{_jvmdir}/%{sdkdir -- %{?1}}/bin/appletviewer %{_jvmdir}/%{sdkdir -- %{?1}}/bin/idlj @@ -698,31 +694,26 @@ exit 0 } %define files_jmods() %{expand: -%defattr(-,root,root,-) %{_jvmdir}/%{sdkdir -- %{?1}}/jmods } %define files_demo() %{expand: -%defattr(-,root,root,-) %license %{_jvmdir}/%{sdkdir -- %{?1}}/legal %{_jvmdir}/%{sdkdir -- %{?1}}/demo %{_jvmdir}/%{sdkdir -- %{?1}}/sample } %define files_src() %{expand: -%defattr(-,root,root,-) %license %{_jvmdir}/%{sdkdir -- %{?1}}/legal %{_jvmdir}/%{sdkdir -- %{?1}}/lib/src.zip } %define files_javadoc() %{expand: -%defattr(-,root,root,-) %doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}} %license %{buildoutputdir -- %{?1}}/images/%{jdkimage}/legal } %define files_javadoc_zip() %{expand: -%defattr(-,root,root,-) %doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip %license %{buildoutputdir -- %{?1}}/images/%{jdkimage}/legal } @@ -731,12 +722,13 @@ exit 0 %define java_rpo() %{expand: Requires: fontconfig%{?_isa} Requires: xorg-x11-fonts-Type1 - # Requires rest of java Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} +# for java-X-openjdk package's desktop binding +Recommends: gtk3%{?_isa} -Provides: java-%{javaver}-%{origin} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release} # Standard JPackage base provides Provides: jre = %{javaver}%{?1} @@ -751,9 +743,9 @@ Provides: java%{?1} = %{epoch}:%{javaver} %define java_headless_rpo() %{expand: # Require /etc/pki/java/cacerts Requires: ca-certificates -# Require javapackages-filesystem for ownership of /usr/lib/jvm/ +# Require javapackages-filesystem for ownership of /usr/lib/jvm/ and macros Requires: javapackages-filesystem -# Require zoneinfo data provided by tzdata-java sub-package +# Require zone-info data provided by tzdata-java sub-package Requires: tzdata-java >= 2015d # libsctp.so.1 is being `dlopen`ed on demand Requires: lksctp-tools%{?_isa} @@ -773,6 +765,8 @@ Requires(post): chkconfig >= 1.7 Requires(postun): %{_sbindir}/alternatives # in version 1.7 and higher for --family switch Requires(postun): chkconfig >= 1.7 +# for optional support of kernel stream control, card reader and printing bindings +Suggests: lksctp-tools%{?_isa}, pcsc-lite-devel%{?_isa}, cups # Standard JPackage base provides Provides: jre-headless%{?1} = %{epoch}:%{javaver} @@ -816,7 +810,7 @@ Provides: java-%{javaver}-%{origin}-devel%{?1} = %{epoch}:%{version} %define java_jmods_rpo() %{expand: # Requires devel package -# as jmods are bytecode, they should be ok without any _isa +# as jmods are bytecode, they should be OK without any _isa Requires: %{name}-devel%{?1} = %{epoch}:%{version}-%{release} OrderWithRequires: %{name}-headless%{?1} = %{epoch}:%{version}-%{release} @@ -867,7 +861,7 @@ Provides: java-%{javaver}-%{origin}-src%{?1} = %{epoch}:%{version}-%{release} Name: java-%{origin} Version: %{newjavaver}.%{buildver} -Release: 1%{?dist} +Release: 7%{?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 @@ -895,13 +889,11 @@ Group: Development/Languages License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib URL: http://openjdk.java.net/ -Source0: jdk-updates-jdk%{majorver}u-jdk-%{newjavaver}+%{buildver}.tar.xz -# Use 'generate_tarballs.sh' to generate the following tarballs -# They are based on code contained in the IcedTea7 project - -# Systemtap tapsets. Zipped up to keep it small -Source8: systemtap-tapset-3.6.0pre02.tar.xz +# to regenerate source0 (jdk) and source8 (jdk's taspets) run update_package.sh +# update_package.sh contains hard-coded repos, revisions, tags, and projects to regenerate the source archives +Source0: shenandoah-jdk%{majorver}-shenandoah-jdk-%{majorver}+%{buildver}.tar.xz +Source8: systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz # Desktop files. Adapted from IcedTea Source9: jconsole.desktop.in @@ -959,14 +951,14 @@ BuildRequires: alsa-lib-devel BuildRequires: binutils BuildRequires: cups-devel BuildRequires: desktop-file-utils -# elfutils only are ok for build without AOT +# elfutils only are OK for build without AOT BuildRequires: elfutils-devel BuildRequires: fontconfig BuildRequires: freetype-devel BuildRequires: giflib-devel BuildRequires: gcc-c++ BuildRequires: gdb -BuildRequires: gtk2-devel +BuildRequires: gtk3-devel BuildRequires: lcms2-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel @@ -981,9 +973,7 @@ BuildRequires: nss-devel BuildRequires: pkgconfig BuildRequires: xorg-x11-proto-devel BuildRequires: zip -# since we require only javapackages-filesystem we have to require whole javapackages-tools in build-time to have various _jvm macros expanded -# note, that this dependency is bringing current main JDK into buildroot -BuildRequires: javapackages-tools +BuildRequires: javapackages-filesystem BuildRequires: java-openjdk-devel # Zero-assembler build requirement %ifnarch %{jit_arches} @@ -1117,7 +1107,8 @@ Group: Development/Languages %{java_src_rpo %{nil}} %description src -The java-%{origin}-src sub-package contains the complete %{origin_nice} %{majorver} class library source code for use by IDE indexers and debuggers. +The java-%{origin}-src sub-package contains the complete %{origin_nice} %{majorver} +class library source code for use by IDE indexers and debuggers. %endif %if %{include_debug_build} @@ -1128,7 +1119,8 @@ Group: Development/Languages %{java_src_rpo -- %{debug_suffix_unquoted}} %description src-slowdebug -The java-%{origin}-src-slowdebug sub-package contains the complete %{origin_nice} %{majorver} class library source code for use by IDE indexers and debuggers. Debugging %{for_debug}. +The java-%{origin}-src-slowdebug sub-package contains the complete %{origin_nice} %{majorver} + class library source code for use by IDE indexers and debuggers. Debugging %{for_debug}. %endif %if %{include_normal_build} @@ -1225,7 +1217,7 @@ popd # openjdk # Extract systemtap tapsets %if %{with_systemtap} -tar -x -I xz -f %{SOURCE8} +tar --strip-components=1 -x -I xz -f %{SOURCE8} %if %{include_debug_build} cp -r tapset tapset%{debug_suffix} %endif @@ -1233,7 +1225,7 @@ cp -r tapset tapset%{debug_suffix} for suffix in %{build_loop} ; do for file in "tapset"$suffix/*.in; do - OUTPUT_FILE=`echo $file | sed -e "s:%{systemtap_javaver}\.stp\.in$:%{version}-%{release}.%{_arch}.stp:g"` + OUTPUT_FILE=`echo $file | sed -e "s:\.stp\.in$:%{version}-%{release}.%{_arch}.stp:g"` sed -e "s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/server/libjvm.so:g" $file > $file.1 # TODO find out which architectures other than i686 have a client vm %ifarch %{ix86} @@ -1269,7 +1261,7 @@ sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg %build -# How many cpu's do we have? +# How many CPU's do we have? export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=${NUM_PROC:-1} %if 0%{?_smp_ncpus_max} @@ -1308,6 +1300,9 @@ else debugbuild=`echo $suffix | sed "s/-//g"` fi +# Variable used in hs_err hook on build failures +top_dir_abs_path=$(pwd)/%{top_level_dir_name} + mkdir -p %{buildoutputdir -- $suffix} pushd %{buildoutputdir -- $suffix} @@ -1344,7 +1339,7 @@ make \ LOG=trace \ WARNINGS_ARE_ERRORS="-Wno-error" \ CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \ - %{targets} + %{targets} || ( pwd; find $top_dir_abs_path -name "hs_err_pid*.log" | xargs cat && false ) make docs-zip @@ -1505,12 +1500,12 @@ pushd %{buildoutputdir $suffix}/images/%{jdkimage} # Remove empty cacerts database rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/security/cacerts - # Install cacerts symlink needed by some apps which hardcode the path + # Install cacerts symlink needed by some apps which hard-code the path pushd $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/security ln -sf /etc/pki/java/cacerts . popd - # Install versioned symlinks + # Install version-ed symlinks pushd $RPM_BUILD_ROOT%{_jvmdir} ln -sf %{sdkdir -- $suffix} %{jrelnk -- $suffix} popd @@ -1561,12 +1556,6 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/.java/.systemPrefs # copy samples next to demos; samples are mostly js files cp -r %{top_level_dir_name}/src/sample $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/conf/ - echo "#Config file to enable java-atk-wrapper" > accessibility.properties - echo "" >> accessibility.properties - echo "assistive_technologies=org.GNOME.Accessibility.AtkWrapper" >> accessibility.properties - echo "" >> accessibility.properties -popd # moving config files to /etc mkdir -p $RPM_BUILD_ROOT/%{etcjavadir -- $suffix} @@ -1595,7 +1584,7 @@ done -- see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue -- see https://bugzilla.redhat.com/show_bug.cgi?id=1290388 for pretrans over pre -- if copy-jdk-configs is in transaction, it installs in pretrans to temp --- if copy_jdk_configs is in temp, then it means that copy-jdk-configs is in tranasction and so is +-- if copy_jdk_configs is in temp, then it means that copy-jdk-configs is in transaction and so is -- preferred over one in %%{_libexecdir}. If it is not in transaction, then depends -- whether copy-jdk-configs is installed or not. If so, then configs are copied -- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all @@ -1616,7 +1605,7 @@ local stat2 = posix.stat(SOURCE2, "type"); else if (stat2 ~= nil) then if (debug) then - print(SOURCE2 .." exists - copy-jdk-configs alrady installed and NOT in transation. Using.") + print(SOURCE2 .." exists - copy-jdk-configs already installed and NOT in transaction. Using.") end; package.path = package.path .. ";" .. SOURCE2 else @@ -1740,7 +1729,7 @@ require "copy_jdk_configs.lua" # this puts huge file to /usr/share # unluckily ti is really a documentation file -# and unluckily it really is archtecture-depndent, as ag aot and grail are now x86_64 only +# and unluckily it really is architecture-dependent, as eg. aot and grail are now x86_64 only # same for debug variant %files javadoc-zip %{files_javadoc_zip %{nil}} @@ -1774,6 +1763,12 @@ require "copy_jdk_configs.lua" %changelog +* Thu Aug 23 2018 Jiri Vanek - 1:10.0.3.13-6 +- dissabled accessibility, fixed provides for main package's debug variant +- now buildrequires javapackages-filesystem as the issue with macros should be fixed +- moved to versionless tapsets +- many small tweeks from ojdk11 + * Mon Jul 23 2018 Jiri Vanek - 1:10.0.3.13-1 - updated to security jdk10+3.13 - deleted patch106 JDK-8193802-npe-jar-getVersionMap.patch diff --git a/sources b/sources index e18a3a5..d6cbb37 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (systemtap-tapset-3.6.0pre02.tar.xz) = 848f42ef7ca751e723fd50e3a6da14c0965ad4da37ea3331568658e27497b7a7e4b9aad3dedd264ad0bb5566c37a92302b905f10258a4e2c89dc4ba609e55481 +SHA512 (systemtap_3.2_tapsets_hg-icedtea8-9d464368e06d.tar.xz) = cf578221b77d8c7e019f69909bc86c419c5fb5e10bceba9592ff6e7f96887b0a7f07c9cefe90800975247a078785ca190fdec5c2d0f841bb447cee784b570f7d SHA512 (jdk-updates-jdk10u-jdk-10.0.2+13.tar.xz) = e5de419cec42e376ce341126c64370211cb09f326cdfafc64cec52640d2a2780f3ee705d51b6d025af6ca74c1525ed8d4a9d9afbe5b45f9709dd4d2242f1af08 diff --git a/update_package.sh b/update_package.sh index 9750934..4adab49 100644 --- a/update_package.sh +++ b/update_package.sh @@ -1,184 +1,71 @@ #!/bin/bash -x -# Generates the 'source tarball' for JDK 8 projects and update spec infrastructure -# By default, this script regenerate source as they are currently used. -# so if the version of sources change, this file changes and is pushed -# -# In any case you have to set PROJECT_NAME REPO_NAME and VERSION. eg: -# PROJECT_NAME=jdk9 -# REPO_NAME=jdk9 -# VERSION=inDevelopment (but keyword tip will still do its job) -# -# If you don't, default are used and so already uploaded tarball regenerated -# They are used to create correct name and are used in construction of sources url (unless REPO_ROOT is set) -# -# For other useful variables see generate_source_tarball.sh -# -# the used values are then substituted to spec and sources - -if [ ! "x$PR2126" = "x" ] ; then - if [ ! -f "$PR2126" ] ; then - echo "You have specified PR2126 as $PR2126 but it does not exists. exiting" - exit 1 - fi -fi +# this file contains defaults for currently generated source tarballs set -e -if [ "x$PROJECT_NAME" = "x" ] ; then - PROJECT_NAME="jdk-updates" -fi -if [ "x$REPO_NAME" = "x" ] ; then - REPO_NAME="jdk10u" -fi -if [ "x$VERSION" = "x" ] ; then - VERSION="jdk-10.0.2+13" +# TAPSET +export PROJECT_NAME="hg" +export REPO_NAME="icedtea8" +export VERSION="9d464368e06d" +export COMPRESSION=xz +export OPENJDK_URL=http://icedtea.classpath.org +export FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} +export TO_COMPRESS="*/tapset" +# warning, filename and filenameroot creation is duplicated here from generate_source_tarball.sh +CLONED_FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION} +TAPSET_VERSION=3.2 +TAPSET=systemtap_"$TAPSET_VERSION"_tapsets_$CLONED_FILENAME +if [ ! -f ${TAPSET} ] ; then + if [ ! -f ${CLONED_FILENAME} ] ; then + echo "Generating ${CLONED_FILENAME}" + sh ./generate_source_tarball.sh + else + echo "exists exists exists exists exists exists exists " + echo "reusing reusing reusing reusing reusing reusing " + echo ${CLONED_FILENAME} + fi + mv -v $CLONED_FILENAME $TAPSET +else + echo "exists exists exists exists exists exists exists " + echo "reusing reusing reusing reusing reusing reusing " + echo ${TAPSET} fi -if [ "x$COMPRESSION" = "x" ] ; then -# rhel 5 needs tar.gz - COMPRESSION=xz -fi -if [ "x$FILE_NAME_ROOT" = "x" ] ; then - FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} -fi -#if [ "x$PKG" = "x" ] ; then -# URL=`cat .git/config | grep url` -# PKG=${URL##*/} -#fi -if [ "x$SPEC" = "x" ] ; then - SPEC=${PKG}.spec -fi -if [ "x$RELEASE" = "x" ] ; then - RELEASE=1 -fi +# OpenJDK from jdk10 updates project +export PROJECT_NAME="jdk-updates" +export REPO_NAME="jdk10u" +# warning, clonning without shenadnaoh suffix, you will clone pure jdk - thus without shenandaoh GC +export VERSION="jdk-10.0.2+13" +export COMPRESSION=xz +# unset tapsets overrides +export OPENJDK_URL="" +export TO_COMPRESS="" +# warning, filename and filenameroot creation is duplicated here from generate_source_tarball.sh +export FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} FILENAME=${FILE_NAME_ROOT}.tar.${COMPRESSION} if [ ! -f ${FILENAME} ] ; then echo "Generating ${FILENAME}" -. ./generate_source_tarball.sh + sh ./generate_source_tarball.sh else -echo "${FILENAME} already exists, using" + echo "exists exists exists exists exists exists exists " + echo "reusing reusing reusing reusing reusing reusing " + echo ${FILENAME} fi -echo "nothing more TBD for 10!!" -exit 0 +set +e -echo "Touching spec: $SPEC" -sed -i "s/^%global\s\+project.*/%global project ${PROJECT_NAME}/" $SPEC -sed -i "s/^%global\s\+repo.*/%global repo ${REPO_NAME}/" $SPEC -sed -i "s/^%global\s\+revision.*/%global revision ${VERSION}/" $SPEC -# updated sources, resetting release -sed -i "s/^Release:.*/Release: $RELEASE.%{buildver}%{?dist}/" $SPEC - -#https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Bash -function levenshtein { - if [ "$#" -ne "2" ]; then - echo "Usage: $0 word1 word2" >&2 - elif [ "${#1}" -lt "${#2}" ]; then - levenshtein "$2" "$1" - else - local str1len=$((${#1})) - local str2len=$((${#2})) - local d i j - for i in $(seq 0 $(((str1len+1)*(str2len+1)))); do - d[i]=0 - done - for i in $(seq 0 $((str1len))); do - d[$((i+0*str1len))]=$i - done - for j in $(seq 0 $((str2len))); do - d[$((0+j*(str1len+1)))]=$j - done - - for j in $(seq 1 $((str2len))); do - for i in $(seq 1 $((str1len))); do - [ "${1:i-1:1}" = "${2:j-1:1}" ] && local cost=0 || local cost=1 - local del=$((d[(i-1)+str1len*j]+1)) - local ins=$((d[i+str1len*(j-1)]+1)) - local alt=$((d[(i-1)+str1len*(j-1)]+cost)) - d[i+str1len*j]=$(echo -e "$del\n$ins\n$alt" | sort -n | head -1) - done - done - echo ${d[str1len+str1len*(str2len)]} - fi -} -# generate shenandoah hotspot -# that means supply the underlying script with new values -# to new filename. -MAIN_VERSION=$VERSION -if [ "x$VERSION" = "xtip" ] ; then - VERSION="tip" -else - #hardcoding version for anything else except tip - VERSION="aarch64-shenandoah-jdk8u131-b12-shenandoah-merge-2017-04-20" -fi -MAIN_REPO_NAME=$REPO_NAME -REPO_NAME=jdk8u-shenandoah -MAIN_FILE_NAME_ROOT=$FILE_NAME_ROOT -FILE_NAME_ROOT=${PROJECT_NAME}-${REPO_NAME}-${VERSION} -FILENAME_SH=${FILE_NAME_ROOT}.tar.${COMPRESSION} -REPOS="hotspot" - -if [ ! -f ${FILENAME_SH} ] ; then -echo "Generating ${FILENAME_SH}" -. ./generate_source_tarball.sh -else -echo "${FILENAME_SH} already exists, using" -fi - -sed -i "s/^Source1:.*/Source1: ${FILENAME_SH}/" $SPEC -git --no-pager diff $SPEC - -# find the most similar sources name and replace it by newly generated one. -echo "Old sources" -cat sources -a_sources=`cat sources | sed "s/.*(//g" | sed "s/).*//g" | sed "s/.*\s\+//g"` -winner="" -winnerDistance=999999 -for x in $a_sources ; do - distance=`levenshtein $x ${FILENAME}` - if [ $distance -lt $winnerDistance ] ; then - winner=$x - winnerDistance=$distance - fi -done -sum=`md5sum ${FILENAME}` -sed -i "s;.*$winner;$sum;" sources -# now shenandoah hotspot -winner="" -winnerDistance=999999 -for x in $a_sources ; do - distance=`levenshtein $x ${FILENAME_SH}` - if [ $distance -lt $winnerDistance ] ; then - winner=$x - winnerDistance=$distance - fi -done -sum=`md5sum ${FILENAME_SH}` -sed -i "s;.*$winner;$sum;" sources - -echo "New sources" -cat sources -a_sources=`cat sources | sed "s/.*(//g" | sed "s/).*//g" | sed "s/.*\s\+//g"` -echo " you can get inspired by following %changelog template:" -user_name=`whoami` -user_record=$(getent passwd $user_name) -user_gecos_field=$(echo "$user_record" | cut -d ':' -f 5) -user_full_name=$(echo "$user_gecos_field" | cut -d ',' -f 1) -spec_date=`date +"%a %b %d %Y"` -# See spec: -revision_helper=`echo ${MAIN_VERSION%-*}` -updatever=`echo ${revision_helper##*u}` -buildver=`echo ${MAIN_VERSION##*-}` -echo "* $spec_date $user_full_name <$user_name@redhat.com> - 1:1.8.0.$updatever-$RELEASE.$buildver" -echo "- updated to $MAIN_VERSION (from $PROJECT_NAME/$MAIN_REPO_NAME)" -echo "- updated to $VERSION (from $PROJECT_NAME/$REPO_NAME) of hotspot" -echo "- used $FILENAME as new sources" -echo "- used $FILENAME_SH as new sources for hotspot" - -echo " execute:" -echo "fedpkg/rhpkg new-sources "$a_sources -echo " to upload sources" -echo "you can verify by fedpkg/rhpkg prep --arch XXXX on all architectures: x86_64 i386 i586 i686 ppc ppc64 ppc64le s390 s390x aarch64 armv7hl" +major=`echo $REPO_NAME | sed 's/[a-zA-Z]*//g'` +build=`echo $VERSION | sed 's/.*+//g'` +name_helper=`echo $FILENAME | sed s/$major/'%{majorver}'/g ` +name_helper=`echo $name_helper | sed s/$build/'%{buildver}'/g ` +echo "align specfile acordingly:" +echo " sed 's/^Source0:.*/Source0: $name_helper/' -i *.spec" +echo " sed 's/^Source8:.*/Source8: $TAPSET/' -i *.spec" +echo " sed 's/^%global buildver.*/%global buildver $build/' -i *.spec" +echo " sed 's/Release:.*/Release: 1%{?dist}/' -i *.spec" +echo "and maybe others...." +echo "you should fedpkg/rhpkg new-sources $TAPSET $FILENAME" +echo "you should fedpkg/rhpkg prep --arch XXXX on all architectures: x86_64 i386 i586 i686 ppc ppc64 ppc64le s390 s390x aarch64 armv7hl"