fortune-forge is a tool that helps you make your own cookies for unix fortune package. It compiles your tasty quotes and packages them in a handy .deb for you to install and distribute everywhere!
First of all, you will need a couple of things:
- docker: this tools uses a docker container to bake the cookies, so you will need a machine with a working docker installation.
- make: the commands you will use are wrapped around in a
Makefile
. - fortune: it is not a requirement to build the fortunes, but it is
needed to install them. The .deb package will be built with
fortune
andfortune-mod
as a dependency (butmake install
wont install those for you).
The raw quotes and fortunes go into the quotes
directory. Every file in that
directory will be compiled as a separate fortune cookie database file,
accessible via the fortuen <db>
command.
Each of the files may contain any number of fortune strings, separated by lines containing only one % character.
This is an example of a cookie file (named example
):
%
This is the first cookie.
%
This is the second cookie.
And is also a multi-line cookie.
%
After the build you can access the fortunes in there simply by calling fortune example
.
To package your cookies into a .deb
simply run make deb
. It will spin a
docker container, bake your cookies and leave them under bin
directory.
The name of the generated .deb file can be changed without altering the package
name. The package metadata (maintainer, description and name) can be found under
build/DEBIAN/control
file, and can be changed before building the .deb to
change the package metadata.