Next: Using GNU Arch, Previous: Network protocol, Up: Hacker's guide

### 3.14 Technical HOWTOs

#### 3.14.1 Release check-list

Summary off all operations required for a release:

- check the value of `LW6MAP_RULES_DEFAULT_EXP` and default for `--skip-network`, which might have been changed will developping.
- in `./src`, run `./indent.sh`.
- in `./doc`, run `./gdoc-update.sh`.
- edit `NEWS` file, in both `liquidwar6` and `liquidwar6-extra-maps`. Check `ChangeLog` is OK.
- update the version history in `doc/liquidwar6.texi`.
- run `make distcheck`... (at least!)
- build `RPM` package (`make -C pkg rpm`), check `yum install` produces a working installation, also check the `rpm -e` command to verify uninstalling is OK too.
- build `.exe` main binary on Microsoft Windows then go back to GNU/Linux and build `.exe` installer (`make -C pkg installer`), go back to Microsoft Windows and test the installer (there are often problems at this stage because of missing libraries or other files...).
- build `.dmd` Mac OS X disk image, check it works even when `/opt` and `/usr/local` or (re)moved, this is important, else execution might rely on binaries which are only on the development machine and do not ship with game.
- upload files (doc on http://savannah.gnu.org/maintenance/DownloadArea), with a command like `rsync --rsh=ssh ./version/ login@dl.sv.nongnu.org:/releases/liquidwar6/version/`. Each file must have its `.sig` corresponding file.
- update online docs with `gendocs.sh`, carefull, `liquidwar6.html` is suppressed by this, need to re-create it from previous version and/or `index.html` which is the same.
- update `index.html`, `liquidwar6.html` and `liquidwar6.fr.html` so that they reflect the latest release. Check download links are OK.
- run `./configure --enable-gcov ; make clean ; make`. Then run `src/liquidwar6 --test`, stay here and get ready to respond interactively to various questions. Then cd to `./doc/coverage` and run `make opt`. Copy files to web CVS, sync them.
- cd to `./doc/global` and run `make opt`. Copy files to web CVS, sync them.
- cd to `./doc/cyclo` and run `make opt`. Copy files to web CVS, sync them.
- post news on https://savannah.gnu.org/news/?group=liquidwar6, http://lists.gnu.org/mailman/listinfo/help-liquidwar6 and http://lists.gnu.org/mailman/listinfo/info-liquidwar6.

#### 3.14.2 Add a new option

This describes how to add a new option to the game.

- edit `src/lib/def/def-list.txt`
- in `src/lib/def/def-update.py` run `./def-update.py`. This will automatically fill `src/lib/def/def.h` and `script/def.scm`. In the code, you should always use `LW6DEF_<OPTION>` in C and `lw6def-<option>` in scheme to refer to the option. This does help avoiding typesetting errors.
- add the entry to `src/lib/hlp/hlp-list.c`, choose a category for it
- add the entry to `src/lib/hlp/hlp-reference.c`, give it a type, documentation string and default values if needed
- to sort `src/lib/def/def-list.txt` a common practice is to fill it with the output of `liquidwar6 --list` once the program has been compiled and is aware of the new option.

Unless this is done, program won't accept the option.

#### 3.14.3 Add a new internal library

This describes how to add a new `libxyz` internal library:

- create a new `src/lib/xyz` directory. The convention is to use 3 letters names and prefix every global identifier with `lw6xyz`.
- copy `Makefile.am`, `xyz.h`, `xyz-test.c` and `xyz-testmain.c` from an existing internal library (`libnod` is a good source, it does not have complex dependencies).
- edit `Makefile.am` to fill requirements, make necessary adjustments to other files (many string replaces to make, both lowercase and uppercase).
- add the entry in the `SUBDIRS` and `LW6_LIBS` sections of `src/lib/Makefile.am`
- add the entry in the `AC_CONFIG_FILES` of `./configure.ac`.
- run `automake` and `autoconf`.
- edit `src/lib/lw6-options.c` and add a call to `lw6xyz_test()` for both “check” and “test” cases.
- edit `src/lib/lw6-test.c` and add a reference to the `lw6xzy_test()` function.
- in every internal `abc` library that depends on `xyz`, edit the `lw6abc_test` function so that it contains a reference to `lw6xzy_test`.
- in every internal `abc` library that depends on `abc/abc.h`, edit the `abc/abc.h` header so that it includes `xzy/xyz.h`. Also edit `src/lib/liquidwar6.h.in`.
- in every internal `abc` library that depends on `abc/abc.h`, add a reference to `../xyz/libxyz.la` inf the `_LDADD` section.
- edit `doc/gdoc-update.sh` and add the entry for `xyz`.
- edit `doc/Makefile.am` and add `xyz-gdoc.texi` in `gdoc_TEXINFOS`.
- in `./doc`, run `./gdoc-update.sh`.
- edit `doc/liquidwar6.texi` to and a new node/section for this internal library.
- edit `doc/deps.dot` to update dependencies.
- run `./configure && make`, fix code if needed.

#### 3.14.4 Add a new module

This describes how to add a new `mod-ab` module, for instance a new bot, but gfx, snd, cli or srv backends should work pretty much the same:

- add a new entry in `src/lib/bot/Makefile.am`
- create the subdir `src/lib/bot/mod-ab`, with its `Makefile.am` (inspired from other existing modules)
- add the entry in `configure.ac` so that `src/lib/bot/mod-ab/Makefile` is generated.
- edit `doc/gdoc-update.sh` and add an entry for `mod-ab`
- edit `doc/Makefile.am` and add `mod-ab-gdoc.texi` in `gdoc_TEXINFOS`.
- in `./doc`, run `./gdoc-update.sh`.
- edit `doc/liquidwar6texi` to add a new node/section for this module.
- edit `doc/deps.dot` to update dependencies.
- edit `src/lib/bot/bot-test.c`, change the value of `TEST_NB_BACKENDS` and modify the code so that the new `ab` module is tested too.
- edit `src/lib/bot/bot-register.c`, the code must updated pretty much in every place with the conditionnal `LW6_ALLINONE`, you need to add the new module.
- run `automake`, `autoconf`, `./configure` and `make`.