the Luggage
The Luggage is a very clean approach to creating packages. It is written by Joe Block. There are a couple of reasons why you should use this instead of a gui tool like packagemaker, iceberg or composer. [insert reasons here]
There is a good documentation page here: http://luggage.apesseekingknowledge.net/ and a git repository here: http://github.com/unixorn/luggage/
There is some stuff you need to know to get it setup properly, there are some minor bugs in luggage.make which is the driving script and there are some things you need to know to create a package that are not obvious for people not accustomed to Makefiles.
I had to read a couple of tutorials about make to understand what exactly is going on in the script, although it utilizes only a small subset of the available make commands. I put up a a brief tutorial which touches on the used commands.
Requirements
You need an OSX workstation with the Developer tools installed (the luggage needs the packagemaker commandline interface and also ‘make’)
Setup
First, download the zip:
luggage.zip (19.81 KB)I fixed the version that is available on the downloads page which had a typo that prevented it from creating installers for GUI Applications.
Unzip the file.
There are two files that have to go in /usr/local/share/luggage (you have to create this path)
- luggage.make
- prototype.plist
You could put these somewhere else, and change two paths in the Makefiles you are going to create.
Run an example
Just to test that you have everything in place, you could run an example that is provided in the unixorn-luggage-8ef104f directory.
Open a terminal and cd into unixorn-luggage-8ef104f/examples/setup_kerberos
type make pkg
it will prompt you for an admin password if you are not root (luggage uses sudo for all operations)
after some terminal-twitter you will have a timestamped package with a kerberos config file in it.
Amazing isn’t it?
if you type make dmg you’ll get a package wrapped in a dmg ready to deploy on a webserver. I use this to create dmg’s that instaUp2date can download for a build.
Create a Firefox installer
Now we can get to business and create our own package Makefile. It is important to keep in mind that make expects all files to be in the same directory as the Makefile (unless stated otherwise), this was not clear for me in the luggage documentation.
Ok we create a new directory, let’s call it install_firefox.
Download the latest version of Firefox and put it into our new directory.
We’ll have to remove the quarantaine attribute to get rid of the warning:
mcalubook:~ bochoven$ cd Desktop/install_firefox/
mcalubook:install_firefox bochoven$ xattr -d com.apple.quarantine Firefox.app
Now compress the App so it becomes portable:
mcalubook:install_firefox bochoven$ tar cvjf Firefox.app.tar.bz2 Firefox.app
Now in your favorite (plain) texteditor create a new file and copy-paste the following:
include /usr/local/share/luggage/luggage.make
TITLE=install_firefox_app
REVERSE_DOMAIN=com.example.corp
PAYLOAD=unbz2-applications-Firefox.app
Save it as “Makefile” inside install_firefox make sure you uncheck “If no extension is provided, use txt”.
now we return to the terminal and type make pkg
And now we should have a nicely packaged Firefox.app
If you want to try out the package on the machine that you just used to create the package, first do a make clean, otherwise the installer is going to put the package in the fake root that the luggage created. I don’t know why this happens but the make clean fixes this.
Create a better Firefox installer
# This makefile creates a package or a dmg from any application
# that sits next to it
# make pkg
# make dmg
include /usr/local/share/luggage/luggage.make
pack-applications-%: % l_Applications
@sudo ${CP} -R "$<" ${WORK_D}/Applications
@sudo chown -R root:admin ${WORK_D}/Applications/"$<"
@-sudo /usr/bin/xattr -d com.apple.quarantine ${WORK_D}/Applications/"$<"
TITLE := $(shell echo *.app | sed -e 's/\.app//' -e 's/ /_/g')
PACKAGE_NAME=${TITLE}
REVERSE_DOMAIN=com.example.corp
PAYLOAD=pack-applications-*.app
some exlanation
Comments:
Roy Nielsen
2011-08-29 15:19:37
Another site on using luggage:
http://glarizza.posterous.com/an-intro-to-using-the-luggage-for-packaging
Roy Nielsen
2010-12-23 16:19:20
One can do the following to get the “version” to be part of the package name:
MYPWD=$(shell pwd)
TITLE := $(shell echo *.app | sed -e ‘s/\.app//’ -e ‘s/ /_/g’)
MYVER=$(shell defaults read ${MYPWD}/${TITLE}.app/Contents/Info CFBundleVersion)
PACKAGE_VERSION=${MYVER}
REVERSE_DOMAIN=com.example.corp
PAYLOAD=pack-applications-*.app