Bacula 3.0.1 for Mac OS X
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;
- src/filed/bacula-fd
- src/filed/bacula-fd.conf
- src/console/bconsole
- src/console/bconsole.conf
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.
Enjoy :)
I’m a packaging/bacula noob, but if i’m reading your post right, I need to place bacula-fd.conf, bacula-fd, bconsole.conf, etc. into appropriate dirs (/usr/local/etc, bin, share) that I create on the machine that I’m building the package on. When i take that built package and install it on another mac, does it create the necessary directories for me?
Joon,
You place the conf files and so forth into the *false root* directory… so ~/src/bacula/usr/local/etc or whatever. Dont put them into the “real” /usr/local/etc/.
To answer the second part, yes, the installer package will create any missing dirs with whatever permissions you set in Package Maker.app.
One last question, where did you get the .plist from?
Joon,
Good question :) I honestly don’t remember. I probably based it off some other plist?
Sorry