I'm trying to create a .deb for a python-based IRC bot. I've already gone through the Ubuntu Packaging Guide, and done a debuild -S on it to create the source package.

When its uploaded to the PPA, it fails to include the code for the bot (which is necessary for the bot to run). How do I make the .deb so that it (a) isnt a source package, and (b) includes the code for the bot so that it can be run?

And by "includes the code for the bot so that it can be run", I mean so that the .deb extracts the code to the location in the virtual file structure that I specified so that it can be used by any user. Note that because its a python bot, there's no single executable file in the code, which explains the need for the source to be packaged and extracted with the .deb

  • Oh, and to answer your first question, just run debuild without -s to build a binary package. – Nathan Osman Mar 13 '11 at 19:31
  • Regarding that, i did that before, and the PPA system wouldnt accept it :/ – Thomas Ward Mar 13 '11 at 19:56
  • @Evil: You can only upload source files. – Nathan Osman Mar 13 '11 at 20:04
  • @George: Will the files subsequently be built on the PPA so that they install (i.e. end up as the binary .deb)? – Thomas Ward Mar 13 '11 at 20:05
  • @Evil: Yes, that's exactly what happens. – Nathan Osman Mar 13 '11 at 20:09

First of all, assuming your package is named ircbot, create a file named ircbot.install in the debian folder. This file contains instructions for the installer to copy certain files to their destination in the virtual filesystem you are referring to.

From there, it's simply a matter of adding the names of the files you want copied.

So, if you have a file bot.py that goes to /usr/share/ircbot/bot.py, you would add a line to ircbot.install like so:

bot.py usr/share/ircbot
  • I've gotta have a "Stalker Alert" for ya dude, you answer most of my questions :P On another note, given that the bot is modular, and requires about 18 other python files to operate (and its all stored in multiple folders), is there a way I can specify "Copy all from the folder here TO /usr/share/ircbot/" ? – Thomas Ward Mar 13 '11 at 19:32
  • @Evil: I'm sure there is... but I don't know what it is :P – Nathan Osman Mar 13 '11 at 20:10
  • Well this should work. Lets hope that it operates right (and copies files where they belong) with the PPA after its all built ;) – Thomas Ward Mar 13 '11 at 22:45

Create an "install" file in the "debian" folder, like this:

local_file /system/path/where/to/copy/file
local_file2 /system/path/where/to/copy/file2
.... add as many files/folders as you want

Then, installing the .deb will only move the files to the right folders.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.