Mailinglist Archive: opensuse-packaging (158 mails)

< Previous Next >
Re: [opensuse-packaging] packaging openoffice extensions oxt
  • From: Petr Mladek <pmladek@xxxxxxx>
  • Date: Thu, 02 Sep 2010 18:56:09 +0200
  • Message-id: <1283446570.7391.126.camel@xxxxxxxxxxxx>
Dear Benny,

better late than newer ;-)

Denny Beyer píše v St 25. 08. 2010 v 07:25 +0200:
Dear all,

does anyone have experience packaging openoffice extensions? - althogh it
might not be a bad idea to
package openoffice extentions in general for system wide installation and
usage - in this case, I
only need it for one/two required extensions. Apparently, something like that
exists in ubuntu.

Telling from what I found the following might be possible:

- set requirement to have openoffice installed
- take the oxt file and copy it to the machine
- take the correct path and install oxt with the opensuse packager on the
command line called unopkg
- call: /path/to/unopkg add --shared my-extension.oxt

oxt files are renamed zip archives, so in another scenario one could just
rename the archive, extract
it and install the files in the right location ... but I'm not sure how to
register the extension.

You might take inspiration in the OpenOffice_org-extensions source
package. You might find the last one at

Heh, I see that I do not use the PreReq there by mistake.

Basically you need to Prereq the package that is needed for
registration. In theory in might be enough to

PreReq: OpenOffice_org-libs-core

, which provides the unopkg tool

Also you should require the package needed to use the functionality. I
suggest to require OpenOffice_org for generic extensions,
OpenOffice_org-writer for Writer extensions, ...

You should install arch dependent extensions into


and arch independent (java) extensions into


Finally, you need to add some %post... script to register and unregister
the extension. The following code seems to work reliably:

%pre -n OpenOffice_org-calc-extensions
if test $1 -gt 1 ; then
echo "Unregistering the older Calc extensions..."
if unopkg list --shared | grep -q "org.numbertext-calc-addin" ; then
unopkg remove --shared "org.numbertext-calc-addin" || true;
# clear disk cache
unopkg list --shared > /dev/null 2>&1 || true

%post -n OpenOffice_org-calc-extensions
echo "Registering Calc extensions..."
unopkg add --shared --force %ooo_prefix/%
ooo_home/share/extension/install/numbertext-%{numbertext_version}.oxt ||

%preun -n OpenOffice_org-calc-extensions
if test $1 = 0 ; then
echo "Unregistering Calc extensions..."
unopkg remove --shared "org.numbertext-calc-addin" || true;
# clear disk cache
unopkg list --shared > /dev/null 2>&1 || true

See also
Unfortunately, the wiki page is a bit outdated.

You might also unpack the extension into the same path and use
"unopkg add --link". The advantage is that rpm could autodetect some
dependencies. I haven't got time to rework the extensions package for

IMPORTANT: It is possible that it will not be needed to call unopkg in
OOo-3.3. They want to register the extensions at start time. The last
information is that they are going to revert this change because the
startup was so slow.

Last thing. What extensions you would like to pack? We might add them to
the already existing extensions packages...

Best Regards,

Petr Mladek
software developer
SUSE LINUX, s. r. o. e-mail: pmladek@xxxxxxx
Lihovarská 1060/12 tel: +420 284 028 952
190 00 Prague 9 fax: +420 284 028 951
Czech Republic

To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages