OpenOffice.org 1.9.x in Slackware
By: Miguel Manuel Meléndez Gómez (miguelmmg at yahoo dot com dot mx)
Traduced by: Fernando Flores Ortiz (gplsource at gmail dot com)
First release: 20050720-1-es
Updated: 20050810-en
Description
This document describes the procedure to install OpenOffice.org 1.9.x in Slackware and optionally to generate compatible an installable file .tgz with the own system of packages of this distribution.
Requirements
. Slackware 10,1 or current (I have not proven it in previous versions).
. OpenOffice.org 1.9.xxx (downloadable of the official site). In order to write this document version 1.9.118. was used. Package of Spanish language for OOo 1.9.xxx (downloadable of the official site).
. It is required to have installed the packages: cpio, tar, pkgtools of series A; rpm of series AP. Optional the package of Gnome 2,6 that comes in Slackware, some superior version of Gnome of alternating projects like Gware, Freerock or KDE 3.x.
. 500 MB of temporary space in disc if a package is not generated (OOo occupy already installed about 280 MB), 700 MB if it is going away to generate a package. When finalizing the used archives and temporary directories can be eliminated, releasing between 200 and 300 MB).
Considerations
- $HOME is the personal directory of the actual user.
- $OOTMP is the directory where I will extract the rpm archives from installation.
- $TMPROOT is the directory where I am going to extract the content of each RPM.
- When commands be executed:
($) Executed by user
(#) Executed by root.
Procedure
We extract the content of the downloaded file of the site of OpenOffice.org in a temporary directory:
$ cd $OOTMP
$ tar zxvf OOo_1.9.118_LinuxIntel_rpm_install.tar.gz
The 'RPMS' directory contains the installation rpm archives and an additional directory called 'desktop-integration' with some additional rpm archives. We are going to extract the content of each one of the rpm archives within an additional temporary directory to the previous one with the purpose of analyzing "the installed" product.
$ cd $TMPROOT
$ for i in $OOTMP/RPMS/*.rpm; do rpm2cpio $i | cpio -id; done
As result we obtain the directory opt/openoffice.org1.9.118 that is where is all the necessary to run OpenOffice.org in english.
Note: If you're not interested for generate the Slackware package either the integration of OOo with Gnome or KDE, the procedure finishes here moving the directory opt/openoffice.org1.9.118 to another one where you have rights to access and run. To run OOo, you need to run the command 'soffice' within the directory 'program'.
Now, we need to extract the necessary files to integrate it with Gnome and KDE (assumed with any compatible desktop with the freedesktop.org specification).
$ cd $TMPROOT
$ rpm2cpio $OOTMP/RPMS/desktop-integration/openofficeorg-freedesktop-menus-1.9.118-1.noarch.rpm | cpio -id
$ rpm2cpio $OOTMP/RPMS/desktop-integration/openofficeorg-suse-menus-1.9.118-1.noarch.rpm
The freedesktop file contains the icons and MIME information to register the application with the applications that are compatible with the standard freedesktop, like Gnome 2.10.2. Nevertheless, if we used Gnome 2.6, the last one which it comes with Slackware of official form, we will need additional archives to register OpenOffice.org. I selected the package for SUSE because it contains part of which we are going to need to integrate it with KDE and Gnome 2.6. When extracting these archives we will observe additional directories to opt/openoffice.org1.9.118:
usr/bin
usr/share/applications
usr/share/icons
usr/share/mime
opt/gnome
opt/kde3
Here it is necessary to make some corrections, since usr/bin make reference to '/etc/openoffice.org1.9.118' (link that don't exist).
$ cd $TMPROOT
$ cd usr/bin
$ rm soffice
$ ln -s /opt/openoffice.org1.9.118/program/soffice soffice
$ sed 's/\/etc\/openoffice\.org-1\.9/\/opt\/openoffice\.org1\.9\.118/' openoffice.org-1.9 > OOotmp.tmp
$ mv OOotmp.tmp openoffice.org-1.9
$ sed 's/\/etc\/openoffice\.org-1\.9/\/opt\/openoffice\.org1\.9\.118/' openoffice.org-1.9-printeradmin > OOotmp.tmp
$ mv OOotmp.tmp openoffice.org-1.9-printeradmin
$ chmod a+x openoffice.org-1.9*
NOTE: A text editor can be used to change the content of ' openoffice.org-1.9 ' and ' openoffice.org-1.9-printeradmin', instead of the previous commands.
We need to fix the links in the .desktop files:
$ cd $TMPROOT
$ cd usr/share/applications
$ rm openoffice.org-1.9-*.desktop
$ for i in base calc draw impress math printeradmin writer; do ln -s /opt/openoffice.org1.9.118/share/xdg/$i.desktop $i.desktop; done
Now we completed the KDE and Gnome integration moving the necessary directories to its own locations within Slackware:
$ cd $TMPROOT
$ cd opt/gnome/share
$ mv application-registry mime-info ../../../usr/share
$ cd ../..
$ rm -rf gnome
$ mv kde3 kde
Finally we are going to create a Slackware package from the structure which we have in $TMPROOT. For it is necessary to create a file (inside the install directory) called 'slack-desc' with a brief description of the content of the package, we can use this as example:
|-----handy-ruler------------------------------------------------------|
openoffice.org: OpenOffice.org
openoffice.org:
openoffice.org: OpenOffice.org is both a multi-platform and
multi-lingual
openoffice.org: office suite and an open-source project. Compatible with
all
openoffice.org: other major office suites, the product is free to
download,
openoffice.org: use, and distribute.
openoffice.org:
openoffice.org:
openoffice.org:
openoffice.org:
openoffice.org:
$ cd $TMPROOT
$ mkdir install
$ cd install
After created the 'slack-desc' file (like the previous example) we need to creat a 'doinst.sh' file that contains these two lines:
( if which update-mime-database; then update-mime-database/usr/share/mime; fi ) &> /dev/null
( if which update-desktop-database; then update-desktop-database; fi ) &> /dev/null
You need to give execution rights to the shell script ' doinst.sh':
$ chmod a+x doinst.sh
The previous thing is for regenerate the cache of /usr/share/mime and menus. The file 'doinst.sh' is executed when the installation of the package finalize.
The final step is to generate the package:
$ cd ..
$ su
# chown -R root: *
# makepkg -l y -c y -p openoffice.org-1.9.118-i586-1xxx.tgz
# installpkg openoffice.org-1.9.118-i586-1xxx.tgz
NOTE: Instead -1xxx you can use anything (1= version, xxx = personal identifier). Example:
# makepkg -l y -c y -p openoffice.org-1.9.118-i586-1extz.tgz
Final Comments
In Gnome 2.6, the icons of the archives with own extensions of OpenOffice.org 1.x are replaced by which it brings OOo and are added again the design for version 2.
In Gnome 2.10.2 (of Gware) they were already had contemplated the icons for the applications of OOo 1.x and 2, except OpenOffice.org Base and Draw 2, reason why only in the odg and odb files you will see the new icons. A solution, that I will not explain here at the moment, is to replace the icons of the Gnome theme for the new MIME types of OOo 2.
The OOo RPM's has scripts of installation, nevertheless, do not have effect (according to me) in Slackware, reason why I have not included them here. If you wish to see scripts contained in each RPM you can use:
$ for i in *.rpm; do echo $i; echo -----; rpm -qp --scripts $i; echo -----; echo; done | less
I would like to receive comments and contributions about this guide and I hope this will be useful for you.
Miguel Manuel Meléndez Gómez (miguelmmg at yahoo dot com dot mx)
Files:
Original guide in spanish
Guide in english