A package would be the best way, and can be successfully done with devices that have sufficient resources that are running current releases. Unfortunately, the WRT54GL does not have sufficient resources for even basic use.
Depending on your use cases, a Pi-like SBC or something like a GL.iNet AR300M-Lite (under US$20) may be a suitable choice at a low or moderate price.
Edit: Whatever hardware you end up with, I'd suggest that any persistence be put on a USB stick or similar and not internal flash. The flash memory used for most routers has a lifespan measured in the thousands of cycles, which even a lightly loaded MQTT server could burn through in months.