--- a/SUNWgnome-a11y-libs.spec Tue Dec 16 09:40:38 2008 +0000
+++ b/SUNWgnome-a11y-libs.spec Tue Dec 16 10:00:50 2008 +0000
@@ -126,6 +126,67 @@
%libgail_gnome.install -d %name-%version/%base_arch
%if %option_with_java
%java_access_bridge.install -d %name-%version/%base_arch
+
+# Determine the full path (symlinks resolved) to JDK pointed to by /usr/java.
+BASEDIR=%{_basedir}
+cd $BASEDIR
+JAVADIR=java
+JDK_DIR=$BASEDIR
+# If $JAVADIR is a symlink then we must resolve it.
+if [ -d $JAVADIR -a -h $JAVADIR ]
+then
+ # Get symlink target.
+ DIR=`ls -l $JAVADIR | awk '{print $NF}'`
+ echo "DIR=$DIR"
+
+ # If the target is a symlink then need to resolve it.
+ if [ -d $DIR -a -h $DIR ]
+ then
+ nextdir=`dirname $DIR`
+ cd $nextdir
+ JDK_DIR="$JDK_DIR/$nextdir" # Append this bit.
+
+ f=`basename $DIR`
+ nextdir=`ls -l $f | awk '{print $NF}'`
+ JDK_DIR="$JDK_DIR/$nextdir"
+ else
+ # otherwise just append to $JDK_DIR and we're done.
+ JDK_DIR="$JDK_DIR/$DIR"
+ fi
+else
+ # If the 'java' item is not a symlink (presumably a dir) there will be no
+ # symlink to installf items to.
+ exit 2
+fi
+
+# Determine the full path (symlinks resolved) to JDK pointed to by /usr/java.
+
+mkdir -p ${RPM_BUILD_ROOT}/${JDK_DIR}/jre/lib/ext
+
+cd ${RPM_BUILD_ROOT}/${JDK_DIR}/jre/lib || exit 2
+# Dynamically determine number of '..' required.
+JAR_DIR=share/jar
+DOTS=.
+LEVEL=0
+FILE=accessibility.properties
+# Keep testing, up to a max of 10 levels to avoid infinite loop.
+while [ ! -f $DOTS/$JAR_DIR/$FILE ] && [ $LEVEL -lt 10 ]
+do
+ DOTS="$DOTS/.."
+ LEVEL=`expr $LEVEL + 1`
+done
+if [ -f $DOTS/$JAR_DIR/$FILE ]; then
+ rm -f ${RPM_BUILD_ROOT}/${JDK_DIR}/jre/lib/$FILE
+ ln -s $DOTS/$JAR_DIR/$FILE ${RPM_BUILD_ROOT}/${JDK_DIR}/jre/lib/$FILE || exit 2
+fi
+FILE=gnome-java-bridge.jar
+if [ -f $DOTS/$JAR_DIR/$FILE ]; then
+ rm -f ${RPM_BUILD_ROOT}/${JDK_DIR}/jre/lib/ext/$FILE
+ ln -s $DOTS/../$JAR_DIR/$FILE ${RPM_BUILD_ROOT}/${JDK_DIR}/jre/lib/ext/$FILE || exit 2
+fi
+
+cd %{_builddir}
+
%endif
%freetts.install -d %name-%version/%base_arch
%gnome_mag.install -d %name-%version/%base_arch
@@ -139,9 +200,9 @@
find $RPM_BUILD_ROOT -name '*.pyo' -exec rm {} \;
# Remove empty dir
-rmdir $RPM_BUILD_ROOT%{_datadir}/doc/gnome-mag-*/reference/html
-rmdir $RPM_BUILD_ROOT%{_datadir}/doc/gnome-mag-*/reference
-rmdir $RPM_BUILD_ROOT%{_datadir}/doc/gnome-mag-*
+rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/gnome-mag-*/reference/html
+rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/gnome-mag-*/reference
+rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/gnome-mag-*
%if %build_l10n
%else
@@ -154,362 +215,6 @@
%clean
rm -rf $RPM_BUILD_ROOT
-%if %option_with_java
-%post
-# This script works by
-# 1. If pkgcond exec exists it uses it to determine whether to
-# make any file system modifications
-# 2. if pkgcond does not exist it works by using the older FCS logic in CheckZones()
-# The LocalZones() function now calls the function that modified /usr
-# based on whether /usr/java/jre/lib is writable
-
-# Basically local zones can have any arbitrary directory readonly or writable
-# So a script that needs to modify say /usr/java needs
-# to figure out if this is actually doable first.
-
-
-PKGCOND=/usr/bin/pkgcond
-CheckZones()
-{
- if [ "${PKG_INSTALL_ROOT:=/}" = "/" -a -x /usr/bin/zonename ]; then
- ZONENAME=`/usr/bin/zonename`
- if [ ${ZONENAME} = "global" ]; then
- GLOBAL_ZONE=true
- else
- GLOBAL_ZONE=false
- fi
- else
- # Unable to determine zone
- GLOBAL_ZONE=true
- fi
-}
-
-# I am testing if /usr/java/jre/lib/ is writable as this is the only dir touched by this postinstall script
-# If there are other dirs that are touched later then need to add them here as well
-LocalZones () {
- /usr/bin/touch ${BASEDIR}/java/jre/lib/.test.$$ > /dev/null 2>&1
- if [ $? != 0 ]; then
- return 0
- fi
- rm -f ${BASEDIR}/java/jre/lib/.test.$$ > /dev/null 2>&1
- ExecuteDefaultCmds
- return $?
-
-}
-
-
-ExecuteDefaultCmds() {
-
-
- if [ -h ${BASEDIR}/java/jre/lib/accessibility.properties ];
-then
- rm -f ${BASEDIR}/java/jre/lib/accessibility.properties
- fi
- # Remove the incorrect /usr/java entries from the packaging database.
- # Ignore errors for situation where files no longer in db as removing a
- # non-existant reference does not cause any harm.
- removef $PKGINST /usr/java/jre/lib/accessibility.properties >/dev/null 2>&1
- removef $PKGINST /usr/java/jre/lib/ext/gnome-java-bridge.jar >/dev/null 2>&1
- removef -f $PKGINST >/dev/null 2>&1
-
- # Determine the full path (symlinks resolved) to JDK pointed to by /usr/java.
- cd $BASEDIR
- JAVADIR=java
- JDK_DIR=$BASEDIR
- # If $JAVADIR is a symlink then we must resolve it.
- if [ -d $JAVADIR -a -h $JAVADIR ]
- then
- # Get symlink target.
- DIR=`ls -l $JAVADIR | awk '{print $NF}'`
-
- # If the target is a symlink then need to resolve it.
- if [ -d $DIR -a -h $DIR ]
- then
- nextdir=`dirname $DIR`
- cd $nextdir
- JDK_DIR="$JDK_DIR/$nextdir" # Append this bit.
-
- f=`basename $DIR`
- nextdir=`ls -l $f | awk '{print $NF}'`
- JDK_DIR="$JDK_DIR/$nextdir"
- else
- # otherwise just append to $JDK_DIR and we're done.
- JDK_DIR="$JDK_DIR/$DIR"
- fi
- else
- # If the 'java' item is not a symlink (presumably a dir) there will be no
- # symlink to installf items to.
- return 0
- fi
-
- cd ${JDK_DIR}/jre/lib || exit 2
- # Dynamically determine number of '..' required.
- JAR_DIR=share/jar
- DOTS=.
- LEVEL=0
- FILE=accessibility.properties
- # Keep testing, up to a max of 10 levels to avoid infinite loop.
- while [ ! -f $DOTS/$JAR_DIR/$FILE ] && [ $LEVEL -lt 10 ]
- do
- DOTS="$DOTS/.."
- LEVEL=`expr $LEVEL + 1`
- done
- if [ -f $DOTS/$JAR_DIR/$FILE ]; then
- ln -s $DOTS/$JAR_DIR/$FILE . || exit 2
- installf $PKGINST ${JDK_DIR}/jre/lib/$FILE=$DOTS/$JAR_DIR/$FILE s || exit 2
- fi
- FILE=gnome-java-bridge.jar
- if [ -f $DOTS/$JAR_DIR/$FILE ]; then
- cp $DOTS/$JAR_DIR/$FILE ext || exit 2
- installf $PKGINST ${JDK_DIR}/jre/lib/ext/$FILE f 0644 root bin || exit 2
- fi
-
- installf -f $PKGINST || exit 2
-
- return 0
-
-}
-
-ExecuteWholerootCmds() {
-
-
- if [ -h ${BASEDIR}/java/jre/lib/accessibility.properties ];
-then
- rm -f ${BASEDIR}/java/jre/lib/accessibility.properties
- fi
- # Remove the incorrect /usr/java entries from the packaging database.
- # Ignore errors for situation where files no longer in db as removing a
- # non-existant reference does not cause any harm.
- removef $PKGINST /usr/java/jre/lib/accessibility.properties >/dev/null 2>&1
- removef $PKGINST /usr/java/jre/lib/ext/gnome-java-bridge.jar >/dev/null 2>&1
- removef -f $PKGINST >/dev/null 2>&1
-
- # Determine the full path (symlinks resolved) to JDK pointed to by /usr/java.
- cd $BASEDIR
- JAVADIR=java
- JDK_DIR=$BASEDIR
- # If $JAVADIR is a symlink then we must resolve it.
- if [ -d $JAVADIR -a -h $JAVADIR ]
- then
- # Get symlink target.
- DIR=`ls -l $JAVADIR | awk '{print $NF}'`
-
- # If the target is a symlink then need to resolve it.
- if [ -d $DIR -a -h $DIR ]
- then
- nextdir=`dirname $DIR`
- cd $nextdir
- JDK_DIR="$JDK_DIR/$nextdir" # Append this bit.
-
- f=`basename $DIR`
- nextdir=`ls -l $f | awk '{print $NF}'`
- JDK_DIR="$JDK_DIR/$nextdir"
- else
- # otherwise just append to $JDK_DIR and we're done.
- JDK_DIR="$JDK_DIR/$DIR"
- fi
- else
- # If the 'java' item is not a symlink (presumably a dir) there will be no
- # symlink to installf items to.
- return 0
- fi
-
- cd ${JDK_DIR}/jre/lib || exit 2
- # Extra '..' because traversing up through symlink.
- #
- # Due to bugid 6358671, need to check whether we are running pkgadd relative to /export/Solaris_1*
- # and the link ${PKG_INSTALL_ROOT}/usr_${ARCH}.all to see whether this is smosservice.
- # Also not do installf since diskless client root and user packages are not in installed relative
- # to the same directory. installf/removef will never work properly
- #
- if [ -h ${PKG_INSTALL_ROOT}/usr_${ARCH}.all ]; then
- # Dynamically determine number of '..' required.
- JAR_DIR=share/jar
- DOTS=.
- LEVEL=0
- FILE=accessibility.properties
- # Keep testing, up to a max of 10 levels to avoid infinite loop.
- while [ ! -f $DOTS/$JAR_DIR/$FILE ] && [ $LEVEL -lt 10 ]
- do
- DOTS="$DOTS/.."
- LEVEL=`expr $LEVEL + 1`
- done
- if [ -f $DOTS/$JAR_DIR/$FILE ]; then
- ln -s $DOTS/$JAR_DIR/$FILE . || exit 2
- fi
- FILE=gnome-java-bridge.jar
- if [ -f $DOTS/$JAR_DIR/$FILE ]; then
- cp $DOTS/$JAR_DIR/$FILE ext || exit 2
- fi
- else
- # Dynamically determine number of '..' required.
- JAR_DIR=share/jar
- DOTS=.
- LEVEL=0
- FILE=accessibility.properties
- # Keep testing, up to a max of 10 levels to avoid infinite loop.
- while [ ! -f $DOTS/$JAR_DIR/$FILE ] && [ $LEVEL -lt 10 ]
- do
- DOTS="$DOTS/.."
- LEVEL=`expr $LEVEL + 1`
- done
- if [ -f $DOTS/$JAR_DIR/$FILE ]; then
- ln -s $DOTS/$JAR_DIR/$FILE . || exit 2
- installf $PKGINST ${JDK_DIR}/jre/lib/$FILE=$DOTS/$JAR_DIR/$FILE s || exit 2
- fi
- FILE=gnome-java-bridge.jar
- if [ -f $DOTS/$JAR_DIR/$FILE ]; then
- cp $DOTS/$JAR_DIR/$FILE ext || exit 2
- installf $PKGINST ${JDK_DIR}/jre/lib/ext/$FILE f 0644 root bin || exit 2
- fi
-
- installf -f $PKGINST || exit 2
- fi
- return 0
-
-}
-
-ExecuteDisklessCmds() {
-
-
- if [ -h ${BASEDIR}/java/jre/lib/accessibility.properties ];
-then
- rm -f ${BASEDIR}/java/jre/lib/accessibility.properties
- fi
- # Remove the incorrect /usr/java entries from the packaging database.
- # Ignore errors for situation where files no longer in db as removing a
- # non-existant reference does not cause any harm.
- removef $PKGINST /usr/java/jre/lib/accessibility.properties >/dev/null 2>&1
- removef $PKGINST /usr/java/jre/lib/ext/gnome-java-bridge.jar >/dev/null 2>&1
- removef -f $PKGINST >/dev/null 2>&1
-
- # Determine the full path (symlinks resolved) to JDK pointed to by /usr/java.
- cd $BASEDIR
- JAVADIR=java
- JDK_DIR=$BASEDIR
- # If $JAVADIR is a symlink then we must resolve it.
- if [ -d $JAVADIR -a -h $JAVADIR ]
- then
- # Get symlink target.
- DIR=`ls -l $JAVADIR | awk '{print $NF}'`
-
- # If the target is a symlink then need to resolve it.
- if [ -d $DIR -a -h $DIR ]
- then
- nextdir=`dirname $DIR`
- cd $nextdir
- JDK_DIR="$JDK_DIR/$nextdir" # Append this bit.
-
- f=`basename $DIR`
- nextdir=`ls -l $f | awk '{print $NF}'`
- JDK_DIR="$JDK_DIR/$nextdir"
- else
- # otherwise just append to $JDK_DIR and we're done.
- JDK_DIR="$JDK_DIR/$DIR"
- fi
- else
- # If the 'java' item is not a symlink (presumably a dir) there will be no
- # symlink to installf items to.
- return 0
- fi
-
- cd ${JDK_DIR}/jre/lib || exit 2
- # Dynamically determine number of '..' required.
- JAR_DIR=share/jar
- DOTS=.
- LEVEL=0
- FILE=accessibility.properties
- # Keep testing, up to a max of 10 levels to avoid infinite loop.
- while [ ! -f $DOTS/$JAR_DIR/$FILE ] && [ $LEVEL -lt 10 ]
- do
- DOTS="$DOTS/.."
- LEVEL=`expr $LEVEL + 1`
- done
- if [ -f $DOTS/$JAR_DIR/$FILE ]; then
- ln -s $DOTS/$JAR_DIR/$FILE . || exit 2
- fi
- FILE=gnome-java-bridge.jar
- if [ -f $DOTS/$JAR_DIR/$FILE ]; then
- cp $DOTS/$JAR_DIR/$FILE ext || exit 2
- fi
-
-#
-# Comment this out since diskless service root and usr packages are installed in seperate directories and do not have a common package database. installf and removef will not work
-
-# installf $PKGINST ${JDK_DIR}/jre/lib/accessibility.properties=../../../../../share/jar/accessibility.properties s || exit 2
-# installf $PKGINST ${JDK_DIR}/jre/lib/ext/gnome-java-bridge.jar f 0644 root bin || exit 2
-# installf -f $PKGINST || exit 2
-
- return 0
-
-}
-ExecuteInProperEnvironment () {
-
-#
-# The following is comment out since pkgcond does not support smosservice
-# if $PKGCOND is_smosservice > /dev/null 2>&1 ; then
- # Execute smosservice for diskless clients service commands.
- # We use $BASEDIR because of diskless client restrictions
-# ExecuteDisklessCmds
-# return 0
-# fi
-
- if $PKGCOND is_whole_root_nonglobal_zone > /dev/null 2>&1 ; then
- # Execute non-global whole root zone commands.
- # Should be same action as the default action.
- ExecuteWholerootCmds
- return 0
- fi
-
- if $PKGCOND is_nonglobal_zone > /dev/null 2>&1 ; then
- # Execute non-global zone commands. Should be no action here
- return 0
- fi
-
- if $PKGCOND is_alternative_root > /dev/null 2>&1 ; then
- # Execute commands specific to an alternate root
- ExecuteDefaultCmds
- return 0
- fi
-
- if $PKGCOND is_global_zone > /dev/null 2>&1 ; then
- # In a global zone and system is mounted on /.
- # Execute all commands.
- ExecuteDefaultCmds
- return 0
- fi
-
- return 0
-}
-
-
-
-if [ -n "$PKG_INIT_INSTALL" ] ; then
- # initial installation of Solaris
- ExecuteDefaultCmds
-elif [ -n "$SUNW_PKG_INSTALL_ZONENAME" ] ; then
- # initial installation of non-global zone
- # Execute non-global zone commands. Should be no action here
- exit 0
-elif [ -x $PKGCOND ] ; then
- # use pkgcond to determine what the package is being installed to
- ExecuteInProperEnvironment && exit 0 || exit 1
-else
- CheckZones
- if [ "${GLOBAL_ZONE}" = "true" ]; then
- # Call LocalZones() to verify that the /usr/java/jre/lib dir is
- # writeable before trying to create the symlink and copy the file. The
- # function name is unfortunate. To minimize changes it is not being
- # renamed nor this 'if' statement removed. Fixes 6531193.
- LocalZones
- else
- LocalZones
- fi
-fi
-
-exit 0
-%endif
-
%files
%defattr (-, root, bin)
%ifarch amd64 sparcv9
@@ -563,6 +268,8 @@
%{_datadir}/gnome-mag
%if %option_with_java
%{_datadir}/jar
+%{_basedir}/jdk/instances/*/jre/lib/accessibility.properties
+%{_basedir}/jdk/instances/*/jre/lib/ext/gnome-java-bridge.jar
%endif
%{_datadir}/lib/freetts
@@ -598,6 +305,15 @@
%endif
%changelog
+* Fri Oct 16 2008 - [email protected]
+- Create symbol links for accessibility.properties and gnome-java-bridge.jar
+ as parts of the package.
+ In the previous versions, the symbol links are created in post scripts which
+ will not be executed in OpenSolaris.
+ Fix d.o.o bug #5253
+- Change rmdir to rm -rf since the doc pathes of gnome-mag are not
+ empty after the integration of SUNWdoxygen.
+ We still don't ship references of gnome-mag for now.
* Mon Sep 29 2008 - [email protected]
- Added -root pkg for /etc/gconf/schemas/at-spi-schmeas.
* Mon Sep 22 2008 - [email protected]