I have been searching for the last two weeks and chased myself into multiple dead ends trying to figure out the path that takes me where I want to go. However I finally have to admit that my answer isn't clearly posted anywhere, and here we are.

I'll start off my clarifying: I don't want to build a redistributable Django "App" which seems to mean "plugin" - This isn't a python plugin, it's a full fledged website with an FCGI server, /etc/init.d script, config file in /etc/djangoapps and a requirements.txt for the plugins my site uses.

I want to build a deb package to allow me to deploy to a Dev and Prod server from a build server (I'm using Bamboo, but Jenkins should be the same principle.)

I also want to do this on Debian 7 Wheezy, not Ubuntu. PKGME Seems to do the job on Ubuntu and Debian 8, however it fails to install in a functional state in Wheezy, and I was unable to find a way to fix it.

So I went with trying setuptools, stdeb, and debuild to create my package, which causes me to wind up with an egg, inside a deb, that does not contain any of my /etc or /usr files.

So what is the proper method here?

  • digitalocean.com/community/tutorials/… Commented Sep 4, 2014 at 12:08
  • Uhm, I was hoping you had some magical answer here but this is irrelevant in several ways. 1. It has nothing to with packaging. 2. Its dealing with Django-CMS and not the Django framework. 3. Its covering how to setup and start building a Django-CMS based website, and Im trying to deploy an already coded Django based website. Commented Sep 4, 2014 at 12:12
  • deb packages aren't typically designed to install stuff in user space, which is what you are going for here. so you might not get much help from packaging tools. Debian of course supports python apps/libraries, but this isn't exactly what you have here. having said that, there is no reason you can't make a deb in a more manual way. just use debhelper/dh (dh is generally recommended these days) and say where you want the files to go. Perhaps state clearly in your question where you want your files to live? You'll probably want your plugins to be packages too, of course. Commented Sep 4, 2014 at 13:10

1 Answer 1


A .deb file obviously can install files under /etc and /usr, otherwise your Debian 7 system could not be installed in the first place using such files, so that is the way to go.

Your problems seem to come from the tools you are using in trying to achieve the task, either you use them in the wrong way, or their "easy-of-use" hides capabilities of the .deb based packages that you need to achieve your task.

A .deb file is just an ar archive that contains 3 files: a version number file and two tar archives (usually compressed). It is easy to unpack with a few commands (ar x ... resp. tar xvf ..) and put together again ( tar cvzf ... resp. ar mc ....). Please note that the `debian_version file has to be first to be moved into the archive.

When I have to make .deb packages I start from an existing package that already does part of what I need and add/change the things as necessary.

More detailed information is of course available if you need to understand how the installers execute the various special scripts that can be in the packages, as well as adding dependencies.

  • I'm using tools because this is intended for a CI build server. No user intervention is possible and the process must be able to be fully automated. I've found several ways to do this for C applications and Java applications and Django 'apps' which are a form a Python module but not for python webapps. Setuptools is a step in the right direction but i need to change the final output so its not packaging a python egg. This answer is not incorrect but absolutely not what applicable to what Im looking fir. Commented Sep 4, 2014 at 13:01
  • @Routh The commands are trivial and easily put into a script. Try the whole thing out from the commandline and then put them in the script like you would do for calling debuild, stdeb. It is unlikely that those commands are available on your server and tar/ar are not.
    – Anthon
    Commented Sep 4, 2014 at 13:11
  • How do I generate a .changes file for upload to a local repository with your method? All my reading has lead me to debuild for this reason. Commented Sep 4, 2014 at 13:17
  • The beauty is that you don't need a .changes file, you just put your new and/or updated files in the extracted directories and put them together again.
    – Anthon
    Commented Sep 4, 2014 at 13:28
  • The problem i ran into with my original packaging solution is that the reporistory application refuses to accept a package without a changes file.. Thats how I startwd down this road. Commented Sep 4, 2014 at 13:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .