Re: packaging help?



On Sun, 2010-04-18 at 15:19 -0400, Jeremy Volkening wrote:
Hello,

I'm wondering if anyone can point me toward a good source of
documentation on packaging applications (build on gtk2-perl) for
Debian-based distros?

The easiest way I have found is to organise your source files in the
standard layout used by CPAN distributions.  You might look at using
Module::Starter to get a skeleton layout.

Once you've done that, you can use the dh-make-perl tool (available via
apt-get) to create a .deb from the top-level directory of your source,
e.g.:

  dh-make-perl --build .

For an example, see this project (a GTK app for bulk-copying USB keys):

  http://github.com/grantm/usb-key-copy-con

Scroll down that page for a screenshot and project overview.

In this example, almost all my code lives in .pm files in the 'App::*'
namespace under the lib directory, e.g.:

  lib/App/USBKeyCopyCon.pm

The app uses some custom icons that live in a .pm file:

  lib/App/USBKeyCopyCon/Chrome.pm

There's also a .wav file that lives in the same directory - that's
probably not strictly kosher but it works :-)

The script which is used to launch the app is a simple wrapper that
lives in the bin directory.

When dh-make-perl turns it all into a .deb, the .pm files get installed
under /usr/lib and the wrapper script ends up in /usr/bin.

If your app depends on other packages, you would edit the debian/control
file (which was generated by dh-make-perl) to list the dependencies and
then rebuild the .deb with:

  dpkg-buildpackage -rfakeroot

On a related note, I will need to figure out the correct way for my main
app script to find the extra libraries once they are installed.

Are these libraries part of your app?  If so, just put them in the lib
directory of your source tree and everything should be fine.  If not,
then they should be packaged separately.  It certainly wouldn't be
kosher for files in a .deb to depend on files living under /usr/local.

Cheers
Grant





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