[Pythonmac-SIG] Scripting and Packaging for an OSX release of an X11 Python App

Robert Ferguson robert.ferguson at gmail.com
Thu Jun 24 15:23:44 EDT 2004


Dear List,

I'm trying to roll out a package (.pkg) distribution of an X11
application called <a href="http://dkc.jhu.edu/gamera/">Gamera</a>
without using the graphical tools (there will be lots of builds, I
would prefer to script when possible). Unfortunately Python/Distutils
under OSX puts the binary in
/System/Library/Frameworks/Python.framework/Versions/2.3/bin and when
I create a package for this it trashes the symbolic links because of
the well known issues with pax.  I have the following goals:

1) Script the build process (no GUI tools)
2) Not require the user to download extra software beyond wxPython
3) Create a double clickable ".app" file for the GUI (gamera_gui)
4) Put the whole thing in a .dmg via scripting

To a certain extent I understand what is involved, but I would like
opinions and suggestions on the most correct method.  Just so you
know, I noticed <a href="http://ii2.sourceforge.net/">i-Installer</a>,
but it would require our users downloading more software and I would
likely not be able to script the build process.  Below is a list of
what I've found.  Please suggest any improvements or alternatives:

SCRIPTABLE PACKAGING

<a href="http://starship.python.net/~gherman/projects/buildpkg/">buildpkg</a>
is a tool in python, but it does use pax in the "_addArchive"
function.  Since tar retains symbolic links it might be modified with
something like:

        import tarfile
        # create archive
        os.chdir(self.sourceFolder)
        base = basename(self.packageInfo["Title"]) + ".tar"
        self.archPath = join(self.packageResourceFolder, base)
        archPath = self._escapeBlanks(self.archPath)
        # Original Line:
        # cmd = "pax -w -f %s %s" % (archPath, ".")
        tar = tarfile.open(base, "w")
        tar.add(archPath)
        tar.close()
        targz = tarfile.open(base+".gz", "w:gz")
        targz.add(base)
        targz.close()

I'm not sure on this at all yet.  Is there any better solutions out
there?  It seems like this has been a problem for a while.

DOUBLE CLICKABLE .APP

<a="http://www.macosxhints.com/comment.php?mode=display&sid=20040226174801525&title=Create+a+dockable+X11+application&pid=0">There
was already a macosxhints conversation</a> about this problem, but I
didn't see a conclusive answer.  I did notice that
<a="http://gimp-app.sourceforge.net/">the gimp.app</a> uses a modifed
version of  <a href="http://sveinbjorn.vefsyn.is/platypus">Platypus</a>.
 I was able to take an <a
href="http://hacks.oreilly.com/pub/h/901">O'reilly Hack</a> and
Platypus to make a double clickable version.  I didn't mind this other
than that it seem 1) A little convoluded 2) Would require either using
a GUI or writing a modified version in Xcode in order to script it. 
Is there a better way?

DMG

In order to make a DMG file I noticed an easier
<a="http://richkilmer.blogs.com/ether/2003/12/creating_panthe.html">method</a>
.  Is there any problems with doing it this way instead of the <a
href="http://starship.python.net/~gherman/projects/buildpkg/builddmg.dmg">builddmg.dmg</a>
method?

My colleague came up with <a
href="http://cvs.sourceforge.net/viewcvs.py/gamera/gamera/gamera/mac/makedmg.py">this</a>
method.  It too could likely be improved by using the simple method by
Rich Kilmer.


Any thoughts?

Kind Regards,
Robert Ferguson



More information about the Pythonmac-SIG mailing list