With tar.gz packages, go:
tar -zxvf package.tar.gz
cd package
./configure
make
make install
alternatively:
tar -zxvf package.tar.gz
cd package
./configure && make && make install
I never use rpm's..so I'm not exaclty sure. I do know, however, that its different for different distro's, and a quick search will find it faster than it takes me to type this:
http://google.com/linux