CAPS Universe documentation  1.0.4
All you need to know to be successful
libcapsbase Development

Filesystem Paths Setup

The Filesystem Paths are statically compiled into the libcapsbase. Their definition happens when configuring libcapsbase.

If Setting up Debugging Support is enabled at configure time it's possible to replace the paths used by libcapsbase via environment variables. This feature is for development and debugging purposes and disabled in the production variant when debugging is disabled.

CAPS Driver Database Directory

If debugging is enabled, CAPS also accepts the environment variable CAPS_PRINTER_DRIVER_DB_DIR to define the directory.

Refer CAPS Printer Driver Database Directory for details about this directory.

CAPS Driver Configuration Directory

If debugging is enabled, CAPS also accepts the environment variable CAPS_DRIVER_CONFIGURATION_DIR to define the directory.

Refer CAPS Printer Driver Configuration Directory for details about this directory.

CAPS Driver Executables Directory

If debugging is enabled, CAPS also accepts the environment variable CAPS_DRIVER_DIR to define the directory.

Refer CAPS Printer Driver Executables Directory for details about this directory.

CAPS Device Database Directory

If debugging is enabled, CAPS also accepts the environment variable CAPS_PRINTER_DEVICE_DB_DIR to define the directory.

Refer CAPS Printer Device Database Directory for details about this directory.

Checking if the paths can be changed via environment variables

A quick check if it works as expected can be done with the tool capsinfo:

root@CAPS:~ capsinfo
The 'configuration directory' is: '/etc/caps'
The 'driver database directory' is: '/usr/share/caps/drivers'
The 'driver configuration directory' is: '/etc/caps/drivers'
The 'driver executables directory' is: '/usr/libexec/caps'
The 'device database directory' is: '/var/lib/caps'
The 'document spool directory' is: '/var/spool/caps'

With a environment variable set (here the CAPS Printer Driver Executables Directory), the output should change:

root@CAPS:~ CAPS_DRIVER_DIR=/it/works/as/expected capsinfo
The 'configuration directory' is: '/etc/caps'
The 'driver database directory' is: '/usr/share/caps/drivers'
The 'driver configuration directory' is: '/etc/caps/drivers'
The 'driver executables directory' is: '/it/works/as/expected'
The 'device database directory' is: '/var/lib/caps'
The 'document spool directory' is: '/var/spool/caps'

Update the PO files

$ make -C po update-po

Create the Documentation

$ doxygen doc/libcapsbase.doxygen

Run-time information about CAPS

Take a look into the caps.pc file:

# required but I don't know why, yet.
prefix = /

# generic CAPS config
caps_config_path=${prefix}/etc/caps
# Driver Configuration Directory
caps_driver_runtime_config_path=/etc/caps/drivers

# Device Database Directory
caps_device_database_path=/var/lib/caps
# Device Parameter Directory
caps_device_param_path=/var/lib/caps

# Driver Database Directory (VID/PID to driver relation)
caps_driverdatabase_path=/usr/share/caps/drivers

# Driver Executables Directory
caps_driver_path=/usr/libexec/caps

# Document storage
caps_document_storage_path=/var/spool/caps

# CAPS user ID with the most permissions
caps_user_id_root=0

# CAPS user ID with restricted permissions (regular user)
caps_user_id_caps=150

# CAPS group ID for a regular user
caps_group_id_caps=150

Name: CAPS
Description: CAPS printing universe
Version: 1.0.0
URL: http://www.caps-printing.org

Or ask pkgconfig for the details:

$ pkg-config --variable=caps_config_path caps
/etc/caps

You should never guess these paths, always use pkgconfig for it. And you do not need it by your own in your configure.ac. You can use already existing M4 macros instead.