Similarly, if you want to install bar as /usr/local/bin/bar, add pack-usr-local-bin-bar to PAYLOAD.
Available PAYLOAD additions
Rule | Ownership | Permissions | Destination |
pack-etc-foo | root:wheel | 644 | /etc/foo |
pack-usr-bin-foo | root:wheel | 755 | /usr/bin/foo |
pack-usr-sbin-foo | root:wheel | 755 | /usr/sbin/foo |
pack-usr-local-bin-foo | root:wheel | 755 | /usr/local/bin/foo |
pack-usr-local-sbin-foo | root:wheel | 755 | /usr/local/sbin/foo |
pack-hookscript-foo | root:wheel | 755 | /etc/hooks/foo |
pack-Library-LaunchAgents-foo | root:wheel | 644 | /Library/LaunchAgents/foo |
pack-Library-LaunchDaemons-foo | root:wheel | 644 | /Library/LaunchDaemons/foo |
pack-Library-Preferences-foo | root:admin | 644 | /Library/Preferences/foo |
pack-ppd-foo | root:admin | 644 | /Library/Printers/PPDs/Contents/Resources/foo |
pack-user-template-plist-foo | root:wheel | 644 | /System/Library/User\ Template/English.lproj/Library/Preferences/foo |
unbz2-applications-foo | root:admin | based on tarball contents | /Applications/Foo |
ungz-applications-foo | root:admin | based on tarball contents | /Applications/Foo |
unbz2-utilities-foo | root:admin | based on tarball contents | /Applications/Utilities/Foo |
ungz-utilities-foo | root:admin | based on tarball contents | /Applications/Utilities/Foo |
Adding preflight/postflight/postinstall/postupdate scripts
Name the script preflight, postflight, postinstall, or postupdate, then add pack-script-XX to PAYLOAD and it will automatically be added to the final package.
Make targets
- make dmg - create a package, then wrap it in a dmg. Result will be in the current directory.
- make pkg - create a package and copy it into the current directory
- make pkgls - create a package, then list the contents so you can confirm it's generating a package with a payload that matches what you're expecting.
Customizing your packages
How do I add a file to my package that is installed somewhere luggage.make doesn't cover?
luggage.make defines several convenience targets that create various directory paths within the package root. You can use them to create the parent directory for your target location, then create your target location. Here's an example that creates /etc/cups so you can install a custom cupsd.conf
l_cups: l_etc
@sudo mkdir ${WORK_D}/etc/cups
@sudo chown root:_lp ${WORK_D}/etc/cups
@sudo chmod 755 ${WORK_D}/etc/cups
pack-cupsd.conf: l_cups
@sudo ${CP} cupsd.conf ${WORK_D}/etc/cups
@sudo chown root:_lp ${WORK_D}/etc/cups/cupsd.conf
@sudo chmod 644 ${WORK_D}/etc/cups/cupsd.conf
Now all you need to do is add pack-cupsd.conf to your PAYLOAD variable, and make will create /etc/cups in your package root, change the permissions and ownership, then copy in your cupsd.conf.
I need to install foo with permissions different from the defaults luggage.make uses. How do I change the ownership/permissions for files installed using luggage.make?
You could make your changes using a postflight script, but for convenience, luggage.make runs make modify_packageroot
after it has created the package root and copied the install files there, but before it invokes packagemaker's command line tool to create the package.
If you add that target to your package's Makefile, it will override the dummy one in luggage.make and let you change the permissions of files in your package root. ${WORK_D}
contains the path to your package root. For example, if your package installed a modified cupsd.conf to /etc/cups, and you needed it to have a group of _lp, you would add the following to your package Makefile:
modify_packageroot:
@sudo chgrp _lp ${WORK_D}/etc/cups/cupsd.conf
I don't want the package version to be based on the current date. How can I force it to something specific?
By default, luggage.make sets the version number to YYYYMMDD. If you prefer to set it to something specific, set PACKAGE_VERSION=something_numeric.
FAQ
My makefile looks ok, but I get an error about a missing separator
You've probably indented your rules with spaces rather than a tab. Make requires the indentation be with tabs.