Dotdeb has done a terrific job at precompiling some PHP 5 packages and environment for us.
Unfortunately in Dotdeb version of Debian Squeeze PHP5 packages I found the package php5-fileinfo to be missing.
So here are the blind steps (without explanations) on how to compile and install this package.
This is just an example unig the fileinfo package, the same can be done for other packages as well.

Note: Here we area assuming that the platform is an amd64

Install the required packages
apt-get install dh-make-php php5-dev build-essential libmagic-dev

Set some environment variables
export DEBFULLNAME="Guillaume Plessis"
export DEBEMAIL="gui@php.net"

Download the PECL fileinfo module sources
pecl download fileinfo

Create debian source package: php-fileinfo-1.0.x
dh-make-pecl --only 5 Fileinfo-1.0.4.tgz

Build the debian package
cd php-fileinfo-1.0.4/
./debian/rules binary

Install the package
dpkg -i ../php5-fileinfo_1.0.4-1_amd64.deb

Take a look at the result of the installation
ls /usr/lib/php5/20090626/fileinfo.so
ls /etc/php5/conf.d/fileinfo.ini

Both above files should be present

Note: if you have installed the ‘cli’ and ‘cgi’ versions of PHP5 as well, then the following files should also be present:
ls /etc/php5/cgi/conf.d/fileinfo.ini
ls /etc/php5/cli/conf.d/fileinfo.ini