Compiling DRAC

DRAC is now incorporated into Debian Linux. You don't need to compile it from source for this version of Linux. See the following for more information:

It should only be necessary to edit the Makefile before compiling DRAC. After making the necessary changes, just run 'make' to compile the DRAC daemon, the client library, and a test DRAC client.

You must compile DRAC with the same version of the Berkeley db package that was used to compile your copy of sendmail. This may not be the default version that is currently installed on your system. One way to determine this is:

	$ strings /usr/lib/sendmail | grep -i sleepy
The descriptions below assume that you have compiled but not installed the db package. If you have installed the db include files and db library in a standard location, you don't need to specify paths to them. If you have more than one version of the db package on your system, you must specify the paths to ensure that DRAC is linked with the same one as sendmail. If your compiler is not called 'cc', change that in the Makefile as well.

The '-C' option of rpcgen is now supported. This option tells rpcgen to generate output files containing ANSI C declarations. Use this if your C compiler complains about function arguments not matching prototypes. Two Makefile changes are required...

DEFS = ... -DDASH_C
RPCGENFLAGS = -C

By default, DRAC produces a DB file format that is compatible with sendmail. To adapt it to postfix, make the following addition to Makefile...

DEFS = ... -DTERM_KD
To adapt it to exim, add this to Makefile...
DEFS = ... -DTERM_KD -DREQ_HASH -DCIDR_KEY

For Solaris 2.x, the following settings work...

INSTALL = /usr/ucb/install
EBIN = /usr/local/sbin
MAN = /usr/local/man/man
DEFS = -DTI_RPC -DFCNTL_LOCK -DSYSINFO
CC = {your compiler}
RANLIB = :
CFLAGS = $(DEFS) -g -I/path/to/db/include
LDLIBS = -L/path/to/db/library -lnsl -ldb
TSTLIBS = -L. -ldrac -lnsl
MANLIB = 3
MANADM = 1m

For SunOS 4.x...

INSTALL = install
EBIN = /usr/local/etc
MAN = /usr/local/man/man
DEFS = -DSOCK_RPC -DFLOCK_LOCK -DGETHOST
CC = {your compiler}
RANLIB = ranlib
CFLAGS = -Dstrtoul=strtol $(DEFS) -g -I/path/to/db/include
LDLIBS = -L/path/to/db/library -ldb
TSTLIBS = -L. -ldrac
RPCGENFLAGS = -I
MANLIB = 3
MANADM = 8

For BSDI...

INSTALL = install
EBIN = /usr/local/sbin
MAN = /usr/local/man/man
DEFS = -DSOCK_RPC -DFCNTL_LOCK -DGETHOST
CC = {your compiler}
RANLIB = ranlib
CFLAGS = $(DEFS) -g -I/path/to/db/include
LDLIBS = -L/path/to/db/library -ldb
TSTLIBS = -L. -ldrac
MANLIB = 3
MANADM = 8

For IRIX-6.x...

INSTALL = /usr/bin/X11/bsdinst
EBIN = /usr/local/sbin
MAN = /usr/local/man/man
DEFS = -DTI_RPC -DFCNTL_LOCK -DSYSINFO -D_SVR4_TIRPC
CC = {your compiler}
RANLIB = :
CFLAGS = $(DEFS) -g -I/path/to/db/include
LDLIBS = -L/path/to/db/library -lnsl -ldb
TSTLIBS = -L. -ldrac -lnsl
RPCGENFLAGS = -I
MANLIB = 3
MANADM = 1m

For NetBSD...

INSTALL = install
EBIN = /usr/local/sbin
MAN = /usr/local/man/man
DEFS = -DSOCK_RPC -DFCNTL_LOCK -DGETHOST -DDASH_C
CC = {your compiler}
RANLIB = ranlib
CFLAGS = $(DEFS) -g -I/path/to/db/include
LDLIBS = 
TSTLIBS = -L. -ldrac
RPCGENFLAGS = -C
MANLIB = 3
MANADM = 8

For FreeBSD 2.2.x...

INSTALL = install
EBIN = /usr/local/sbin
MAN = /usr/local/man/man
DEFS = -DSOCK_RPC -DFLOCK_LOCK -DGETHOST -DDASH_C
CC = {your compiler}
RANLIB = ranlib
CFLAGS = $(DEFS) -g -I/path/to/db/include
LDLIBS = 
TSTLIBS = -L. -ldrac
RPCGENFLAGS = -I -C
MANLIB = 3
MANADM = 8

For FreeBSD-4.1 with gdbm-1.8

INSTALL = install
EBIN = /usr/local/sbin
MAN = /usr/local/man/man
DEFS = -DSOCK_RPC -DFLOCK_LOCK -DGETHOST -DDASH_C
CC = cc
RANLIB = :
CFLAGS = $(DEFS) -g -I/usr/local/include
LDLIBS = 
TSTLIBS = -L. -ldrac
RPCGENFLAGS = -C
MANLIB = 3
MANADM = 1m

For Linux...

INSTALL = install
EBIN = /usr/local/sbin
MAN = /usr/local/man/man
DEFS = -DSOCK_RPC -DFCNTL_LOCK -DGETHOST -DDASH_C
CC = {your compiler}
RANLIB = :
CFLAGS = $(DEFS) -g
LDLIBS = -ldb
TSTLIBS = -L. -ldrac -lnsl
RPCGENFLAGS = -C -I
MANLIB = 3
MANADM = 8

For AIX...

INSTALL = /usr/ucb/install
EBIN = /usr/local/sbin
MAN = /usr/local/man/man
DEFS = -DD_BSD -DBSD_INCLUDES -DSOCK_RPC -DFCNTL_LOCK -DGETHOST -DDEBUG
CC = {your compiler}
RANLIB = :
CFLAGS = $(DEFS) -g -I/path/to/db/include
LDLIBS = -L/path/to/db/library -ldb
TSTLIBS = -L. -ldrac
RPCGENFLAGS =
MANLIB = 3
MANADM = 1m