Bucherrad is an experimental* free and open source ebook compiler that runs on Mac OS X, Windows, and Linux. Bucherrad is driven by text commands, so it’s rather geek-oriented at the moment. The eventual plan is to use it as the back end for a more human-friendly GUI interface (e.g., Abulafia), but it’s usable now if you’re not afraid of command lines. You can read the preliminary docs, download packages for Windows and Mac OS X, or, if you’re a real turbogeek (or want to run it on Linux) pull the source code from Github.
* “Experimental” -> “if it breaks, you get to keep both halves”.