I wont be doing a build of Bacula for Mac OS X again any time soon, if at all, for a number of reasons;
- I no longer have access to Mac OS X 10.4 running on an Intel chip
- I am actively transitioning to BackupPC
Below youll find the method I have been using to construct all the .pkg installers youll find on this site. If you have any questions about the process please post them in the comments.
You will need at least three installations of Mac OS X – one 10.4 on PPC, one 10.4 on Intel, and one 10.5 on any architecture. On each 10.4 installation, download the bacula source code, decompress it, and run the following command to compile it in a way that plays nice with the rest of Mac OS X
./configure --prefix=/usr/local --sysconfdir=/usr/local/etc \ --mandir=/usr/local/share/man --enable-client-only \ --with-openssl --with-tcp-wrappers --disable-dependency-tracking \ --with-working-dir=/var/bacula/working make
With that done, copy the compiled binaries from each architecture to your Mac OS X 10.5 installation to build the pkg installer. The files in question are;
I use the architecture type to give them unique names… bacula-fd-ppc and bacula-fd-intel for example. After thats done, use lipo to combine the two binaries into one fat multi-arch binary
lipo -create bacula-fd-intel bacula-fd-ppc -output bacula-fd
Now do the same for bconsole
lipo -create bconsole-intel bconsole-ppc -output bconsole
Having done that you now need to set up a mock directory structure to place the binaries into. You can then use PackageMaker on Mac OS X to build the pkg installer from that mock directory. My directory looks like this;
Library Library/LaunchDaemons Library/LaunchDaemons/bacula-fd.plist usr usr/local usr/local/bin usr/local/bin/bconsole usr/local/etc usr/local/etc/bacula-fd.conf usr/local/etc/bconsole.conf usr/local/sbin usr/local/sbin/bacula-fd usr/local/share usr/local/share/man usr/local/share/man/man8 usr/local/share/man/man8/bacula-fd.8.gz usr/local/share/man/man8/bconsole.8.gz var var/bacula var/bacula/working
You can see where I’ve placed bacula-fd and bconsole as well as their conf files. There are some gzipped man pages in there too, which you can grab out of the compiled source tree and gzip manually. Finally there is a .plist file which is required to make auto startup/shutdown of bacula-fd happen on Mac OS X.
The last important bit to note is that I use some modified .conf files which have special placeholders for host names. I then use pre-inst and post-inst scripts in PackageMaker to look for previous versions of packages, insert the current hostname into the .conf files, etc. I have included my source tree and PackageMaker files and scripts below for the last version I released (2.4.4) for your reference.
After all the above is done and the directory structure is all set up you should be able to just fire up PackageMaker, change a few variables in it (set permissions, set version numbers, make sure proper pre and post-inst scripts are being used, etc.) and then build the pkg installer.