On a RHEL 4u4 host run the following wget commands to get the necessary source code.
Untar all the files and run configure , make and make install.
To tackle few of the hiccups that you might encounter, you can install glib on to a location that is different from your root.
For Glib 2.6, compile to some dir under your home dir
Similarly edit the makefile of lua5.1 to change the install location. You can have this installed in the main root too. If so, by default it will go under /usr/local/lib.
After compiling and installing libevent (this can go into the main root), glib and lua set the following environment variables to tell the mysql-proxy configure script where to look for glib and lua.
Also you need to install the mysql_config binary into a location in your path variable.
If you had installed lua on the main root you might have to export the LD_LIBRARY_PATH.
Really got to know the internals of building 32 bit and 64 bit software. Sucked at building this pkg but learnt some stuff. Cool stuff with mysql-proxy coming up.