Installation on Windows NT/2000/XP

Prerequisites

In order to run refdb you'll need a few external apps. The most important thing are the Cygwin tools which provide a Unix-like environment on the otherwise incompatible Windows platform. Additionally you'll have to build or obtain prebuilt versions of a few libraries which are not part of the standard Cygwin distribution (unless you use prebuilt binaries).

External applications

  • MySQL version 3.22 or later. This is the SQL database which provides the database services for refdb. This does not have to physically run on the box(es) where you plan to install refdb, it is sufficient if the MySQL server is accessible through the network.

  • Cygwin toolkit, preferably one of the recent net releases with a DLL version 1.3.10 or later. The Cygwin distribution uses individual packages for the various parts. If you are not sure what to pick, you should install everything, just to be on the safe side. refdb has been ported to (or rather co-developed on) Win32 using this fine collection of GNU tools.

  • If you plan to use the web interface of refdb, you also need a web server. If this happens to be a different Windows box in your network, please keep in mind that you will have to install one of the refdb clients as a CGI application, so this box must run Cygwin as well. If you don't have big bucks to spend: there is a Cygwin port of Apache and a native Win32 version, either of which may suit your needs.

Both the MySQL and the Cygwin websites offer plenty of support as web documents or with mailing lists, so it should be possible to figure out how to do a basic install for these suites.

Libraries

  • The readline library and headers are available at the GNU FTP site. This library builds out of the box. Recent versions of Cygwin come with a prebuilt library anyway.

  • The mysqlclient library and headers. Build instructions for Cygwin are available in the MySQL mailing list archive and in the Cygwin mailing list archive. For the most recent MySQL versions it is apparently sufficient to configure for clients only and then run make and make install.

  • The expat library and headers are available at the expat homepage. This library builds cleanly on recent Cygwin versions (./configure --with-gnu-ld --enable-shared --enable-static).

  • If you need the BibTeX import filter, you'll also want to have the btparse library. This builds out of the tarball on Cygwin.

Installation from the sources

Note: Depending on the permission settings, you may have to run the installation steps proper (as opposed to the build steps) as an administrator.

  1. Unpack the sources in a convenient directory: tar -xzf refdb-x.y.z.tar.gz (the exact filename depends on the version).

  2. If you do not want to build in the source directory, create an empty build directory.

  3. Change into the new refdb-x.y.z source directory or into your separate build directory.

  4. ./configure --help

    This command will display a list of things you can customize. If you build in a separate directory, use the relative path to configure in the source directory. Some important options are:

    Note: All paths and URLs in the following options should be entered without a trailing slash.

    --prefix=PREFIX

    By default, the binaries and the data files will be installed in the /usr/local tree. Use this option to install the stuff somewhere else, e.g. in /usr or in /opt.

    --datadir=DIR

    The data files will be installed in /usr/local/share/refdb unless you use this option. The data will be installed in the directory DIR/refdb. That is, specifying "--datadir=/usr/local/share" is equivalent to the default behaviour. The configuration variable refdblib (which will be automatically generated in the example configuration files) or the environment variable REFDBLIB must point to the refdb data directory.

    --sysconfdir=DIR

    The global configuration files will be installed in /usr/local/etc unless you specify a different directory here.

    --with-mysqlclient-lib=DIR

    Use this option to specify the directory that contains the MySQL client library if it is not in the default library path.

    --with-expat-lib=DIR

    Use this option to specify the directory that contains the expat library if it is not in the default library path.

    --with-btparse-lib=DIR

    Use this option to specify the directory that contains the btparse library if it is not in the default library path.

    --with-sgml-declaration=PATH

    Specify the full path to a suitable SGML declaration for your SGML files. In the case of DocBook documents, use docbook.dcl which is part of the DocBook DTD distribution. This SGML declaration also works for a variety of other DTDs.

    --with-xml-declaration=PATH

    Specify the full path to xml.dcl which is the SGML declaration for XML files. This file is part of the Jade and OpenJade distributions.

    --with-docbook-xsl=PATH

    Specify the full path to the root directory of the DocBook XSL stylesheets.

    --with-tei-xsl=PATH

    Specify the full path to the root directory of the TEI XSL stylesheets.

    --with-classpath-root=PATH

    The refdbxml script assumes that all Java classes for the Java parsers and xslt engines are stored in a class repository, i.e. all in the same directory. Specify this directory with this option. If you keep the relevant Java classes in different directories, either create symlinks or customize refdbxml manually.

    --with-refdb-url=URL

    The HTML files and templates for the web interface require absolute URLs matching your web server setup. Specify the URL of the directory where the HTML files will be installed. This should be something like "http://www.mycomp.com/refdb".

    Note: This URL affects only the links in the HTML files. You will still have to install the HTML files manually into that location.

    --with-var-dir=PATH

    Use this option to specify a directory where refdbd can write its PID file (a file containing the process ID). By default, /var/run will be used.

    --with-log-dir=PATH

    Use this option to specify a directory where refdb programs can write log files to, if logging is directed to a custom file. By default, /var/log will be used.

    Finally, run ./configure with any options that you need. If you build in a separate directory, use the relative path to configure in the source directory.

  5. Run make. This will create the executables and adapt scripts and other files to your local installation.

  6. make install will copy the application server and the clients to /usr/local/bin and the data files to /usr/local/share/refdb unless you chose different directories in the configure step.

  7. To finish the installation, please follow the instructions in the section Finishing the refdb installation below.

Now you have everything in place to use the refdb clients and the application server from the command line. To install the application server as a service, the following additional steps are necessary:

  1. Install the service with the command cygrunsrv -I refdbd -p /usr/local/bin/refdbd -a '-s' -e 'REFDBLIB=/usr/local/share/refdb' (adapt the paths to your local installation if necessary).

  2. Start the service with the command cygrunsrv -S refdbd. To stop the service, use the command cygrunsrv -E refdbd. If you prefer, you can also start and stop the service with NT's own tools: Either use the NT system control panel or use the NT commands net start refdbd and net stop refdbd.

With this setup, the service will be automatically started at system startup. See cygrunsrv --help for additional options.

Installation of prebuilt binaries

If you decide to grab the prebuilt binaries, the installation will be a little bit faster. The binaries are statically linked with libmysqlclient and are accompanied by a copy of libexpat, so you do not have to get or build these libraries yourself.

  1. Unpack the archive in the root directory (/) with the command tar -xzf refdb-cygwin-bin-x.y.z.tar.gz (the exact archive name depends on the version you use). This will extract the files into the /usr/local hierarchy. The binaries and scripts go to /usr/local/bin, the Document Type Definitions, stylesheets, styles and example configuration files go to /usr/local/share/refdb and its subdirectories.

  2. Add the following line to your /etc/profile:

    export REFDBLIB=/usr/local/share/refdb
             
    
  3. Add /usr/local/share/refdb/dtd/catalog and /usr/local/share/refdb/dsssl/catalog to your SGML_CATALOG_FILES environment variable.

  4. Create the configuration files in /etc. Sample configuration files with a .example extension are installed in /usr/local/share/refdb. Provide personalized copies for the user's home directories as needed.

  5. To install refdbd as a service, follow the instructions above.