Fix whitespace in spec file

This commit is contained in:
Andrew Hughes 2022-07-08 02:44:46 +01:00
parent f94bceceab
commit 47c2f1ddce
1 changed files with 89 additions and 86 deletions

View File

@ -1962,41 +1962,41 @@ function installjdk() {
local imagepath=${1} local imagepath=${1}
if [ -d ${imagepath} ] ; then if [ -d ${imagepath} ] ; then
# the build (erroneously) removes read permissions from some jars # the build (erroneously) removes read permissions from some jars
# this is a regression in OpenJDK 7 (our compiler): # this is a regression in OpenJDK 7 (our compiler):
# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437 # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
find ${imagepath} -iname '*.jar' -exec chmod ugo+r {} \; find ${imagepath} -iname '*.jar' -exec chmod ugo+r {} \;
# Build screws up permissions on binaries # Build screws up permissions on binaries
# https://bugs.openjdk.java.net/browse/JDK-8173610 # https://bugs.openjdk.java.net/browse/JDK-8173610
find ${imagepath} -iname '*.so' -exec chmod +x {} \; find ${imagepath} -iname '*.so' -exec chmod +x {} \;
find ${imagepath}/bin/ -exec chmod +x {} \; find ${imagepath}/bin/ -exec chmod +x {} \;
# Install nss.cfg right away as we will be using the JRE above # Install nss.cfg right away as we will be using the JRE above
install -m 644 nss.cfg ${imagepath}/conf/security/ install -m 644 nss.cfg ${imagepath}/conf/security/
# Install nss.fips.cfg: NSS configuration for global FIPS mode (crypto-policies) # Install nss.fips.cfg: NSS configuration for global FIPS mode (crypto-policies)
install -m 644 nss.fips.cfg ${imagepath}/conf/security/ install -m 644 nss.fips.cfg ${imagepath}/conf/security/
# Turn on system security properties # Turn on system security properties
sed -i -e "s:^security.useSystemPropertiesFile=.*:security.useSystemPropertiesFile=true:" \ sed -i -e "s:^security.useSystemPropertiesFile=.*:security.useSystemPropertiesFile=true:" \
${imagepath}/conf/security/java.security ${imagepath}/conf/security/java.security
# Use system-wide tzdata # Use system-wide tzdata
mv ${imagepath}/lib/tzdb.dat{,.upstream} mv ${imagepath}/lib/tzdb.dat{,.upstream}
ln -sv %{_datadir}/javazi-1.8/tzdb.dat ${imagepath}/lib/tzdb.dat ln -sv %{_datadir}/javazi-1.8/tzdb.dat ${imagepath}/lib/tzdb.dat
# Rename OpenJDK cacerts database # Rename OpenJDK cacerts database
mv ${imagepath}/lib/security/cacerts{,.upstream} mv ${imagepath}/lib/security/cacerts{,.upstream}
# Install cacerts symlink needed by some apps which hard-code the path # Install cacerts symlink needed by some apps which hard-code the path
ln -sv /etc/pki/java/cacerts ${imagepath}/lib/security ln -sv /etc/pki/java/cacerts ${imagepath}/lib/security
# Create fake alt-java as a placeholder for future alt-java # Create fake alt-java as a placeholder for future alt-java
pushd ${imagepath} pushd ${imagepath}
# add alt-java man page # add alt-java man page
echo "Hardened java binary recommended for launching untrusted code from the Web e.g. javaws" > man/man1/%{alt_java_name}.1 echo "Hardened java binary recommended for launching untrusted code from the Web e.g. javaws" > man/man1/%{alt_java_name}.1
cat man/man1/java.1 >> man/man1/%{alt_java_name}.1 cat man/man1/java.1 >> man/man1/%{alt_java_name}.1
popd popd
fi fi
} }
@ -2007,58 +2007,58 @@ function debugcheckjdk() {
if [ -d ${imagepath} ] ; then if [ -d ${imagepath} ] ; then
so_suffix="so" so_suffix="so"
# Check debug symbols are present and can identify code # Check debug symbols are present and can identify code
find "${imagepath}" -iname "*.$so_suffix" -print0 | while read -d $'\0' lib find "${imagepath}" -iname "*.$so_suffix" -print0 | while read -d $'\0' lib
do do
if [ -f "$lib" ] ; then if [ -f "$lib" ] ; then
echo "Testing $lib for debug symbols" echo "Testing $lib for debug symbols"
# All these tests rely on RPM failing the build if the exit code of any set # All these tests rely on RPM failing the build if the exit code of any set
# of piped commands is non-zero. # of piped commands is non-zero.
# Test for .debug_* sections in the shared object. This is the main test # Test for .debug_* sections in the shared object. This is the main test
# Stripped objects will not contain these # Stripped objects will not contain these
eu-readelf -S "$lib" | grep "] .debug_" eu-readelf -S "$lib" | grep "] .debug_"
test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2 test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2
# Test FILE symbols. These will most likely be removed by anything that # Test FILE symbols. These will most likely be removed by anything that
# manipulates symbol tables because it's generally useless. So a nice test # manipulates symbol tables because it's generally useless. So a nice test
# that nothing has messed with symbols # that nothing has messed with symbols
old_IFS="$IFS" old_IFS="$IFS"
IFS=$'\n' IFS=$'\n'
for line in $(eu-readelf -s "$lib" | grep "00000000 0 FILE LOCAL DEFAULT") for line in $(eu-readelf -s "$lib" | grep "00000000 0 FILE LOCAL DEFAULT")
do do
# We expect to see .cpp files, except for architectures like aarch64 and # We expect to see .cpp files, except for architectures like aarch64 and
# s390 where we expect .o and .oS files # s390 where we expect .o and .oS files
echo "$line" | grep -E "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$" echo "$line" | grep -E "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$"
done done
IFS="$old_IFS" IFS="$old_IFS"
# If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking # If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking
if [ "`basename $lib`" = "libjvm.so" ]; then if [ "`basename $lib`" = "libjvm.so" ]; then
eu-readelf -s "$lib" | \ eu-readelf -s "$lib" | \
grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$" grep -E "00000000 0 FILE LOCAL DEFAULT ABS javaCalls.(cpp|o)$"
fi fi
# Test that there are no .gnu_debuglink sections pointing to another # Test that there are no .gnu_debuglink sections pointing to another
# debuginfo file. There shouldn't be any debuginfo files, so the link makes # debuginfo file. There shouldn't be any debuginfo files, so the link makes
# no sense either # no sense either
eu-readelf -S "$lib" | grep 'gnu' eu-readelf -S "$lib" | grep 'gnu'
if eu-readelf -S "$lib" | grep "\] .gnu_debuglink" | grep PROGBITS; then if eu-readelf -S "$lib" | grep "\] .gnu_debuglink" | grep PROGBITS; then
echo "bad .gnu_debuglink section." echo "bad .gnu_debuglink section."
eu-readelf -x .gnu_debuglink "$lib" eu-readelf -x .gnu_debuglink "$lib"
false false
fi fi
fi fi
done done
# Make sure gdb can do a backtrace based on line numbers on libjvm.so # Make sure gdb can do a backtrace based on line numbers on libjvm.so
# javaCalls.cpp:58 should map to: # javaCalls.cpp:58 should map to:
# http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58 # http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58
# Using line number 1 might cause build problems. See: # Using line number 1 might cause build problems. See:
# https://bugzilla.redhat.com/show_bug.cgi?id=1539664 # https://bugzilla.redhat.com/show_bug.cgi?id=1539664
# https://bugzilla.redhat.com/show_bug.cgi?id=1538767 # https://bugzilla.redhat.com/show_bug.cgi?id=1538767
gdb -q "${imagepath}/bin/java" <<EOF | tee gdb.out gdb -q "${imagepath}/bin/java" <<EOF | tee gdb.out
handle SIGSEGV pass nostop noprint handle SIGSEGV pass nostop noprint
handle SIGILL pass nostop noprint handle SIGILL pass nostop noprint
set breakpoint pending on set breakpoint pending on
@ -2070,7 +2070,7 @@ end
run -version run -version
EOF EOF
%ifarch %{gdb_arches} %ifarch %{gdb_arches}
grep 'JavaCallWrapper::JavaCallWrapper' gdb.out grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
%endif %endif
fi fi
@ -2572,6 +2572,9 @@ cjc.mainProgram(args)
%endif %endif
%changelog %changelog
* Fri Jul 08 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:18.0.1.0.10-7.rolling
- Fix whitespace in spec file
* Fri Jul 08 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:18.0.1.0.10-7.rolling * Fri Jul 08 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:18.0.1.0.10-7.rolling
- Sequence spec file sections as they are run by rpmbuild (build, install then test) - Sequence spec file sections as they are run by rpmbuild (build, install then test)