Installing ddccontrol-db
========================

ddccontrol-db is a data-only package. It does not compile programs or
libraries. Its small handwritten configure script only selects installation
directories and checks commands needed by the subsequent make targets.
The Makefile uses portable make syntax and is tested with both GNU Make and
BSD make (`bmake`).

On a system where BSD make is installed as `bmake`, use:

    MAKE=bmake ./configure --prefix=/usr
    bmake
    bmake install

Installing a release archive
----------------------------

Release archives contain a generated db/options.xml and compiled gettext
catalogs. A standard Unix-like system only needs make and the usual install,
mkdir, awk, sed, and shell utilities:

    ./configure --prefix=/usr
    make
    sudo make install

The default prefix is /usr/local.

Building from a Git checkout
----------------------------

A Git checkout additionally needs GNU gettext because make compiles po/*.po
to po/*.gmo with msgfmt:

    ./configure --prefix=/usr
    make
    sudo make install

Compatibility with package build recipes
----------------------------------------

The retained autogen.sh is a compatibility stub. Existing recipes that run
autogen.sh before configure can keep doing so; it prints a migration notice
and succeeds without invoking Autoconf, Automake, Intltool, or Libtool.

The configure script accepts the standard directory, build/host, program-name,
dependency-tracking, and silent-rule options commonly supplied by Debian and
RPM package helpers. Options irrelevant to this data-only package are accepted
but have no effect. To build without translation catalogs, use:

    ./configure --prefix=/usr --disable-nls

Recipes that invoke autoreconf or eautoreconf directly are temporarily covered
by a minimal configure.ac compatibility shim. The generated configure forwards
all arguments to the handwritten configure implementation. Packagers should
still remove the regeneration step: configure and Makefile are maintained
source files, and Autoconf is not a normal build dependency.

Installation variables
----------------------

The Makefile supports these variables:

    PREFIX      installation prefix; defaults to /usr/local
    DATADIR     data root; defaults to $(PREFIX)/share
    DBDIR       database directory; defaults to $(DATADIR)/ddccontrol-db
    LOCALEDIR   locale root; defaults to $(DATADIR)/locale
    DESTDIR     staging root used by package builders
    LINGUAS     space-separated translations to build and install

The traditional lowercase `prefix`, `datadir`, `localedir`, and `dbdir`
spellings are accepted as aliases for existing package recipes. Unknown names
in `LINGUAS` are ignored, matching the previous gettext build behavior.

For example, a distribution package can stage files without root privileges:

    ./configure --prefix=/usr
    make install DESTDIR="$pkgdir"

To install only selected translations:

    make install PREFIX=/usr LINGUAS="fr pl"

Validation and maintenance
--------------------------

Run the basic version and translation checks with:

    make check

Validate every monitor profile with an installed ddccontrol command:

    make check-db

Translation maintainers can regenerate the gettext template and merge it into
the PO files. This target requires gettext and Perl:

    make update-po

Create gzip, bzip2, and xz release archives with compiled translations. This
maintainer target additionally requires Git and tar with gzip, bzip2, and xz
support:

    make dist

Remove generated files with `make clean`, or generated files and release
archives with `make distclean`.
