[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: libpng.so is needed by... but I already installed libpng



Hi! Jeff:
Both "rpm -q --whatprovides libpng.so" and "rpm --redhatprovides
libpng.so" say "no package provides libpng.so".
But I have no idea, it's fresh RH9 installed machine. I never patched or
do something else...
"rpm -qa |grep libpng" showed me
------------------------------
libpng-1.2.2-16
libpng10-1.0.13-8
libpng-devel-1.2.2-16
------------------------------
Those are the same version and same one with RH9's RPMs, I can confirm.

The spec file, and those necessary files to create this OOo 1.1rc4 rpm package
are attached, it's for zh-TW localization version. The OOo 1.1rc4 linux
i386 tarball can be found in 
http://ftp.stardiv.de/pub/OpenOffice.org/contrib/rc/1.1rc4/OOo_1.1rc4_030905_LinuxIntel_install_zh-TW.tar.gz

To avoid this problem, Toralf Lund (the author of this spec file) added
------------------------------
Provides libjawt.so libpng.so
------------------------------
in the spec file. Actually, for RH9, it should be
------------------------------
Provides:      libjawt.so libpng.so libcrypto.so.0 libssl.so.0
------------------------------
Same reasons for libcrypto.so.0 and libssl.so.0...(They exist in RH7.3,
not RH9)

We think there must be a better way, not this way to "cheat" rpm...
Could you please tell us the better solution ?

Thank you.

Steven.
> 
> Steven Shiau wrote:
> 
> >Hi!
> >I create a rpm package for OOo 1.1rc4 to use it in RedHat 9, using
> >rpmbuild, a spec file and OOo 1.1rc4 Linux binary file, and it's
> >successfully made, then I installed it as:
> >~/OOo>rpm -ivh openoffice-zh-TW-1.1rc4-drbl.i386.rpm
> >error: Failed dependencies:
> >libpng.so is needed by openoffice-zh-TW-1.1rc4-drbl
> >
> >--------------------------------------------------------------
> >rpm complained that I need libpng.so...
> >But I already have libpng installed, as:
> >--------------------------------------------------------------
> >~/OOo>rpm -qa |grep libpng
> >libpng-1.2.2-16
> >libpng10-1.0.13-8
> >libpng-devel-1.2.2-16
> >~/OOo>whereis libpng.so
> >libpng: /usr/lib/libpng.so /usr/lib/libpng12.a
> >/usr/lib/libpng12.so
> >/usr/lib/libpng.a /usr/include/libpng
> >/usr/share/man/man3/libpng.3.gz
> >
> >--------------------------------------------------------------
> >I know rpmbuild now has a nice feature to check the dependence,
> >so it added the require of libpng.so... But can it be a bug ?
> >
> >Does anyone know how to solve this problems ? If so, please tell
> >me.
> >Thanks.
> >
> >Steven.
> >  
> >
> 
> What does "rpm -q --whatprovides libpng.so" say? If nothing, then that's
> your problem.
> 
> But missing libpng.so may also be a linkage problem in OOo.
> 
> If building with rpm-4.2 or later, then find the fils(s) that need
> libpng.so:
> rpm -qp --filerequire | grep libpng.so
> 
> I would have expected "libpng.so.0" not "libpng.so" as the requirement.
> 
> BTW, I know someone here at Red Hat who would be very happy (I think) to
> help if you
> are willing to make your OOo package available ...
> 
> 73 de Jeff
> 
> 


-- 
Please AVOID distributing documents in WORD, EXCEL or POWERPOINT format.
[Chinese Big5] 請避免散佈WORD, EXCEL 或是 POWERPOINT格式的檔案.
See http://www.fsf.org/philosophy/no-word-attachments.html
and http://www.cyut.edu.tw/~ckhung/published/997nodoc.shtml
----------------------------------
Steven Shiau
E-mail: steven@nchc.org.tw; steven@stick.idv.tw
%define name	openoffice
%define mainver 1.1
%define subver	rc4
%define version	%{mainver}%{subver}
%define instId 1.1.0
%define release	1drbl
%define localization zh-TW

%define instdir %{_libdir}/OpenOffice.org%{instId}
%define olddictdir %{_datadir}/myspell

%define _unpackaged_files_terminate_build 0
%define debug_package %{nil}

Summary:	Open source office suite
#Name:		%{name}
Name:		%{name}-%{localization}
Version:	%{version}
Release:	%{release}
Requires:	%{name}-libs, %{name}-i18n
#Requires:       libpng-devel compat-db tk
Epoch:		1
URL:		http://www.openoffice.org/
Obsoletes:	%{name}-padmin
# *** Hack: Requires will list some .so-files that may not really be needed, or
#           that we *know* are there, but aren't provided directly (typically
#           bacause lib....so is listed, and lib...so.<version> is provided.)
#           Pretend they are included here in order to avoid dependency
#           problems on installation.
#Provides:	libjawt.so libpng.so libcrypto.so.0 libdb-3.1.so libssl.so.0 libtk8.3.so
#Provides:	libjawt.so libpng.so libcrypto.so.0 libssl.so.0
#Provides:	libjawt.so libpng.so
Provides:	libjawt.so

%ifos linux
#Source0:	OOo_%{version}_LinuxIntel_install.tar.gz
Source0:	ftp://linux.nchc.org.tw/OpenOffice.org/mirror/contrib/rc/%{version}/OOo_%{version}_LinuxIntel_install_zh-TW.tar.gz
%endif
Source1:	openoffice-wrapper
Source2:	openoffice-rsfile-local
#Source3:	Common.xcu.Linux_zh_TW

# Wordbooks: http://whiteboard.openoffice.org/lingucomponent/download_dictionary.html
Source20:	http://dict.progbits.com/ca_ES.zip
Source21:	http://dict.progbits.com/cs_CZ.zip
Source22:	http://dict.progbits.com/da_DK.zip
Source23:	http://dict.progbits.com/de_CH.zip
Source24:	http://dict.progbits.com/de_DE.zip
Source25:	http://dict.progbits.com/el_GR.zip
Source26:	http://dict.progbits.com/en_CA.zip
Source27:	http://dict.progbits.com/es_ES.zip
Source28:	http://dict.progbits.com/fr_FR.zip
Source29:	http://dict.progbits.com/hr_HR.zip
Source30:	http://dict.progbits.com/hu_HU.zip
Source32:	http://dict.progbits.com/nl_NL.zip
Source33:	http://dict.progbits.com/pl_PL.zip
Source34:	http://dict.progbits.com/pt_PT.zip
Source35:	http://dict.progbits.com/sv_SE.zip
Source36:	http://dict.progbits.com/bg_BG.zip
Source38:	http://dict.progbits.com/pt_BR.zip
Source39:	http://dict.progbits.com/sk_SK.zip
#Source40:	no_NO.zip
Source40:	nn_NO.zip
# This one is special, as there is no country associated with Latin,
# nor should it be %lang(la).
Source50:	http://dict.progbits.com/la.zip

License:	LGPL
Group:		Applications/Productivity
BuildRoot:	%{_tmppath}/%{name}-%{version}-root


%package libs
Summary: 	OpenOffice.org shared libraries
Group:		Applications/Productivity

%package i18n
Summary: 	MySpell/OpenOffice dictionaries
Group:		Applications/Productivity
Obsoletes:	myspell, myspell-en_GB, myspell-en_US, myspell-nb_NO, myspell-nn_NO, myspell-sv_SE

%description
OpenOffice.org is an Open Source, community-developed, multi-platform
office productivity suite. It includes the key desktop applications,
such as a word processor, spreadsheet, presentation manager, forumula
editing and drawing program, with a user interface and feature set
similar to other office suites. Sophisticated and flexible,
OpenOffice.org also works transparently with a variety of file
formats, including Microsoft Office.

Usage: Simply type "ooffice" to run OpenOffice.org or select the
requested component (Writer, Calc, Draw, Impress, etc.) from your
desktop menu. The ooffice wrapper script will install a few files in
the user's home, if necessary.

%description libs
OpenOffice.org is an Open Source, community-developed, multi-platform
office productivity suite.  This package includes its shared libraries.

%description i18n
MySpell is a simple spell checker that uses affix 
compression and is modelled after the spell checker
ispell. 

The MySpell code is used by  OpenOffice.org for spell
checking. 



%prep
%setup0 -q -n %(basename %{SOURCE0} .tar.gz | sed 's/%{subver}/.0/')



%build

%install
rm -rf $RPM_BUILD_ROOT



WORDBOOKS="%{SOURCE20} %{SOURCE21} %{SOURCE22} %{SOURCE23} %{SOURCE24} \
	   %{SOURCE25} %{SOURCE26} %{SOURCE27} %{SOURCE28} %{SOURCE29} \
	   %{SOURCE30} %{SOURCE32} %{SOURCE33} %{SOURCE34} \
	   %{SOURCE35} %{SOURCE36} %{SOURCE38} %{SOURCE39} \
	   %{SOURCE40}"

./install --prefix=$RPM_BUILD_ROOT%{_libdir}

# Remove buildroot: Symlinks
find $RPM_BUILD_ROOT -type l | while read link
do
  val=`readlink $link`
  newVal=`echo $val | sed "s|$RPM_BUILD_ROOT||"`
  if [ "$newVal" != "$val" ]
  then
    ln -sf $newVal $link
  fi
done

# Remove buildroot: Config files
find $RPM_BUILD_ROOT \( -name "*.ins" -o -name "*.xml" -o -name "*.dt" -o -name "*.desktop" \) | while read conf
do
  perl -pi -e "s|$RPM_BUILD_ROOT||g" "$conf"
done

# I don't care about -devel things for now
rm -rf $RPM_BUILD_ROOT%{instdir}/program/addin



# This one feels really good:
rm -f $RPM_BUILD_ROOT%{instdir}/share/gnome/net/setup.desktop 
rm -f $RPM_BUILD_ROOT%{instdir}/share/kde/net/applnk/*/setup.desktop


# Install wrapper etc.
%__install -m 775 -d $RPM_BUILD_ROOT%{_bindir}
sed -e "s/<OOVERSION>/%{instId}/" -e "s!<OOROOT>!%{instdir}!" < %{SOURCE1} > $RPM_BUILD_ROOT%{_bindir}/ooffice
chmod 555 $RPM_BUILD_ROOT%{_bindir}/ooffice

# Install the Common.xcu for zh-TW fonts replacement.
#mv $RPM_BUILD_ROOT%{instdir}/share/registry/data/org/openoffice/Office/Common.xcu $RPM_BUILD_ROOT%{instdir}/share/registry/data/org/openoffice/Office/Common.xcu.orig
#cat %{SOURCE3} > $RPM_BUILD_ROOT%{instdir}/share/registry/data/org/openoffice/Office/Common.xcu


# Fix .desktop files: replace exec with wrapper, add GNOME2 cathegories
# and create bin links for everything that has a desktop file
find $RPM_BUILD_ROOT%{instdir} \( -name "*.desktop" -o -name ".directory" \) -print | while read dtFile
do
 # *** 	Can we merge these into one perl call?
 # Note: Also need to make sure closing quote, if any, is removed, as the
  #      opening one will be gone already (and we don't need quotes anyway.)
 perl -pi -e 's|Exec=.*/so?([^"]*)"?|Exec=oo$1|' "${dtFile}"
 exec=`perl -ne 'print((m/Exec=(\S*)/)[0])' "${dtFile}"`	
 if [ "$exec" != "oosetup" -a "$exec" != "oopadmin" ]
 then
   perl -pi -e 's/(Categories=.*)/$1X-Red-Hat-Base;X-Red-Hat-Base-Only;/' "${dtFile}"
 fi
 if [ -n "$exec" -a "$exec" != "ooffice" ]	
 then
   %__ln_s -f ooffice $RPM_BUILD_ROOT%{_bindir}/$exec 2>/dev/null || true
 fi
done


# Install autoresponse file for user installation
mkdir -p %{buildroot}%{_sysconfdir}/openoffice
cat %{SOURCE2} > %{buildroot}%{_sysconfdir}/openoffice/autoresponse.conf
chmod 644 %{buildroot}%{_sysconfdir}/openoffice/autoresponse.conf
ln -sf %{_libdir}/openoffice/program %{buildroot}%{_sysconfdir}/openoffice/moz

# Desktop config...
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gnome/apps/Applications $RPM_BUILD_ROOT%{_datadir}/application-registry
ln -sf %{instdir}/share/gnome/net $RPM_BUILD_ROOT%{_datadir}/gnome/apps/Applications/OpenOffice

%__install -m 755 -d $RPM_BUILD_ROOT%{_datadir}/applnk/Applications/OpenOffice
(cd $RPM_BUILD_ROOT%{_datadir}/applnk/Applications;\
 %__ln_s  ../../../lib/`basename %{instdir}`/share/kde/net/*.desktop OpenOffice)
# *** Do the same for KDE mimelnk

cat > $RPM_BUILD_ROOT%{_datadir}/application-registry/%{name}.applications <<EOF
%{name}
	requires_terminal=false
	command=ooffice
	can_open_multiple_files=true
	name=OpenOffice.org %{version}
	mime_types=application/mspowerpoint,application/vnd.stardivsion.impress,application/vnd.sun.xml.impress.template,application/vnd.sun.xml.impress,application/ms-excel,application/vnd.stardivsion.chart,application/vnd.stardivsion.calc,application/vnd.sun.xml.calc.template,application/vnd.sun.xml.calc,application/vnd.sun.xml.writer,application/vnd.sun.xml.writer.template,application/vnd.sun.xml.writer.global,application/vnd.sun.xml.writer.math,application/vnd.stardivision.writer,application/vnd.stardivision.writer-global,application/vnd.stardivision.math,application/msword,text/richtext,application/vnd.sun.xml.draw,application/vnd.sun.xml.draw.template,application/vnd.stardivs
EOF

# dictionaries...
dictDoc=`pwd`/i18n-doc
( 
  cd $RPM_BUILD_ROOT%{instdir}/share/dict/ooo

  %__install -m 775 -d $dictDoc	
  mv dictionary.lst* $dictDoc

  for dict in $WORDBOOKS; do
    loc=`echo $dict | sed 's~^.*/\([a-zA-Z_]*\).zip$~\1~'`
    lang=`echo $loc | sed 's~_.*$~~'`
    cntr=`echo $loc | sed 's~.*_$~~'`
    unzip $dict
    %__install -m 775 -d $dictDoc/$loc
    ls | egrep -v '(.dic|.aff|.lst)$' | while read doc
    do
      mv -f $doc $dictDoc/$loc
    done
  done
  # *** For some reason, Norwegian (bokm嶚) dictionary has a language name OOo
  #     won't recognise (I submitted the dict, but with a different file name),
  #     hence the 2nd 's' command.
  ls *.aff | sed -e "s/\(.*\)_\(.*\).aff/DICT \1 \2 \1_\2/; s/DICT no/DICT nb/" > dictionary.lst	
)

%__install -m 775 -d `dirname $RPM_BUILD_ROOT%{olddictdir}`
%__ln_s %{instdir}/share/dict/ooo $RPM_BUILD_ROOT%{olddictdir}

find $RPM_BUILD_ROOT%{instdir}/program -name "*.so*" -exec chmod a+x {} \;

%pre i18n
rm -rf %{olddictdir}

%post

%postun



%clean
# rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc *LICENSE* README*

%{instdir}/help
# Note: The following two lines represent a way to include everything but *so
%{instdir}/program/*[!o]
%{instdir}/program/*[!s]o
%{instdir}/share/[a-c]*
%{instdir}/share/dtd
%{instdir}/share/[f-z]*
%{instdir}/user
%{instdir}/LICENSE*
%{instdir}/README*
%{instdir}/THIRDPARTYLICENSEREADME.html

%{_bindir}/ooffice
%{_bindir}/oocalc
%{_bindir}/oodraw
%{_bindir}/ooimpress
%{_bindir}/oomath
%{_bindir}/oowriter
%{_datadir}/gnome/apps/Applications/*
%{_datadir}/application-registry/*
%{_datadir}/applnk/Applications/*
%{_sysconfdir}/openoffice
#

%files libs
%dir %{instdir}
%dir %{instdir}/program
%dir %{instdir}/program/*so

%files i18n
%defattr(-,root,root)
%doc i18n-doc/*
%{instdir}/share/dict
%{olddictdir}

%changelog
* Mon Sep  10 2003 Steven Shiau <steven@nchc.org.tw> 1.1rc4
- get spec file from Toralf <toralf@procaptura.com>, make it in DRBL first tiem.
[ENVIRONMENT]
INSTALLATIONMODE=INSTALL_WORKSTATION
INSTALLATIONTYPE=WORKSTATION
DESTINATIONPATH=<home>/.openoffice
OUTERPATH=
LOGFILE=
LANGUAGELIST=01

[JAVA]
JavaSupport=none


#!/bin/sh
# -----------------------------------------------------
#      Red Hat wrapper script for OpenOffice.org
# -----------------------------------------------------
# (partially based on Mandrake wrapper script for 641c)

OOVERSION=<OOVERSION>
OOVERSIONRC="$HOME/.sversionrc"
OOHOME="$HOME/.openoffice"

# Remove any entry in .sversionrc if not already installed from RPM
if [ -f "$OOVERSIONRC" ]; then
  oohome=$(cat $OOVERSIONRC | tr '\r' '\n' | perl -n -e "m|^OpenOffice.org ${OOVERSION}=file://(.*)$| and print \$1")
  if [ -n "$oohome" -a "$oohome" != "$OOHOME" ]; then
    cp $OOVERSIONRC $OOVERSIONRC.orig
    perl -ni -e "m|file://${oohome}| or print" $OOVERSIONRC
  fi
fi

# Issue a workstation-type installation for the user, if necessary
if [ -d "$OOHOME" -a -e "$OOHOME/soffice" -a -e "$OOHOME/spadmin" ] ; then
  :
else
  echo "Checking for existing user installation ...   ...   NOT FOUND"

  setup="/usr/lib/OpenOffice.org${OOVERSION}/program/setup"

  if [ -d "$OOHOME" ]
  then
    echo -n "Updating existing installation for user ...   "
    setup="$setup -reinstall"
  else   
    echo -n "Performing first-time installation for user ...   "
  fi

  rm -f $OOHOME/setup $OOHOME/soffice $OOHOME/spadmin
  if grep -q application/vnd.s $HOME/.mime.types 2>/dev/null; then
    # setup adds .mime.types unconditionally
    sed -e '/^application\/vnd.stardivision.calc sdc$/d' \
	-e '/^application\/vnd.stardivision.draw sda$/d' \
	-e '/^application\/vnd.stardivision.impress sdd sdp$/d' \
	-e '/^application\/vnd.stardivision.math smf$/d' \
	-e '/^application\/vnd.stardivision.writer-global sgl$/d' \
	-e '/^application\/vnd.stardivision.writer sdw vor$/d' \
	-e '/^application\/vnd.sun.xml.calc sxc$/d' \
	-e '/^application\/vnd.sun.xml.calc.template stc$/d' \
	-e '/^application\/vnd.sun.xml.draw sxd$/d' \
	-e '/^application\/vnd.sun.xml.draw.template std$/d' \
	-e '/^application\/vnd.sun.xml.impress sxi$/d' \
	-e '/^application\/vnd.sun.xml.impress.template sti$/d' \
	-e '/^application\/vnd.sun.xml.math sxm$/d' \
	-e '/^application\/vnd.sun.xml.writer.global sxg$/d' \
	-e '/^application\/vnd.sun.xml.writer sxw$/d' \
	-e '/^application\/vnd.sun.xml.writer.template stw$/d' \
	$HOME/.mime.types > $HOME/.mime.types.tmp \
    && mv -f $HOME/.mime.types.tmp $HOME/.mime.types
  fi
  # rename old .sversonrc
  [ -f $HOME/.sversionrc ] && mv -f $HOME/.sversionrc $HOME/.sversionrc.old
  # run the automated setup

  if $setup -R:/etc/openoffice/autoresponse.conf; then
    # make the user/work link and use "My Documents" directory
    #mkdir -p $HOME/"My Documents"
    #ln -s $HOME/"My Documents" $OOHOME/user/work
    ln -s $HOME $OOHOME/user/work
    setup_xml=$HOME/.openoffice/user/config/registry/instance/org/openoffice/Setup.xml
    if ! grep -q '<ooLocale\|<L10N>' $setup_xml; then
      lang="$LC_ALL"
      if [ -z "$lang" ]; then
	lang="$LANG"
      fi
      lang=$(echo "$lang" | sed -n "s/\([a-z]*_[A-Z]*\).*/\1/p")
      if [ -z "$lang" ]; then
	lang=en_US
      fi
      cp -a $setup_xml $setup_xml.tmp
      sed -e '/^<Setup/a\
 <L10N>\
  <ooLocale cfg:type="string">en-US</ooLocale>\
  <ooSetupSystemLocale cfg:type="string">'${lang/_/-}'</ooSetupSystemLocale>\
 </L10N>
' $setup_xml.tmp > $setup_xml
      rm -f $setup_xml.tmp
      linguistic_xml=$HOME/.openoffice/user/config/registry/instance/org/openoffice/Office/Linguistic.xml
      if [ ! -f $linguistic_xml ]; then
	cat > $linguistic_xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<Linguistic state="modified" cfg:package="org.openoffice.Office" xmlns="http://openoffice.org/2000/registry/components/Linguistic"; xmlns:cfg="http://openoffice.org/2000/registry/instance"; xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";>
 <General>
  <DefaultLocale cfg:type="string">${lang/_/-}</DefaultLocale>
 </General>
 <ServiceManager>
EOF
	sed -n 's/^.*\(<HyphenatorList\)/  \1/;s/cfg:derivedBy="list"/state="replaced"/;/<HyphenatorList/,/<\/HyphenatorList>/p' \
	  /usr/lib/OpenOffice.org${OOVERSION}/share/config/registry/instance/org/openoffice/Office/Linguistic.xml \
	  >> $linguistic_xml
	cat >> $linguistic_xml <<EOF
 </ServiceManager>
</Linguistic>
EOF
      fi
    fi
    case `LC_ALL=C xdpyinfo | grep dimensions | head -1` in
      *640x*pixels*|*800x*pixels*) scale=120;;
      *1152x*pixels*|*1024x*pixels*) scale=110;;
      *) scale=100;;
    esac
    common_xml=$HOME/.openoffice/user/config/registry/instance/org/openoffice/Office/Common.xml
    if ! grep -q '<Font\|<Substitution\|<FontPairs\|<FontReplacement\|<View' $common_xml; then
      cp -a $common_xml $common_xml.tmp
      sed -e '/^<Common/a\
 <Font>\
  <Substitution>\
   <FontPairs cfg:element-type="FontReplacement">\
    <FontReplacement state="replaced" cfg:name="_0">\
     <Always cfg:type="boolean">true</Always>\
     <OnScreenOnly cfg:type="boolean">true</OnScreenOnly>\
     <ReplaceFont cfg:type="string">Andale Sans UI</ReplaceFont>\
     <SubstituteFont cfg:type="string">Luxi Sans</SubstituteFont>\
    </FontReplacement>\
   </FontPairs>\
   <Replacement cfg:type="boolean">true</Replacement>\
  </Substitution>\
 </Font>\
 <View>\
  <FontAntiAliasing>\
   <MinPixelHeight cfg:type="short">8</MinPixelHeight>\
  </FontAntiAliasing>\
  <FontScaling cfg:type="short">'$scale'</FontScaling>\
 </View>
' $common_xml.tmp > $common_xml
      rm -f $common_xml.tmp
    fi
    if [ ! -f $HOME/.openoffice/user/psprint/psprint.conf ]; then
      # Default to paper size from locale setting
      case `/usr/bin/locale -k LC_PAPER | grep width` in
	*216) paper="Letter";;
	*) paper="A4";;
      esac
      lang="$LC_ALL"
      if [ -z "$lang" ]; then
	lang="$LANG"
      fi
      lang=$(echo "$lang" | sed -n "s/\([a-z]*_[A-Z]*\).*/\1/p")
      if [ -z "$lang" ]; then
	lang=en_US
      fi
      # Printer font substitution looks horrible for ISO-8859-2
      # languages, since some letters are taken from the printer
      # fonts and accented letters in between are downloaded
      case "$lang" in
	bs*|cs*|hr*|hu*|pl*|ro*|sk*|sl*|sr*) subst=false;;
	*) subst=true;;
      esac
      sed -n -e '/^\[Generic Printer/,${s/\(PerformFontSubstitution=\)\(false\|true\)/\1'$subst'/;s/Command=/Command=lpr/;/^[[A-Za-z]/p;/^Command=/a\
Features=\
Copies=1\
Scale=1\
Orientation=Portrait\
PSLevel=0\
ColorDevice=0\
ColorDepth=24\
MarginAdjust=-1,-1,-1,-1\
PPD_PageSize='$paper'
;}' /usr/lib/OpenOffice.org${OOVERSION}/share/psprint/psprint.conf \
	> $HOME/.openoffice/user/psprint/psprint.conf
      echo >> $HOME/.openoffice/user/psprint/psprint.conf
      sed -n -e '/^\[Generic Printer/,${s/\(PerformFontSubstitution=\)\(false\|true\)/\1'$subst'/;s/Command=/Command=\/usr\/bin\/gs -q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile="(OUTFILE)" -/;s/Generic Printer/PDF converter/;s/\(DefaultPrinter\)=1/\1=0/;/^[[A-Za-z]/p;/^Command=/a\
Features=pdf=\
Copies=1\
Scale=0\
Orientation=Portrait\
PSLevel=0\
ColorDevice=0\
ColorDepth=24\
MarginAdjust=0,0,0,0\
PPD_PageSize='$paper'
;}' /usr/lib/OpenOffice.org${OOVERSION}/share/psprint/psprint.conf \
	>> $HOME/.openoffice/user/psprint/psprint.conf
    fi
    echo "...   DONE"
  else
    echo "...   FAILED"
    exit 1
  fi
  # Don't use above by default...
  mv -f $HOME/.openoffice/user/psprint/psprint.conf $HOME/.openoffice/user/psprint/psprint.conf.disabled
fi

# Expand TrueType and Type1 font paths
chkfontpath="/usr/sbin/chkfontpath"
if [ -x "$chkfontpath" ]; then
  fontpath=$($chkfontpath | perl -ne '/[0-9]+: (.*)/ and print "$1;"')
else
  ttf_fontpath="/usr/X11R6/lib/X11/fonts/TTF;/usr/share/fonts/default/TrueType"
  for fontdir in /usr/share/fonts/ttf/*; do
    ttf_fontpath="$ttf_fontpath;$fontdir"
  done
  type1_fontpath="/usr/X11R6/lib/X11/fonts/Type1;/usr/share/fonts/default/Type1"
  fontpath="$ttf_fontpath;$type1_fontpath"
fi
SAL_FONTPATH_USER="$fontpath;$SAL_FONTPATH_USER"

# Get rid of broken Japanese fonts for now
SAL_FONTPATH_USER=$(echo "$SAL_FONTPATH_USER" | sed -e "s|/usr/share/fonts/ja/TrueType;||g")

# Get rid of broken Chinese fonts for now
SAL_FONTPATH_USER=$(echo "$SAL_FONTPATH_USER" | sed -e "s|/usr/share/fonts/zh_TW/TrueType;||g")

export SAL_FONTPATH_USER

# Adjust what user interface language we want to use
lang="$LC_ALL"
if [ -z "$lang" ]; then
  lang="$LC_MESSAGES"
  if [ -z "$lang" ]; then
    lang="$LANG"
  fi
fi
lang=$(echo "$lang" | sed -n "s/\([a-z]*_[A-Z]*\).*/\1/p")
lang=${lang/_/-}
if [ -n "$lang" ] && \
   [ -e "/usr/lib/OpenOffice.org${OOVERSION}/help/${lang%%-*}" -o \
     -e "/usr/lib/OpenOffice.org${OOVERSION}/help/$lang" ]; then
  setup_xml=$HOME/.openoffice/user/config/registry/instance/org/openoffice/Setup.xml
  oldlang=`sed -n 's|^.*<ooLocale cfg:type="string">\([a-z]*-[A-Z]*\)</ooLocale>.*$|\1|p' $setup_xml`
  if [ -n "$oldlang" -a "$lang" != "$oldlang" ]; then
    cp -a $setup_xml $setup_xml.tmp
    sed 's|\(<ooLocale cfg:type="string">\)'$oldlang'\(</ooLocale>\)|\1'$lang'\2|' \
      $setup_xml.tmp > $setup_xml
    rm -f $setup_xml.tmp
    common_xml=$HOME/.openoffice/user/config/registry/instance/org/openoffice/Office/Common.xml
    case "$lang" in
      ja-JP) font="Kochi Gothic";;
      zh-TW) font="AR PL Mingti2L Big5";;
      zh-CN) font="ZYSong18030";;
      ko-KR) font="Baekmuk Dotum";;
      ru-RU) font="Nimbus Sans L";;
      *) font="Luxi Sans";;
    esac
    case "$oldlang" in
      ja-JP) oldfont="Kochi Gothic";;
      zh-TW) oldfont="AR PL Mingti2L Big5";;
      zh-CN) oldfont="ZYSong18030";;
      ko-KR) oldfont="Baekmuk Dotum";;
      ru-RU) oldfont="Nimbus Sans L";;
      *) oldfont="Luxi Sans";;
    esac
    if [ "$font" != "$oldfont" ]; then
      cp -a $common_xml $common_xml.tmp
      sed '/<Font>/,/<\/Font>/{/<Substitution>/,/<\/Substitution>/{/<FontPairs/,/<\/FontPairs>/{/<FontReplacement state="replaced"/,/<\/FontReplacement>/{/<ReplaceFont cfg:type="string">Andale Sans UI<\/ReplaceFont>/,/<\/FontReplacement>/{s/^\([ 	]*<SubstituteFont cfg:type="string">\)'"$oldfont"'\(<\/SubstituteFont>[ 	]*\)$/\1'"$font"'\2/;};};};};}' \
	$common_xml.tmp > $common_xml
      rm -f $common_xml.tmp
    fi
  fi
fi

echo "Starting OpenOffice.org ..."

prog="/usr/lib/OpenOffice.org${OOVERSION}/program/`basename $0 | sed 's/^oo/s/'`"
[ -x $prog ] && exec $prog "$@"

case "$0" in
  *oosetup) exec $OOHOME/setup "$@";;
  *oopadmin) exec $OOHOME/spadmin "$@";;
  *) exec $OOHOME/soffice "$@";;
esac

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]