[jokosher-devel] Packages



I know other people may be working on this but I've been reading up on debian 
packaging and python's distutils package to further my own knowledge a bit. 
I've come up with a debian package for jokosher and it would be nice if 
someone could give it a try and let me know how far I've gone wrong regarding 
where files are placed in the file system and even if it works. 

It's at http://www.jandtdesigns.co.uk/junk2/jokosher-0.1.deb

There was a little glitch I found with opening existing packages. Jokosher 
caches the instrument images by reading them from the location they are 
installed on (in this 
case /usr/lib/python2.4/site-packages/jokosher/Instruments/images). However 
the project file contains, for each instrument, the full path to the file 
where the image *originally* came from i,e, where your svn jokosher lives and 
Jokosher looks for a match in the cached list and will fail. This will 
probably happen with the final real package. (maybe fix to read the image 
from file if it isn't in the cache? or leave to fix later as it will only 
affect devs and they can still use their old projects by unzipping the 
project file, editting and rezipping)

I added a two line script /usr/bin/jokosher just to start it up and the 
__init__.py added so python recognises it as a package (it's empty but we 
seem to need one there).

What I actually used to build the package was distutils using the following 
setup.py script after checking out latest svn into a subfolder jokosher:

from distutils.core import setup
import glob
setup(name='jokosher',
  version = '0.1',
  url = "http://www.jokosher.org";,
  scripts = ['jokosher/jokosher'],
  packages = ['jokosher'],
  package_dir = {'jokosher':'jokosher'},
  package_data = {'jokosher':['images/*.png', 'Instruments/*.instr',
      'Instruments/images/*.svg', 'Jokosher.glade', 'jokosher.png']},
  data_files = [('share/doc/jokosher/userguide', 
['jokosher/doc/userguide/jokosheruserguide.html']),
                ('share/doc/jokosher/userguide/images', 
glob.glob('jokosher/doc/userguide/images/*'))]
  )

The interesting part about distutils is that it can generate binary, 
source,rpms and even windows installers from the same setup script. But not 
debs although unzipping the default binary distribution and adding a 
DEBIAN/controls is all that's needed.

I also have a source tarball at 
http://www.jandtdesigns.co.uk/junk2/jokosher-0.1.tar.gz which can be 
installed by unzipping and running
 
 sudo python setup.py install --record filelist

(the --record  option saves a list of all files installed - *very* handy for 
uninstalling)

-- 
John Green

john thegreens co uk



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]