How to create an RPM package to install on Rocks compute nodes

Install the all the files (or the program) in a directory and create a package:

$ rocks create package /opt/psycopg2-2.6 psycopg2

This creates an RPM file in the directory, which you can then add to the compute nodes as explained here.