# dklibs 1.27.0

- Overview
- Download
- Download / Installation
- Installation from source on Windows systems
- Usage
- FAQ
- Change log
- Other projects
- Tutorial
- Developer docu
- stc
- tracecc and trana
- tracecc GUI
- tracecc PDF man.
- API: sort and search
- API: Generic I/O
- Preferences
- File search
- Font configuration
- LaTeX encodings
- Security
- DK libraries for Java

## Installation

- Installation from source on Unix/Linux
- Recommended libraries and software packages
- Download
- Build process and installation
- Building shared libraries on Linux systems
- Building shared libraries on Solaris using Sun Workshop compilers
- Preparing a directory structure for package creation
- Perl XS modules
- Installation on Windows systems
- Executable setup
- Post installation steps
- Installation from source

### Installation from source on Unix/Linux

#### Recommended libraries and software packages

- zlib
  http://www.zlib.net/
  The zlib library is used to read and write compressed files. The dkbif library (which is in turn used by bmeps) uses this library, the fig2vect program too.
- libbz2
  http://sources.redhat.com/bzip2/
  The libbz2 library is used for compression.
- libpng
  http://www.libpng.org/pub/png/libpng.html
  The libpng library is used by the dkbif library (which is in turn used by bmeps) and by the fig2vect program.
- JPEG library
  ftp://ftp.uu.net/graphics/jpeg/
  The JPEG library is used by the dkbif library (which is in turn used by bmeps) and by the fig2vect program.
- NetPBM
  http://sourceforge.net/projects/netpbm
  The NetPBM librariy is used by the dkbif library (which is in turn used by bmeps).
- TIFF library
  http://www.remotesensing.org/libtiff
  The TIFF library is used by the dkbif library (which is in turn used by bmeps).
- OpenSSL
  http://www.openssl.org/
  OpenSSL is used to create messages digests (hashes) of files in kls and to create random numbers in the dkappr module (which is used by createp and rndbytes).
- At least one of:
  - NDBM
    Part of the operating system installation.
  - GDBM
    The Gnu Database Manager is available on Gnu software mirrors, i.e. ftp://ftp.informatik.rwth-aachen.de/pub/gnu/gdbm/
  - Berkeley DB
    http://www.oracle.com/database/berkeley-db/
  NDBM is a database API, some commercial Unix variants (i.e. Solaris) have NDBM support in their C runtime libraries. On these systems I recommend to use the NDBM functions shipped with the system, there is no need to install GDBM. If you insist on installing GDBM make sure the NDBM API functions of GDBM do not hide the "native" NDBM functions.
  On systems without "native" NDBM you should install GDBM.

Make sure to install the include files and other files for development process too! For some Linux distributions the header files for library xyz are in a package having "xyz-devel" or "xyz-developer" in the name.

#### Download

The software is available at the SourceForge project page http://sourceforge.net/projects/dklibs.

#### Build process and installation

After unpacking the source archive change into the dklibs-print "$projectversion"; directory and run

    ./configure
    make
    make install

#### Building shared libraries on Linux systems

Use

    ./configure
    make -f Makefile-shared-linux
    make -f Makefile-shared-linux install

to create and install a shared library version.

Make sure the /usr/local/lib directory is in the search path of ld.so.
In /etc/ld.so.conf.d create a file usr-local.conf:

    /usr/local/lib

Run

    ldconfig

#### Building shared libraries on Solaris using Sun Workshop compilers

Use

    ./configure
    make -f Makefile-shared-solaris-workshop
    make -f Makefile-shared-solaris-workshop install

to build and install the shared library version.

Make sure /usr/local/lib is in the search path for shared libraries, i.e. by setting the LD_LIBRARY_PATH environment variable:

    if [ "X$LD_LIBRARY_PATH" = "X" ]
    then
    LD_LIBRARY_PATH="/usr/local/lib"
    else
    LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}"
    fi
    export LD_LIBRARY_PATH

#### Preparing a directory structure for package creation

To create a directory structure to create a package use the pp (package prefix) feature of the Makefile:

    ./configure --prefix=/opt/dklibs
    make
    make pp=/tmp/packages/dklibs install

The software is compiled to be run from /opt/dklibs, but the installation goes to /tmp/packages/dklibs, you will find /tmp/packages/dklibs/opt/dklibs with bin, lib, include and other subdirectories.

#### Perl XS modules

To use the Perl XS modules you need to install shared library versions of the dklibs library set.
Change into the perlxs subdirectory and run

    for i in DKraus*
    do
      cd $i
      (perl Makefile.PL && make && make install) 2>&1 | tee ../$i.out
      cd ..
    done

### Installation on Windows systems

#### Executable setup

Windows users should download the dklibs-user-*.exe file from the dklibs-win32 package in the downloads are of the SourceForge project page http://sourceforge.net/projects/dklibs/.
The dklibs-user-*.exe file installs binaries and documentation on the local hard disk, the dklibs-base-*.exe file only installs the binaries and creates documentation start menu entries pointing to web resources.

Start the installation process by double-clicking the executable setup file.

Choose a language (either German or English).

In the welcome screen click ``Next''.

Choose a destination directory where to install the software and click ``Next''.

Change the installation type to ``Custom installation''.
If you use Windows XP or above activate the 64-bit file size support.

Activate ``Libraries and header files'' if one of the following two conditions is true:

- You want to use the dklibs libraries Perl XS modules.
- You are a developer and you want to use the dklibs library set to build your own applications.

Activate ``DLL support'' if you want to use the dklibs libraries Perl XS modules.

Click ``Next'' to confirm your settings.

Although you could change the start menu folder name I recommend to use the suggested name.

Click ``Next'' to confirm the installation settings.

A progess bar is shown while the installation is running.

I suggest to read the readme.html file and follow the ``Additional installation steps'' section or the instructions in the ``Post installation steps'' section in this file.

#### Post installation steps

Some directory names or button names on your computer may differ from the names shown here depending on your Windows version and language.

- Reboot as soon as possible.
- Inspect the PATH environment variable, it should contain "C:\Programme\Krause\bin".
- If you plan to use LPD printing correct permissions to a registry key.
  Add permissions to HKLM\Software\DKrause\Shared\Yanolc, the "INTERAKTIV" (interactive user) role needs full access permissions to that key.
- If you plan to use LPD printing set up a printer configuration file %WINDOWS%\yanolc\yanolc.cfg and optionally %WINDOWS%\yanolc\snmpyalc.cfg if you want to use snmpyalc to view printer state.
- If you plan to use fig2vect's SVG output driver customize the fig2vect font configuration.
  - Copy the 35 ghostscript standard fonts (*.pfb and *.afm files) into the %WINDOWS%\fonts directory.
  - Create SVG variants of the 35 ghostscript standard fonts as described in http://fig2vect.sourceforge.net/install.html
  - Edit fig2vect.cfg, fontmap.cfg, combfont.cfg and webfont.cfg in %WINDOWS%\fig2vect.
    - fig2vect.cfg
      In the [svg.gs] section change the value of "gs svg-font directory" to something like "file:///c:/urwfonts/svg" (example for Windows) or "file:///opt/urwfonts/svg" (example for Unix/Linux). Use the directory where the *.svg fonts reside.
      In the [svg.gs-web] section change the value of "gs svg-font directory" to something like "http://www.my-domain.com/fonts/urw/svg" (use your web server and the correct directory).
    - combfont.cfg, webfont.cfg:
      Change the directory to something like "http://www.my-domain.com/fonts/urw/svg".
- If you plan to use the Bmeps GUI or the Tracecc GUI install Java Runtime Environment.
  I suggest to use the one from http://java.sun.com.

#### Installation from source

Building the libraries and the programs using the libraries on Windows systems from source requires manual changes in the makefiles. Good skills in using the development tools and a significant amount of time is needed to do that.
The inst_w32.html file gives more information about building and installing the libraries and programs.