updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / openoffice.org-voikko-bin / openoffice.org-voikko.install
blobf5d0d3522d4a7e7c5cf20609005b532626d9202d
1 # Check if we have go-openoffice
3 if [ -d /usr/lib/go-openoffice ]; then
4   _ooo_ver=go-openoffice
5 else
6   _ooo_ver=openoffice
7 fi
10 pre_install() {
11   echo ">>> Removing old voikko extensions..."
12   id=" "
13   while [ "$id" != ""  ]; do
14     id=`/usr/lib/${_ooo_ver}/program/unopkg list --shared | egrep '^(Name|Identifier):.*voikko' | cut -d":" -f2 | head -n 1`
15     if [ "$id" != "" ]; then
16       if /usr/lib/${_ooo_ver}/program/unopkg list --shared $id >/dev/null; then
17         echo "Removing extension $id..."
18         INSTDIR=`mktemp -d`
19         /usr/lib/${_ooo_ver}/program/unopkg remove --shared $id \
20             "-env:UserInstallation=file://$INSTDIR" \
21             '-env:UNO_JAVA_JFW_INSTALL_DATA=$ORIGIN/../share/config/javasettingsunopkginstall.xml' \
22             "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
23         if [ -n $INSTDIR ]; then rm -rf $INSTDIR; fi
24        /usr/lib/${_ooo_ver}/program/unopkg list --shared "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1" > /dev/null 2>&1
25        fi
26     fi
27   done
30 post_install() {
31   echo ">>> Adding extension /usr/lib/${_ooo_ver}/share/extension/install/voikko.oxt..."
32   INSTDIR=`mktemp -d`
33   /usr/lib/${_ooo_ver}/program/unopkg add --shared /usr/lib/${_ooo_ver}/share/extension/install/voikko.oxt \
34     "-env:UserInstallation=file:///$INSTDIR" \
35     '-env:UNO_JAVA_JFW_INSTALL_DATA=$ORIGIN/../share/config/javasettingsunopkginstall.xml' \
36     "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
37   if [ -n $INSTDIR ]; then rm -rf $INSTDIR; fi
40 pre_upgrade() {
41   pre_install $1
44 post_upgrade() {
45   post_install $1
48 pre_remove() {
49   pre_install $1
52 # vim:set ts=2 sw=2 et: