Deploying NeoOffice on Multiple Architectures

From NeoWiki

Revision as of 06:40, 23 August 2008 by Sardisson (Talk | contribs)
Jump to: navigation, search
This article is not up to date, or it needs structural or stylistic changes to conform with the rest of this wiki.

or, why there are no Universal Binaries of NeoOffice and how to work around it

Contents

About Universal Binaries

When Apple switched processor architectures for the third time, from PowerPC to Intel x86, the migration was eased by the old Apple and NeXT concepts of "fat" applications or Universal Binaries. All the code required to run on each processor is shipped in a combined executable, so users only have to deal with a single, albeit large, application, no matter what kind of Mac they have.

Why isn't NeoOffice a Universal Binary?

Unfortunately, there are technical and resource limitations that prevent shipping NeoOffice as a Universal Binary. NeoOffice's underlying OpenOffice.org code is not designed to operate in a world of fat binaries; among other things, the OpenOffice.org build process creates binaries with different filenames on different architectures (for example, the shared library that contains the code to import StarOffice 5 files is liblegacy_binfilters680mxi.dylib on Intel Macs and liblegacy_binfilters680mxp.dylib on PPC Macs). These varying filenames prevent combining the two processor-specific library files into one fat library that works on both types of Macs.

In addition, even if it were technically possible to create a Universal NeoOffice, there are severe resource constraints that make a Universal Binary infeasible for an open source project the size of NeoOffice. As of mid-2008, NeoOffice binary downloads require over 4 TB of bandwidth each month, and releasing a Universal Binary would needlessly double this load on the NeoOffice servers and the very generous mirrors, as well as double download time (and bandwidth, for those on metered connections) for all NeoOffice users. While download time and bandwidth may not be of concern for smaller applications or applications released by large corporations, for an entire office suite released by a small open-source project (with distribution shared between NeoOffice servers and volunteer mirrors), these resource demands are prohibitive.

How Can I Deploy NeoOffice to both PPC and Intel Macs Using a Single, Universal Image?

We are aware that many organizations wish to deploy NeoOffice across a lab or office environment of mixed PowerPC and Intel Macs by using an (otherwise-) universal image. Although the lack of a Universal Binary of NeoOffice complicates this, there are solutions available that will ensure that the correct copy of NeoOffice is used on each Mac.

Regardless of which solution you choose, you should also develop a plan for updating NeoOffice; patches fixing bugs are released on average every two weeks, and it is important to keep NeoOffice up-to-date. If you wish to manage patch installation centrally, see Disabling Patch Checking for more information.

Carbon Copy Cloner with rc.local and soft links

N.B. The following solution is still undergoing testing and there may yet be unresolved problems.

The following solution[1] was proposed by NeoOffice developer for users of Carbon Copy Cloner:

  • Install the Intel and PowerPC versions of NeoOffice and bury them in a subfolder of the /Applications folder.
  • Add the following shell script lines to the /etc/rc.local file.
    This file gets executed by the root user at boot time and this command will make a /Applications/NeoOffice.app softlink to the correct installation depending on your machine type for all users on a machine. If the /etc/rc.local file will be on the Carbon Copy Cloner image, each machine that you clone to will get this script automatically.
  • Open the /Applications/TextEdit application, copy the lines into a new TextEdit document.
    if [ ! -d "/Applications/NeoOffice.app" ] ; then if [ `/usr/bin/uname -p` = "powerpc" ] ; then /bin/ln -sf "/path/to/PowerPC/NeoOffice.app" \ "/Applications/NeoOffice.app" else /bin/ln -sf "/path/to/Intel/NeoOffice.app" \ "/Applications/NeoOffice.app" fi fi
  • Select the Format :: Make Plain Text menu and then the File :: Save menu. When the Save dialog appears, set the Plain Text Encoding field to "Unicode (UTF-8)" and save it anywhere you like.
  • Move the file that you saved (in the following example I assume you named it Untitled.txt and saved it to your Desktop) to /etc/rc.local using the following Terminal commands:
    sudo cp ~/Desktop/Untitled.txt /etc/rc.local sudo chown root:wheel /etc/rc.local
    Note that with the first command Mac OS X will prompt you for your password to validate that you have administrator access.
  • Before rebooting, you can test if the command will work by executing the following Terminal command and then checking if NeoOffice.app appears in the /Applications folder in the Finder (note: the script will do nothing if there is a real NeoOffice.app already in the /Applications folder). After you run the command, press Command-Opt-Escape, click on Finder, and relaunch the Finder. If the script worked, there should be a NeoOffice.app icon in the Finder's /Applications folder and the icon will have a little arrow on it:
    sudo sh /etc/rc.local

NetRestore with Post-Action Script

The following solution[2] was proposed by NeoOffice user oihenart:

  • Put both versions of NeoOffice on our image, one in a PPC folder, the other in a Intel folder.
  • When using NetRestore to restore the image to a Mac, use a post-action script which will move NeoOffice either from PPC or Intel folder to the Applications folder and then delete the folders.

References

Personal tools