Compile keepass 0.4.3 on Debian Linux wheezy

I have switched from Ubuntu to Debian, and am happy i did so. There are enough blogs talking about their pros and i only ask why i did it not before.
Well, when you wish to compile keepassx on Debian you may find one or two obstacles, i hope this post targets them and saves you some time.
Get It:

wget http://www.keepassx.org/releases/keepassx-0.4.3.tar.gz
tar zxvf keepassx-0.4.3.tar.gz
cd keepassx-0.4.3/
mkdir build

I recommend you to read the INSTALL file

apt-get install libqt4-dev
apt-get install libx11-dev
apt-get install libx11-dev

And finally you have to install this one:

apt-get install libxtst-dev

Yes, it do not leaves you given dependencies, i fixed it this way:

wget http://ftp.de.debian.org/debian/pool/main/x/x11proto-record/x11proto-record-dev_1.14.2-1_all.deb
dpkg -i x11proto-record-dev_1.14.2-1_all.deb

And now you go!

apt-get instal libxtst-dev
qmake
make

And again, second challenge, you may find this message trying to compile:

lib/random.cpp: In function [void initStdRand()]:
lib/random.cpp:98:19: error: [getpid] was not declared in this scope

I did this:

vi ./src/lib/random.cpp

Basically you just modify the file, before it looks like:

#include "random.h"
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
#include

And it should look like:

#include "random.h"
#include <unistd.h>
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
#include