Packaging:OpenOffice.orgExtensions

From FedoraProject

(Difference between revisions)
Jump to: navigation, search
(Imported from MoinMoin)
 
(Add categories)
 
(3 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
== OpenOffice.org extension rpm guidelines ==
 
== OpenOffice.org extension rpm guidelines ==
  
1. Extensions deinstalled with unopkg remove '''Must''' have a %postun of 'unopkg list --shared > /dev/null 2>&1' because the actual removal of files is deferred until the next start, so this ensures that this takes place under the control of your rpm on deinstallation.
+
# Extensions deinstalled with unopkg remove '''Must''' have a %postun of 'unopkg list --shared > /dev/null 2>&1' because the actual removal of files is deferred until the next start, so this ensures that this takes place under the control of your rpm on deinstallation.<BR>
1. Extensions '''Should''' be both installed unpacked and then registered with 'unopkg --link' where possible to save disk-space. Otherwise during registration of a packed .oxt or .uno.pkg with unopkg the package is automatically unzipped and the contents copied into a persistent cache directory. Using -link and an unpacked .oxt/.uno.pkg dir allows this additional copy to be omitted and importantly allows the rest of the standard rpmbuild tooling to determine additional autorequires for a package or find flaws that cannot be seen in the opaque zip case.
+
# Extensions '''Should''' be both installed unpacked and then registered with 'unopkg --link' where possible to save disk-space. Otherwise during registration of a packed .oxt or .uno.pkg with unopkg the package is automatically unzipped and the contents copied into a persistent cache directory. Using -link and an unpacked .oxt/.uno.pkg dir allows this additional copy to be omitted and importantly allows the rest of the standard rpmbuild tooling to determine additional autorequires for a package or find flaws that cannot be seen in the opaque zip case.<BR>
1. Unpacked Extensions '''Must''' be installed in a dir called [http://extensions.openoffice.org/servlets/ReadMsg?list=dev&msgNo=142 NAME.oxt, NAME.uno.pkg or NAME.zip]  
+
# Unpacked Extensions '''Must''' be installed in a dir called [http://extensions.openoffice.org/servlets/ReadMsg?list=dev&msgNo=142 NAME.oxt, NAME.uno.pkg or NAME.zip] <BR>
1. An extension should normally just be able to just Require: an appropriate openoffice.org component e.g. openoffice.org-core, without a specific n-v-r as extensions use the stable UNO abi which rarely changes, and then only to add extra apis. So unless you require a specific feature of a openoffice.org release there is no need to require a specific n-v-r and force a rebuild on every n-v-r of openoffice.org.
+
# An extension should normally just be able to just Require: an appropriate openoffice.org component e.g. openoffice.org-core, without a specific n-v-r as extensions use the stable UNO abi which rarely changes, and then only to add extra apis. So unless you require a specific feature of a openoffice.org release there is no need to require a specific n-v-r and force a rebuild on every n-v-r of openoffice.org.<BR>
1. extensions '''Must''' be named openoffice.org-FOO. The location where an extension is unpacked '''Must''' be in an arch or arch-independent location depending on if the extension has been written in an arch or arch-independent language. e.g. StarBasic and Java only extensions are noarch and '''Must''' be unpacked under /usr/share/openoffice.org/extensions, while e.g. C++ extensions are arch-dependant and '''Must''' be unpacked under %{_libdir}/openoffice.org/extensions.
+
# extensions '''Must''' be named openoffice.org-FOO. The location where an extension is unpacked '''Must''' be in an arch or arch-independent location depending on if the extension has been written in an arch or arch-independent language. e.g. StarBasic and Java only extensions are noarch and '''Must''' be unpacked under /usr/share/openoffice.org/extensions, while e.g. C++ extensions are arch-dependant and '''Must''' be unpacked under %{_libdir}/openoffice.org/extensions.<BR>
1. extensions are similar to e.g. xorg video drivers in that there exist proprietary or binary only extensions, but of course normal Fedora rules apply to what extensions can be packaged, i.e. see normal packaging licensing etc. rules. The license '''Must''' be acceptable, and the package '''Must''' be built from source.
+
# extensions are similar to e.g. xorg video drivers in that there exist proprietary or binary only extensions, but of course normal Fedora rules apply to what extensions can be packaged, i.e. see normal packaging licensing etc. rules. The license '''Must''' be acceptable, and the package '''Must''' be built from source.<BR>
1. extensions can be written in any language that has a uno binding, e.g. C++, python, java or StarBasic. Consider the additional packaging guidelines of the language that the extension is written in if such guidelines exists.
+
# extensions can be written in any language that has a uno binding, e.g. C++, python, java or StarBasic. Consider the additional packaging guidelines of the language that the extension is written in if such guidelines exists.<BR>
1. Some obsolete versions of openoffice.org < F9 had bugs in unopkg, so the minimum Requires are: 2.3.0-6.12 for F8, and 2.3.0-6.6 for F7
+
# Some obsolete versions of openoffice.org < F9 had bugs in unopkg, so the minimum Requires are: 2.3.0-6.12 for F8, and 2.3.0-6.6 for F7<BR>
 
+
<BR>
..
+
..<BR>
An example is...
+
An example is...<BR>
 
<pre>
 
<pre>
 
Requires(pre):    openoffice.org-core >= 2.3.0-6.6
 
Requires(pre):    openoffice.org-core >= 2.3.0-6.6
Line 30: Line 30:
  
 
%post
 
%post
unopkg add --shared --link %{_datadir}/writer2latex.uno.pkg || :
+
unopkg add --shared --force --link %{_datadir}/writer2latex.uno.pkg || :
  
 
%preun
 
%preun
Line 40: Line 40:
 
unopkg list --shared > /dev/null 2>&1 || :
 
unopkg list --shared > /dev/null 2>&1 || :
 
</pre>
 
</pre>
 +
[[Category:Packaging guidelines]]

Latest revision as of 19:18, 17 February 2010

[edit] OpenOffice.org extension rpm guidelines

  1. Extensions deinstalled with unopkg remove Must have a %postun of 'unopkg list --shared > /dev/null 2>&1' because the actual removal of files is deferred until the next start, so this ensures that this takes place under the control of your rpm on deinstallation.
  2. Extensions Should be both installed unpacked and then registered with 'unopkg --link' where possible to save disk-space. Otherwise during registration of a packed .oxt or .uno.pkg with unopkg the package is automatically unzipped and the contents copied into a persistent cache directory. Using -link and an unpacked .oxt/.uno.pkg dir allows this additional copy to be omitted and importantly allows the rest of the standard rpmbuild tooling to determine additional autorequires for a package or find flaws that cannot be seen in the opaque zip case.
  3. Unpacked Extensions Must be installed in a dir called NAME.oxt, NAME.uno.pkg or NAME.zip
  4. An extension should normally just be able to just Require: an appropriate openoffice.org component e.g. openoffice.org-core, without a specific n-v-r as extensions use the stable UNO abi which rarely changes, and then only to add extra apis. So unless you require a specific feature of a openoffice.org release there is no need to require a specific n-v-r and force a rebuild on every n-v-r of openoffice.org.
  5. extensions Must be named openoffice.org-FOO. The location where an extension is unpacked Must be in an arch or arch-independent location depending on if the extension has been written in an arch or arch-independent language. e.g. StarBasic and Java only extensions are noarch and Must be unpacked under /usr/share/openoffice.org/extensions, while e.g. C++ extensions are arch-dependant and Must be unpacked under %{_libdir}/openoffice.org/extensions.
  6. extensions are similar to e.g. xorg video drivers in that there exist proprietary or binary only extensions, but of course normal Fedora rules apply to what extensions can be packaged, i.e. see normal packaging licensing etc. rules. The license Must be acceptable, and the package Must be built from source.
  7. extensions can be written in any language that has a uno binding, e.g. C++, python, java or StarBasic. Consider the additional packaging guidelines of the language that the extension is written in if such guidelines exists.
  8. Some obsolete versions of openoffice.org < F9 had bugs in unopkg, so the minimum Requires are: 2.3.0-6.12 for F8, and 2.3.0-6.6 for F7


..
An example is...

Requires(pre):    openoffice.org-core >= 2.3.0-6.6
Requires(post):   openoffice.org-core >= 2.3.0-6.6
Requires(preun):  openoffice.org-core >= 2.3.0-6.6
Requires(postun): openoffice.org-core >= 2.3.0-6.6

%install
mkdir -p $RPM_BUILD_ROOT%{_datadir}/openoffice.org/extensions/writer2latex.uno.pkg
unzip target/lib/writer2latex.uno.pkg -d $RPM_BUILD_ROOT%{_datadir}/openoffice.org/extensions/writer2latex.uno.pkg

%pre
if [ $1 -gt 1 ] ; then
unopkg remove --shared org.openoffice.legacy.writer2latex.uno.pkg || :
fi

%post
unopkg add --shared --force --link %{_datadir}/writer2latex.uno.pkg || :

%preun
if [ $1 -eq 0 ] ; then
unopkg remove --shared org.openoffice.legacy.writer2latex.uno.pkg || :
fi

%postun
unopkg list --shared > /dev/null 2>&1 || :