views:

108

answers:

1

I'm looking for a way to generate .deb and .rpm packages from my build scripts, containing the resulting products. Since everything is written in Python, I'm wondering if anyone knows of an abstraction layer that would allow me to drive both RPM and Deb construction from the same code?

+2  A: 

Distutils in python's standard library has a bdist_rpm command to build rpms and the third-paty stdeb module adds a command for producing debs.

Ned Deily
+1 -- clearly the right way to do it!
Alex Martelli
Hey Ned: would you use distutils to package a load of code that was not Python specific though? IE, c++ libraries and applications for example?
jkp
No, distutils is for packaging Python modules and extension modules. It is intimately tied up with the particular Python installation it is included with. Unless you can package other stuff with a python wrapper around it somehow, distutils would not be the way to go.
Ned Deily
@Ned: yeah, I thought as much...perhaps my question should have been clearer. This is to serve as a general purpose part of my build system to help package all products.
jkp