Next: Using GNU Arch, Previous: Network protocol, Up: Hacker's guide [Contents][Index]

### 3.15 Technical HOWTOs

#### 3.15.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` and `./doxygen-update.sh`.
- edit `NEWS` file, in both `liquidwar6` and `liquidwar6-extra-maps`. Check `ChangeLog` is OK.
- update the version history in `doc/liquidwar6.texi`.
- update `debian/changelog` files in both main and extra maps packages.
- 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 `.dmg` 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 --recursive --verbose --progress ./X.Y.Z/ login@dl.sv.nongnu.org:/releases/liquidwar6/X.Y.Z/`. 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.
- copy Doxygen HTML documentation files from `./doc/doxygen/html` 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.
- after everything did work, upload files on ftp://ftp.gnu.org/, for instance use `gnupload --to ftp.gnu.org:liquidwar6 liquidwar6-X.Y.Z.tar.gz`.

#### 3.15.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.

Some options need more work, for instance:

- Any option which is a command-line argument needs to be added to `src/lib/lw6-options.c`.
- Any option which is related to the build system (to enable or disable some feature) must be referenced in `src/lib/sys-build.c` and also `src/lw6-funcssys.c` to be callable from scripts.
- Any option which changes the map rules (any new rule...) impacts the game checksums so these ones need to be updated in `src/lib/map/map-test.c`, `src/lib/ker/ker-test.c`, `src/lib/pil/pil-test.c` and `src/lib/pil/pil-suite.c`.

#### 3.15.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 `xyz/xyz.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 `libxyz`, add a reference to `../xyz/libxyz.la` inf the `_LDADD` section.
- create a new `src/lib/lw6-funcsxyz.c` file which declares Guile bindings for this lib, if needed
- edit `doc/gdoc-update.sh` and add the entry for `xyz`.
- edit `doc/Makefile.am` and add `xyz-gdoc.texi` in `gdoc_TEXINFOS`.
- edit `doc/doxygen-update.sh` and add the entry for `xyz`.
- edit `doc/Makefile.am` and add `xyz-doxygen.texi` in `doxygen_TEXINFOS`.
- in `./doc`, run `./gdoc-update.sh` and `./doxygen-update.sh`.
- edit `doc/doxygen/Makefile.am` and add the dependency on `src/lib/xyz/xyz.h`.
- 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.15.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`.
- edit `doc/doxygen-update.sh` and add an entry for `mod-ab`
- edit `doc/Makefile.am` and add `mod-ab-doxygen.texi` in `doxygen_TEXINFOS`.
- type `touch doc/mod-ab-gdoc.texi doc/mod-ab-doxygen.texi` else dependencies checking will fail.
- in `./doc`, run `./gdoc-update.sh` and `./doxygen-update.sh`.
- edit `doc/liquidwar6.texi` 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`.

Next: Using GNU Arch, Previous: Network protocol, Up: Hacker's guide [Contents][Index]