I recently learned that python setup.py can be used to build a rpm using the bdist command. Since we’re using puppet to manage installed software, this makes it really easy to add python modules to a bunch of servers.
During the process of trying to build a rpm, I ran into a problem: “Installed (but unpackaged) file(s) found.” The details of this problem are explained here: https://bugzilla.redhat.com/show_bug.cgi?id=198877
Comment #1 in the above bug offers a work-around, which I simplified into the following two commands:
echo 'python setup.py install --optimize 1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES' > install.spec
python setup.py bdist_rpm --install-script install.spec --packager="Joe Crobak"
RPMs are placed in the dist dir.