I've been working a lot with MongoDB lately, including some tinkering to add domain socket support. Unfortunately those modifications mean that I can't just use a binary download when I need to install it on a new machine, I have to build from source instead. There's general instructions on building for Fedora 8, but I found that yum had either versions that were too old for some packages like scons, or as with PCRE it ended up complaining about other programs requiring older versions than Mongo asked for.
As a result, I ended up creating a shell script to handle all the building steps required. This is pretty specific to my own environment and very hackish, but if you're running into the same sort of issues trying to use RPMs for all the dependencies, hopefully this will give you some hints on building from source.
# Builds MongoDB and its needed dependencies for Fedora 8
# By Pete Warden
# First, make sure we have git
yum install git
# Now grab the Mongo source from github
git clone git://github.com/mongodb/mongo.git
# Get an up-to-date version of Scons, yum installs a 0.97 version that doesn't work!
curl -L "http://downloads.sourceforge.net/project/scons/scons/1.2.0.d20090919/scons-1.2.0.d20090919.tar.gz?use_mirror=cdnetworks-us-1" > scons-1.2.0.tar.gz
tar -xf scons-1.2.0.tar.gz
# Scons relies on Python, so make sure that's present
yum install -y python-devel
python setup.py install
# Now grab boost sources - I do see some warnings in Mongo's config about this being out of date
yum install -y boost
yum install -y boost-devel
curl -O ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz
tar zxvf js-1.7.0.tar.gz
make -f Makefile.ref
JS_DIST=/usr gmake -f Makefile.ref export
# You need an up-to-date version of PCRE, more recent than the one installed by yum
curl -O "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.00.zip"
# On my AMIs there's old versions of PCRE libraries left lying around, so move them
mv /usr/lib64/libpcrecpp.so.0 /usr/lib64/libpcrecpp.so.0.original
ln -s /usr/lib/libpcrecpp.so.0 /usr/lib64/libpcrecpp.so.0
# Create the database location and run Mongo
./mongod --dbpath=/mnt/data/db --bind_ip=/tmp/mongo.sock --port=0 &
# Now build the PHP drivers and add them to the php.ini
git clone git://github.com/mongodb/mongo-php-driver.git
echo "" >> /etc/php.ini
echo "extension=mongo.so" >> /etc/php.ini