juanfresia / fortune-forge

Forge your own luck. Or at least build your own fortunes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fortune-forge

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!

Where do I begin?

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 and fortune-mod as a dependency (but make install wont install those for you).

Adding fortunes

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.

Generating the .deb

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.

Changing the package data

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.

About

Forge your own luck. Or at least build your own fortunes.


Languages

Language:Makefile 50.1%Language:Shell 31.7%Language:Dockerfile 18.2%