http://www.smoothwall.org/

It should turn your pc into a router, although you can't use it for anything else then.
Its quite easy to set up and runs linux, it has a browser based setup so its easy to maintain from a different pc.
+ It might be possible to add other stuff to this pc as its running linux so you might be able to turn it onto a webserver and do some other things with it as well.

note: if your pc has some issues then the internet in your flat will be down... I think its better to get a 100 dollar router like an asus n-16 and put tomato firmware on it.