You can do that with an OS X Mac using ipfw for your routing, Apache, and AFP/Samba/SSHfs for your file sharing in OS X. However, OS X is a bulky OS and you'll have to stick with Leopard (and not Snow Leopard or Lion) with your G4.
Unfortunately, last I checked not many Linux distros offer a PowerPC option that is kept in parity with their x86 version and is well supported.