CAPS Universe documentation
1.0.4
All you need to know to be successful
|
The corresponding:
libcapsbase-1.1.1.tar.gz
(Installation from Archive Resources)libcapsbase.git
(Installation from Repository Resources)All build instructions in the sections above will use default paths which might not be suitable for your system. So the filesystem paths CAPS will use in the filesystem must be defined manually, refer Filesystem Paths for details.
A simple but useful configuration can be:
./configure --sysconfdir=/etc --prefix=/usr
This example configuration leads to the following directory structure:
/ | +--- etc | | | +--- caps (CAPS Configuration Directory) | | | | | +--- drivers (CAPS Printer Driver Configuration Directory) | +--- usr | | | +--- bin (Tools Directory) | | | +--- lib (Library Directory) | | | +--- libexec | | | | | +--- caps (CAPS Printer Driver Executables Directory) | | | | | | +--- include (Header File Directory) | | | +--- sbin (Service Executables Directory) | | | +--- share | | | | | +--- caps | | | | | | | +--- drivers (CAPS Printer Driver Database Directory) | +--- var | | | +--- lib | | | | | +--- caps (CAPS Printer Device Database Directory) | | | | | | | +--- printer_dhfgez (CAPS Printer Device Parameter Directory) | | | +--- spool | | | | | +--- caps (CAPS Document Storage Directory) | | |
After that its time to build and install the package:
make && make install
This install step will install the pkg-config file caps.pc
which contains all these paths and will be used by all other CAPS packages to install their components to the correct and expected filesystem locations.
Debugging support is passive by default. You can enable it with:
--enable-debug
--enable-debug
or --disable-debug
all have a different meaning.Enable debugging compiles-in the support of environment variables to replace the CAPS filesystem paths at run-time for development purposes. It also implies the --disable-hide
(Hiding Internal Symbols) to enable debugging via a debugger.
On some kind of errors libcapsbase will terminate the whole process. This can happen via exit()
or abort()
.
--enable-abort
The abort()
call enables a developer to get a core-dump on demand and --enable-abort
forces the use of abort()
to terminate the process.
By default the National Language Support (aka NLS) is enabled. You can disable it with:
--disable-nls
You can enable profiling with:
--enable-profile
By default all internal symbols are hidden (e.g. not exported). Only the API functions are accessible. This makes debugging hard. So it can be disabled with:
--disable-hide
Hiding is disabled automatically when --enable-debug
(Debugging Support) is given.
Instrument the code to detect programming errors at run-time. This links the libcapsbase
against libasan
(e.g. address sanitizer, aka ASAN).
--enable-asan
Refer https://github.com/google/sanitizers/wiki/AddressSanitizer for details.
You might see an error like this:
==39148==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
One explanation is, the executable you want to run isn't ASAN enabled, but some or all other components (libraries) it uses are.
To make it run again, you can set:
ASAN_OPTIONS=verify_asan_link_order=0
But in this case ASAN might interfere with other libraries and does not work as expected. Take a closer look into the /etc/ld.so.preload
what kind of other libraries (maybe) are loaded first.
A more robust solution is from the website mentioned above: Run the executable with an
LD_PRELOAD=path/to/asan/runtime/lib
to ensure ASAN is the first library in the list.
You can define the compilation goal with the configuration parameter
--with-goal=<value>
The supported values are:
Usually all messages are sent to stderr. If at run-time the presence of journald is detected (via environment variable JOURNAL_STREAM
), the messages are sent directly to journald instead via the systemd
library.
If journald is used via the systemd
library, the CAPS's loglevels are transformed into jounald's loglevels and thus, are kept for filtering later on.
Additionally if the verbosity setting is LIBCAPS_LOUD or higher, the source file and its line number is logged as well.
You can disable this behaviour with:
--without-journald
In this case libcapsbase
isn't linked against libsystemd
You need to define the group a few directories with write permissions should belong to. This is valid for the CAPS Printer Driver Database Directory and CAPS Document Storage Directory. This is the numerical ID of usually the group 'lp'. This ID will also be used by CAPS services like the CAPS printing coordinator to define their run-time group.
This group ID is used by the CAPS Printing System Integration printer driver launcher as well. Select this group ID carefully to ensure it can open the printer device node as a regular user if running with this group ID.
--with-capsgroup=<value>
In my case it is the '7':
$ cat /etc/group | grep lp lp:x:7: lpadmin:x:116:val
This value defaults to '0' and needs (in most use cases) no adaptions. This ID is used for the CAPS Printer Driver Database Directory and CAPS Document Storage Directory directories.
--with-capsroot=<value>
This value defines the user ID for CAPS services like the CAPS printing coordinator to define their run-time user.
This user ID is used by the CAPS Printing System Integration printer driver launcher as well. Select this user ID carefully to ensure it can open the printer device node as a regular user if running with this user ID.
--with-capsuser=<value>
The following filesystem paths are required and are configured within libcapsbase
and thus, used in the whole CAPS universe, because each other CAPS component will link against libcapsbase:
All of these paths have a default value which can be overwritten when configuring the libcapsbase
package.
Refer CAPS Configuration Directory for details about this directory.
The default path of this directory is:
${sysconf}/caps
where ${sysconf}
expands to /usr/local/etc
by default.
${sysconf}
can be defined via --prefix=DIR
or individually via --sysconfdir=DIR
when configuring the libcapsbase
package.
Refer CAPS Printer Driver Configuration Directory for details about this directory.
The default path of this directory is:
${sysconf}/caps/drivers
where ${sysconf}
expands to /usr/local/etc
by default.
${sysconf}
can be defined via --prefix=DIR
or individually via --sysconfdir=DIR
when configuring the libcapsbase
package.
Refer CAPS Printer Driver Database Directory for details about this directory.
The default path of this directory is:
${datarootdir}/caps/drivers
where ${datarootdir}
expands to /usr/local/share
by default.
${datarootdir}
can be defined via --prefix=DIR
or individually via --datarootdir=DIR
when configuring the libcapsbase
package.
Refer CAPS Printer Driver Executables Directory for details about this directory.
The default path of this directory is:
${libexecdir}/caps
where ${libexecdir}
expands to /usr/local/libexec
by default.
${libexecdir}
can be defined via --prefix=DIR
or individually via --libexecdir=DIR
when configuring the libcapsbase
package.
Refer CAPS Printer Device Database Directory for details about this directory.
The default path of this directory is:
${localstatedir}/lib/caps
where ${localstatedir}
expands to /var
by default.
${localstatedir}
can be defined via --prefix=DIR
or individually via --localstatedir=DIR
when configuring the libcapsbase
package.
The default path of this directory is:
${localstatedir}/spool/caps
where ${localstatedir}
expands to /var
by default.
${localstatedir}
can be defined via --prefix=DIR
or individually via --localstatedir=DIR
when configuring the libcapsbase
package.