Add (most of) libraries used by the template code

We don't need these libraries to build the package, but they should
be installed on the user's machine so the library can use them.

The packages that aren't available on RHEL5 is dropped.