Desc: Configure options
File: configure.txt
Date: 14 March 2004
Auth: Russell Kroll <rkroll@exploits.org>

There are a few options that can be given to configure to tweak compiles:

 --prefix=PATH

   This is a fairly standard option with GNU autoconf, and it sets the
   base path for most of the other install directories.  The default
   is /usr/local/ups, which puts everything but the state sockets in one
   easy place.

   If you like having things to be at more of a "system" level, setting
   the prefix to /usr/local or even /usr might be better.

 --with-statepath=PATH

   Change the default location of the state sockets created by the
   drivers.

   The NUT_STATEPATH environment variable overrides this at run time.

   Default is /var/state/ups.

 --with-port=PORT

   Change the TCP port used by the network code.  Default is 3493.

   Ancient versions of upsd used port 3305.  NUT 2.0 and up use a
   substantially different network protocol and are not able to  
   communicate with anything older than the 1.4 series.

   If you have to monitor a mixed environment, use the last 1.4 version,
   as it contains compatibility code for both the old "REQ" and the new
   "GET" versions of the protocol.

 --with-user=<username>

   Programs started as root will setuid() to this user for somewhat 
   safer operation.  You can override this with -u <user> in several
   programs, including upsdrvctl (and all drivers by extension), upsd,
   and upsmon.  

   The "user" directive in ups.conf overrides this at run time for
   the drivers.

   The default value is "nobody".  This was done since it's slightly
   better than staying around as root.  Running things as nobody is not
   a good idea, since it's a hack for NFS access.  You should create at 
   least one separate user for this software.

   See the INSTALL document and the FAQ for more on this topic.

   Note: upsmon does not totally drop root because it may need to
   initiate a shutdown.  There is always at least a stub process
   remaining with root powers.  The network code runs in another
   (separate) process as the new user.

 --with-logfacility=FACILITY

   Change the facility used when writing to the log file.  Read the man
   page for openlog to get some idea of what's available on your system.
   Default is LOG_DAEMON.

 --sysconfdir=PATH

   Changes the configuration path for the suite.  By default this path
   is $(prefix)/etc.  Setting this to /etc or /etc/ups might be useful.

   The NUT_CONFPATH environment variable overrides this at run time.

 --datadir=PATH

   Change the data directory.  By default this is $(prefix)/share, or
   /usr/local/ups/share.  At the moment, this directory only holds two
   files - the optional cmdvartab and driver.list.

 --mandir=PATH

   Sets the base directories for the man pages.  The default is
   $(prefix)/man, i.e. /usr/local/ups/man.

 --includedir=PATH

   Sets the path for include files.  Right now this is just upsclient.h.
   The default is $(prefix)/include.

 --libdir=PATH

   Sets the path for libraries.  This is just upsclient.o for now.
   The default is $(prefix)/lib.

 --with-pidpath=PATH

   Changes the directory where pid files are stored.  By default this is
   /var/run.  Certain programs like upsmon will leave files here.

 --with-altpidpath=PATH

   Programs that normally don't have root powers like the drivers and
   upsd write their pid files here.  By default this is whatever
   the statepath is, as those programs should be able to write there.

 --with-linux-hiddev=FILE

   Sets the location of the hiddev.h for USB UPS support on Linux. 
   This defaults to /usr/include/linux/hiddev.h, and is only used when
   building the experimental "hidups" driver.  If your kernel header
   files live somewhere else, you will need to use this.

 --with-drvpath=PATH

   The UPS drivers will be installed to this path.  By default they 
   install to "bin" under the prefix, giving a default path of
   /usr/local/ups/bin.

   The "driverpath" global directive in the ups.conf file overrides this
   at run time.

 --with-gd-includes="-I/foo/bar"

   If you installed gd in some place where your C preprocessor can't
   find the header files, use this switch to add additional -I flags.

 --with-gd-libs="-L/foo/bar -labcd -lxyz"

   If your copy of gd isn't linking properly, use this to give the
   proper -L and -l flags to make it work.  See LIBS= in gd's Makefile.

   Note: the --with-gd switches are not necessary if you have gd 2.0.8
   or higher installed properly.  The gdlib-config script will be 
   detected and used by default in that situation.

 --with-cgi

   This switch tells configure to look for the libraries and headers
   that are used in the CGI programs.  This is not enabled by default,
   as they are only useful on web servers.  You need to use this before
   'make cgi' will work.

 --with-cgipath=PATH

   The CGI programs will be installed to this path.  By default, they
   install to "cgi-bin" under the prefix, which is usually /usr/local/ups.

   If you set the prefix to something like /usr, you should set the 
   cgipath to something else as /usr/cgi-bin is pretty ugly and 
   non-standard.

   The CGI programs are not built or installed by default.  Use "make cgi"
   to build them and "make install-cgi" to install them.

 --with-drivers=<driver>,<driver>,...

   As of the time of this writing, there are 25 UPS drivers available.
   Most users will only need one, a few will need two or three, and
   very few people will need all of them.

   To save time during the compile and disk space later on, you can
   use this option to just build and install a subset of the drivers.
   To select apcsmart and hidups, you'd do this:

	--with-drivers=apcsmart,hidups

   If you need to build more drivers later on, you will need to rerun
   configure with a different list.  To make it build all of the drivers
   again, run 'make distclean' before starting.
