The most popular replacement firmware for relatively common routers, OpenWrt and dd-wrt, do provide support for establishing hotspots. There is quite a lot of documentation on this to be found on their respective Wikis:
http://www.dd-wrt.com/wiki/index.php/Chillispot
http://www.dd-wrt.com/wiki/index.php/Captive_Portal#Provider
A lot of what was once quite hard to do, has been packaged up by EasyHotspot into an all in one hotspot management system.