Deploying NeoOffice on Multiple Architectures

From NeoWiki

Jump to: navigation, search

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


[edit] 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.

[edit] 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 code is not designed to operate in a world of fat binaries; among other things, the 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 per mirror each month (about 30 TB each month across the global mirror network), 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. Instead, NeoOffice ships processor-specific binaries, and each user downloads only the code actually needed by the user's Mac.

[edit] 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.

[edit] Carbon Copy Cloner with rc.local and soft links

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

  • On a PowerPC Mac, install NeoOffice and apply the latest patch. Copy the final application to an external drive or network share.
  • On an Intel Mac, install NeoOffice and apply the latest patch. Copy the final application to an external drive or network share.
  • On your master image (or Mac that will be imaged), arrange the two platform-specific copies of NeoOffice in subfolders of the /Applications folder, e.g.
    /Applications /NeoResources /PowerPC / /Intel /
  • Ensure that there is no copy of in the /Applications folder itself.
  • 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/ softlink to the correct copy of NeoOffice depending on the machine type. 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 TextEdit application and copy the lines below into a new TextEdit document (this example assumes you are using the /Applications/NeoResources hierarchy described above):
    if [ ! -d "/Applications/" ] ; then if [ `/usr/bin/uname -p` = "powerpc" ] ; then /bin/ln -sf "/Application/NeoResources/PowerPC/" \ "/Applications/" else /bin/ln -sf "/Application/NeoResources/Intel/" \ "/Applications/" fi fi
    • Select Make Plain Text from the Format menu.
    • Then select Save from the the File menu.
    • When the Save dialog appears, set the Plain Text Encoding pop-up to Unicode (UTF-8) and save the file anywhere you like.
    • If you do not already have an /etc/rc.local file (this will be the case 99% of the time), move the file that you saved in the previous step to /etc/rc.local using the following Terminal commands (the following example assumes the file is named Untitled.txt and is saved on your Desktop):
      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 verify that you have administrator access.
  • When you reboot your imaging machine, the command will run and create the softlink.
    N.B.: the script will do nothing if there is a real already in the /Applications folder.
    However, the script will replace any existing symbolic link with a new one. Also, the script will run automatically each time you boot the machine so if the softlink gets accidently deleted or changed, a reboot should fix it.
  • Before rebooting, you can test if the command will work by executing the following Terminal command and then checking if appears in the /Applications folder.
    sudo sh /etc/rc.local
    • After you run the command, press --Esc, click on Finder in the Force Quit Applications window, and press Relaunch to relaunch the Finder. If the script worked, there should be a icon in the /Applications folder and the icon will have a little arrow on it.

[edit] NetRestore with Post-Action Script

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

  • Put both versions of NeoOffice on the 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.

[edit] References

Personal tools