#! /bin/sh
##  $Revision: 1.10 $
##  Set up any and all shell variables that an INN shell script
##  might need.  Also sets umask.

## NOTE: When adding stuff here, add the corresponding variables to 
## innshellvars.pl and innshellvars.tcl and innshellvars.csh

prefix=@prefix@
exec_prefix=@exec_prefix@
eval `@bindir@/innconfval -s`

NEWSHOME=${PATHNEWS}
SPOOLBASE=${PATHSPOOL}
MOST_LOGS=${PATHLOG}
export NEWSHOME SPOOL MOST_LOGS

NEWSBIN=${PATHBIN}
NEWSETC=${PATHETC}
NEWSLIB=@libdir@
INNDDIR=${PATHRUN}
LOCKS=${PATHRUN}
export NEWSBIN NEWSETC INNDDIR NEWSHOME

ERRLOG=${MOST_LOGS}/errlog
LOG=${MOST_LOGS}/news

ARCHIVEDIR=${PATHARCHIVE}
SPOOL=${PATHARTICLES}
BATCH=${PATHOUTGOING}
INCOMING=${PATHINCOMING}
OVERVIEWDIR=${PATHOVERVIEW}
SPOOLNEWS=${PATHINCOMING}
BADNEWS=${PATHINCOMING}/bad

ACTIVE=${PATHDB}/active
ACTIVETIMES=${PATHDB}/active.times
CTLFILE=${NEWSETC}/control.ctl
CTLWATCH=${NEWSETC}/innwatch.ctl
HISTORY=${PATHDB}/history
NEWACTIVE=${PATHDB}/active.tmp
NEWSFEEDS=${NEWSETC}/newsfeeds
NEWSGROUPS=${PATHDB}/newsgroups
OLDACTIVE=${PATHDB}/active.old
PATH_MOTD=${NEWSETC}/motd.news
EXPIRECTL=${NEWSETC}/expire.ctl
LOCALGROUPS=${NEWSETC}/localgroups

CONTROLPROGS=${PATHCONTROL}
INNCONFVAL=${NEWSBIN}/innconfval
INND=${NEWSBIN}/innd
INNWATCH=${NEWSBIN}/innwatch
INEWS=${NEWSBIN}/inews
RNEWS=${NEWSBIN}/rnews
PERL_STARTUP_INND=${PATHFILTER}/startup_innd.pl
PERL_FILTER_INND=${PATHFILTER}/filter_innd.pl
PERL_FILTER_NNRPD=${PATHFILTER}/filter_nnrpd.pl
PYTHON_FILTER_INND=${PATHFILTER}/filter_innd.py
PATH_PYTHON_INN_MODULE=${PATHFILTER}/INN.py
PATH_TCL_STARTUP=${PATHFILTER}/startup.tcl
PATH_TCL_FILTER=${PATHFILTER}/filter.tcl

DAILY=${LOCKS}/LOCK.news.daily

NEWSCONTROL=${INNDDIR}/control
NNTPCONNECT=${INNDDIR}/nntpin
SERVERPID=${INNDDIR}/innd.pid
INNWSTATUS=${INNDDIR}/innwatch.status
WATCHPID=${INNDDIR}/innwatch.pid

AWK='@AWK@'
SED='@SED@'
INNDF=${NEWSBIN}/inndf
EGREP='@EGREP@'
PERL='@PERL@'
GPGV='@GPGV@'
PGP='@PGP@'
SORT='@SORT@'
GETFTP='@GETFTP@'
COMPRESS='@COMPRESS@'
GZIP='@GZIP@'
UNCOMPRESS='@UNCOMPRESS@'
LOG_COMPRESS='@LOG_COMPRESS@'
Z='@LOG_COMPRESSEXT@'

if [ "$OVMETHOD" = "ovdb" ]; then
    DB_HOME="${PATHOVERVIEW}"
    export DB_HOME
fi

TEMPSOCK=`basename ${INNDDIR}/ctlinndXXXXXX | ${SED} -e 's/XXXXXX$/*/'`
TEMPSOCKDIR=`echo ${INNDDIR}/ctlinndXXXXXX | ${SED} -e 's@/[^/]*$@@'`

NEWSMASTER=@NEWSMASTER@
NEWSUSER=@NEWSUSER@
NEWSGROUP=@NEWSGRP@

TMPDIR=${PATHTMP}; export TMPDIR;

SPOOLTEMP=${PATHTMP}

NEWSLBIN=${NEWSHOME}/local
export NEWSLBIN

umask @NEWSUMASK@

PATH=${NEWSLBIN}:${NEWSBIN}:${PATH}:/bin:/usr/bin
export PATH
