# libdir

## Name

libdir - locate ROX library directories

## Synopsis

`libdir [--version x.y.z] [--appdir|--libdir] [--path path] [--append-path path] [--prepend-path path] [--0install site] library-name`

## Description

The libdir program is used to locate ROX Desktop application directories. It searches a default path, modified by the options, and prints the full path of the first match it finds. Typically it is used to locate a library stored as an application directory by programs which wish to link against it.

The library-name is the name of the library, specifically it is the name of the application directory the library resides in.

## Options

The following options are supported

`--version x.y.z`

  Requests that the version of the library be at least x.y.z. The version is extracted from the AppInfo.xml file. If this is not present or does not contain a Version element then the directory is not selected.

`--appdir`

  Sets the search path to $APPDIRPATH (`$HOME/Apps:/usr/local/apps:/usr/apps`) .

`--libdir`

  Sets the search path to $LIBDIRPATH (`$HOME/lib:/usr/local/lib:/usr/lib`) . This is the default.

`--path path`

  Sets the search path to path.

`--append-path path`

  Appends path (which may be a single directory or colon separated list of directories) to the search path.

`--prepend-path path`

  Prepends path (which may be a single directory or colon separated list of directories) to the search path.

`--0install site`

  Appends `/uri/0install/site/dir to the search path. dir is `lib` if the program is called as libdir, `apps` otherwise.`

## Environment Variables

`APPDIRPATH`

  Default search path for `--appdir` mode. This defaults to `$HOME/Apps:/usr/local/apps:/usr/apps`.

`LIBDIRPATH`

  Default search path for `--libdir` mode. This defaults to `$HOME/lib:/usr/local/lib:/usr/lib`.

## Exit Status

- 0 Success
- 1 No app dir found
- 2 App dir was found but version was to old or could not be determined

## Author

Stephen Watson

## Bugs

Determining the version number is done with sed and expr. It would be better to use xsltproc.

Last modified: Wed Jul 7 21:21:20 BST 2004