CAPS Universe documentation  1.0.4
All you need to know to be successful
Development of Printer Drivers

Installing

While creating your own printer driver you need to know as a last step where to install your components. The filesystem layout was defined when configuring the libcapsbase. The whole CAPS universe expect their components at these specific and already configured locations.

Thus, you must retrieve these specific file system locations when installing the components of your printer driver.

Where to install your Driver Feature Configuration INI file(s)

Use the following M4 macro in your setup:

# CAPS_DRIVER_CONFIG_DIR
# ----------------------
# Substitutes the variable 'driverconfigdir' with the directory path where printer
# driver components expects their basic configuration settings (INI files)
# (aka Printer Driver's Configuration Directory)
AC_DEFUN([CAPS_DRIVER_CONFIG_DIR], [
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_MSG_CHECKING([Checking for CAPS's 'caps_driver_runtime_config_path' variable])
PKG_CHECK_VAR([driverconfigdir], caps, [caps_driver_runtime_config_path], [], [AC_MSG_ERROR([Failed to retrieve 'caps_driver_runtime_config_path' from the CAPS universe])])
AC_MSG_RESULT([${driverconfigdir}])
])

Then you can use this macro in your configure.ac:

CAPS_DRIVER_CONFIG_DIR
AC_MSG_RESULT([driver config path: ${driverconfigdir}])

In your Makefile.am you then can use it in an easy way:

driverconfig_DATA += <my-printer-special-feature.ini>
Note
You should use a unique INI file name to avoid conflicts with other drivers.
You can use the caps_project.m4 file from the CAPS printing coordinator source tree to get this macro

Where to install your Device Description INI file(s)

Use the following M4 macro in your setup:

# CAPS_DRIVER_DATABASE_DIR
# ------------------------
# Substitutes the variable 'driverdatabasedir' with the directory path where CAPS
# components expects printer driver description files
# (aka CAPS's Printer Driver Database Directoy)
AC_DEFUN([CAPS_DRIVER_DATABASE_DIR], [
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_MSG_CHECKING([Checking for CAPS's 'caps_driverdatabase_path' variable])
PKG_CHECK_VAR([driverdatabasedir], caps, [caps_driverdatabase_path], [], [AC_MSG_ERROR([Failed to retrieve 'caps_driverdatabase_path' from the CAPS universe])])
AC_MSG_RESULT([${driverdatabasedir}])
])

Then you can use this macro in your configure.ac:

CAPS_DRIVER_DATABASE_DIR
AC_MSG_RESULT([driver database path: ${driverdatabasedir}])

In your Makefile.am you then can use it in an easy way:

driverdatabase_DATA += <my-printer-special-feature.ini>
Note
You should use a unique INI file name to avoid conflicts with other drivers.
You can use the caps_project.m4 file from the CAPS printing coordinator source tree to get this macro

Where to install your CAPS Printer Driver Executables Directory file(s)

Use the following M4 macro in your setup:

# CAPS_DRIVER_DIR
# ---------------
# Substitutes the variable 'driverdir' with the directory path where CAPS
# components expect printer driver executable files
# (aka CAPS's Printer Driver Directoy)
AC_DEFUN([CAPS_DRIVER_DIR], [
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_MSG_CHECKING([Checking for CAPS's 'caps_driver_path' variable])
PKG_CHECK_VAR([driverdir], caps, [caps_driver_path], [], [AC_MSG_ERROR([Failed to retrieve 'caps_driver_path' from the CAPS universe])])
AC_MSG_RESULT([${caps_driver_path}])
])

Then you can use this macro in your configure.ac:

CAPS_DRIVER_DIR
AC_MSG_RESULT([driver exec path: ${driverdir}])

In your Makefile.am you then can use it in an easy way:

driver_PROGRAMS = <my-printer-driver-executable>
Note
You should use a unique INI file name to avoid conflicts with other drivers.
You can use the caps_project.m4 file from the CAPS printing coordinator source tree to get this macro