XCode PackageMaker Tutorial

packagemaker.jpg I’ve never been satisfied with Fink or Darwin Ports on OS X. So I’m always compiling things from source. This would be fine if I only had to do this once or twice, but I unfortunately I’ve installed PHP and all of it’s dependencies on more computers than I can count. Along with several other handy utilities like wget.

This tutorial assumes that your package is built using gcc and autotools.

1. Configure your application:
This step is extremely important. When you configure the source make sure you add the ‘–prefix’ argument. This path should point to where you want the binaries to be installed temporarily for packaging. I use build everything to the ./export directory, but this could be what ever you choose.

./configure –prefix=<package-dir>/export

Don’t forget to add the other configure options that you wish to use. For a complete list of the configure options for that package type ./configure –help

2. Build your application:
If you have configured your source correctly there’s not much to this step. Just type

make install

and wait for it to finish

3. Open PackageMaker and create a “Single Package Project”
screen 1

4. Enter a title and description for you package. I’m building cURL here so I entered the description from the cURL website.

5. Under the “Contents” tab enter the path to the –prefix directory you specified earlier.
screen 3

6. Now move to the “Configuration” tab and enter the path which you wish to install your package under “Default Location”. If know where it should go then /usr/local is a good bet if your installing any libraries or terminal applications.
screen 4

7. The last step is to add a little version information about the package under the last tab, “Package Version”
screen 5

8. Now Build the Package (Project->Build)

That’s it! Well sort of. This just shows you the quick and dirty way to get a package put together. I strongly recommend playing with all of the other options in PackageManager. There are a lot of other cool things you can do. For instance PackageManager has made it extremely easy to modify the background and graphics in the installer. There is also a command line interface for PackageManager,/Developer/Tools/packagemaker, that makes it possible to automate package building.