SUNWgnome-a11y-libs.spec
author dcarbery
Wed, 05 Sep 2007 13:58:41 +0000
changeset 10451 844c5b59d61b
parent 10017 11acbc57a6bf
child 10572 8cdee8cd9c9c
permissions -rw-r--r--
2007-09-05 Damien Carbery <[email protected]> * SUNWzz-gnome-l10n.spec, SUNWgnome-libs.spec, SUNWgnome-file-mgr.spec, SUNWgnome-hex-editor.spec, SUNWgnome-a11y-libs.spec: Remove references to SUNWgnome-a11y-base-libs as its contents have been moved to SUNWgnome-base-libs. * manpages/Makefile: Move man3/libgailutil.3 from SUNWgnome-a11y-base-libs to SUNWgnome-base-libs, alongside the gail module is.

#
# spec file for package SUNWgnome-a11y-libs
#
# includes module(s): at-spi java-access-bridge libgail-gnome freetts gnome-mag
#
# Copyright (c) 2004 Sun Microsystems, Inc.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Owner: padraig
#
%include Solaris.inc

%use at_spi = at-spi.spec
%use libgail_gnome = libgail-gnome.spec
%use java_access_bridge = java-access-bridge.spec
%use freetts = freetts.spec
%use gnome_mag = gnome-mag.spec

Name:                    SUNWgnome-a11y-libs
Summary:                 Accessibility implementation for GNOME
Version:                 %{default_pkg_version}
Source:                  %{name}-manpages-0.1.tar.gz
SUNW_BaseDir:            %{_basedir}
BuildRoot:               %{_tmppath}/%{name}-%{version}-build

%include default-depend.inc
Requires: SUNWgnome-libs
Requires: SUNWgnome-panel
Requires: SUNWgnome-component
Requires: SUNWgnome-base-libs
Requires: SUNWgnome-config
Requires: SUNWlibms
Requires: SUNWlibpopt
Requires: SUNWxwplt
Requires: SUNWxwrtl
Requires: SUNWj5rt
Requires: SUNWzoner
Requires: SUNWzoneu
Requires: SUNWpkgcmdsu

BuildRequires: SUNWgnome-base-libs-devel
BuildRequires: SUNWgnome-config-devel
BuildRequires: SUNWlibpopt-devel
BuildRequires: SUNWgnome-panel-devel
BuildRequires: SUNWgnome-libs-devel
BuildRequires: SUNWgnome-panel-devel
BuildRequires: SUNWgnome-component-devel

%package devel
Summary:                 %{summary} - development files
SUNW_BaseDir:            %{_basedir}
%include default-depend.inc
Requires: SUNWperl584usr
Requires: SUNWgnome-base-libs-devel
Requires: SUNWgnome-libs-devel

%if %build_l10n
%package l10n
Summary:                 %{summary} - l10n files
SUNW_BaseDir:            %{_basedir}
%include default-depend.inc
Requires:                %{name}
%endif

%prep
rm -rf %name-%version
mkdir %name-%version
%at_spi.prep -d %name-%version
%libgail_gnome.prep -d %name-%version
%java_access_bridge.prep -d %name-%version
%freetts.prep -d %name-%version
%gnome_mag.prep -d %name-%version
cd %{_builddir}/%name-%version
gzcat %SOURCE0 | tar xf -

%build
PKG_CONFIG_DISABLE_UNINSTALLED=
unset PKG_CONFIG_DISABLE_UNINSTALLED
export PKG_CONFIG_PATH="../at-spi-%{at_spi.version}:%{_pkg_config_path}"
export CFLAGS="%optflags -I%{_includedir}"
export RPM_OPT_FLAGS="$CFLAGS"
export LDFLAGS="%_ldflags $LDFLAGS -L%{_builddir}/%name-%version/at-spi-%{at_spi.version}/login-helper"
%at_spi.build -d %name-%version
%libgail_gnome.build -d %name-%version
%java_access_bridge.build -d %name-%version
%freetts.build -d %name-%version
%gnome_mag.build -d %name-%version

%install
%at_spi.install -d %name-%version
%libgail_gnome.install -d %name-%version
%java_access_bridge.install -d %name-%version
%freetts.install -d %name-%version
%gnome_mag.install -d %name-%version
rm -rf $RPM_BUILD_ROOT%{_mandir}
cd %{_builddir}/%name-%version/sun-manpages
make install DESTDIR=$RPM_BUILD_ROOT

# Remove .la files.
rm -f $RPM_BUILD_ROOT%{_libdir}/orbit-2.0/GNOME_Magnifier_module.la
# Remove .pyo files
find $RPM_BUILD_ROOT -name '*.pyo' -exec rm {} \;

%if %build_l10n
%else
# REMOVE l10n FILES
rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
%endif

%{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT}

%clean
rm -rf $RPM_BUILD_ROOT

%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


%files
%defattr (-, root, bin)
%dir %attr (0755, root, bin) %{_bindir}
%{_bindir}/*
%dir %attr (0755, root, bin) %{_libdir}
%{_libdir}/lib*.so*
%{_libdir}/bonobo
%{_libdir}/gtk-2.0/modules/*.so
%{_libdir}/orbit-2.0/*.so
%{_libdir}/python?.?
%{_libexecdir}/at-spi-registryd
%dir %attr (0755, root, sys) %{_datadir}
%dir %attr (0755, root, sys) %{_datadir}/lib
%dir %attr (0755, root, other) %{_datadir}/doc
%{_datadir}/doc/*
%{_datadir}/gnome-mag
%{_datadir}/jar
%{_datadir}/lib/freetts

%files devel
%defattr (-, root, bin)
%dir %attr (0755, root, bin) %{_libdir}
%dir %attr (0755, root, other) %{_libdir}/pkgconfig
%{_libdir}/pkgconfig/*
%dir %attr (0755, root, bin) %{_includedir}
%{_includedir}/*
%dir %attr (0755, root, sys) %{_datadir}
%{_datadir}/idl
%{_datadir}/gtk-doc
%dir %attr(0755, root, bin) %{_mandir}
%dir %attr(0755, root, bin) %{_mandir}/man3
%{_mandir}/man3/*

%if %build_l10n
%files l10n
%defattr (-, root, bin)
%dir %attr (0755, root, sys) %{_datadir}
%attr (-, root, other) %{_datadir}/locale
%endif

%changelog
* Wed Sep 05 2007 - [email protected]
- Remove references to SUNWgnome-a11y-base-libs as its contents have been
  moved to SUNWgnome-base-libs.
* Thu Jun 07 2007 - [email protected]
- Add %{_libdir}/python?.? to %files and remove .pyo files in %install.
* Tue Mar 13 2007 - [email protected]
- Incorporate %post changes from Mary Ding. Fixes 6531193.
* Mon Mar 05 2007 - [email protected]
- Add Build/Requires SUNWgnome-config/-devel as gconf-2.0.pc is needed.
* Fri Sep 01 2006 - [email protected]
- New Manpage tarball
* Sat Aug 12 2006 - [email protected]
- delete some unnecessary env variables
* Fri Jul 14 2006 - [email protected]
- Remove .la files before packaging.
* Thu Jun 22 2006 - [email protected]
- Change 'return 0' to 'exit 0' in main function in %post share. Fixes 6437617.
* Tue Jun 13 2006 - [email protected]
- Add dependencies on SUNWzoner/u and SUNWpkgcmdsu for zonename and pkgcond
  binaries that are used in the postinstall script. As suggested in 6377106.
* Sun Jun 11 2006 - [email protected]
- change group from other to bin/sys
* Tue May 30 2006 - [email protected]
- Merge postinstall script from JDS3.1 branch. Include fix for 6431039.
* Tue May 09 2006 - [email protected]
- merge -share pkg(s) into the base pkg(s)
* Fri May 05 2006 - [email protected]
- Copy postinstall script from JDS3.1 branch. Incorporate dynamic code.
* Tue Mar 14 2006 - [email protected]
- Add doc dir to share package.
* Mon Feb 20 2006 - [email protected]
- Complete update of Build/Requires after running check-deps.pl script.
* Thu Feb 16 2006 - [email protected]
- Update Build/Requires after running check-deps.pl script.
- Move Requires SUNWj5rt to share package as postinstall that installs the 
  symlink under a SUNWj5rt directory is in share package. Make base package
  require share package.
* Fri Dec 02 2005 - [email protected]
- Add Requires SUNWj5rt so that symlink can be created.
* Mon Nov 21 2005 - [email protected]
- Add %post share code to accomodate zones. Bug 6347858. Copied from 
  cinnabar-solaris branch.
* Mon Sep 12 2005 - [email protected]
- define l10n subpkg
* Tue Jun 14 2005 - [email protected]
- Fix packaging.
* Fri Jun 10 2005 - [email protected]
- Call %freetts.build, and add lib/freetts dir to share package.
* Mon Nov 22 2004 - [email protected]
- Fix for 6197816: gnopernicus moved to /usr/demo/jds so gnome-mag moved to
  SUNWgnome-a11y-libs package to remain in /usr/bin.
* Sat Oct 02 2004 - [email protected]
- added %pkgbuild_postprocess
* Mon Aug 30 2004 - [email protected]
- Bug 5091588 : sman3/4  files should be in a devel package
* Mon Aug 23 2004 - [email protected]
- s/SUNWpl5u/SUNWperl584usr/
* Wed Aug 18 2004 - [email protected]
- Added back gtk-docs to packaging.  Needed because the at-cspi docs
  are referred to from the libcspi.3 man page.
* Wed Aug 18 2004 - [email protected]
- Change manpage perms for Solaris integration.
* Fri Jul 23 2004 - [email protected]
- Move freetts from SUNWgnome-a11y-speech.
* Tue Jun 22 2004 - [email protected]
- changed install location to /usr/lib and /usr/bin
* Wed Apr 14 2004 - [email protected]
- Add entry to %files for accessibility.properties and gnome-java-bridge.jar
* Fri Mar 26 2004 - [email protected]
- add panel dependency
* Wed Mar 24 2004 - [email protected]
- Added SGML man page integration
* Tue Mar 23 2004 - [email protected]
- Remove gtk-doc and _datadir/lib from %files
* Thu Feb 26 2004 - [email protected]
- Add devel-share subpkg for idl files and api docs