views:

33

answers:

1

Hi,

I'm a newbie and I'm trying to write a python script to build rpm packages as part of an automated build system (Hudson).

I'm looking at the rpm-python API but I can't seem to see anything that relates to rpmbuild.

Am I missing something or is there no way to build an rpm package through the rpm api's? I was hoping I wouldn't have to call rpmbuild from the shell because the build process involves different platforms such as Solaris, and I wanted the script to be portable.

Thanks.

A: 

Debian includes python bindings for rpm allowing you to use rpm from python scripts

http://packages.debian.org/stable/python/python-rpm

Also checkout : API Documentation

RPM Python bindings - presentation and tutorial

pyfunc
I've looked at the above documentation but it seems that the python-rpm bindings provides methods to query the database and install/upgrade rpms, but doesn't actually build rpms.Does this mean I have to call rpmbuild from my script directly?eg. subprocess.Popen('rpmbuild -ba rpm.spec', shell=True)
Jeff
Yes, for building rpms, rpmbuild is the only avenue.
pyfunc