#!/bin/sh

UNIX_TYPE=freebsd
VERBOSE_INSTALL=yes

LOCALBASE=${LOCALBASE:-/usr/local}

CONF_DTC_SYSTEM_USERNAME=dtc
CONF_DTC_SYSTEM_GROUPNAME=dtcgrp

if [ -f "${LOCALBASE}/sbin/apxs" ]; then
	PATH_HTTPD_CONF="`/usr/local/sbin/apxs -q SYSCONFDIR`/httpd.conf"
else
	echo "Could not found your httpd.conf: exiting."
	exit 1
fi
PATH_APACHE_PID_FILE="/var/run/httpd.pid"
PATH_PHP_INI_APACHE=${LOCALBASE}/etc/php.ini
PATH_NAMED_CONF="/etc/namedb/named.conf"
# Copy default conf if no conf exists (BSD specific)
if [ ! -f ${LOCALBASE}/etc/proftpd.conf ] ; then
	if [ -e ${LOCALBASE}/etc/proftpd.conf.default ] ; then
		cp ${LOCALBASE}/etc/proftpd.conf.default ${LOCALBASE}/etc/proftpd.conf
	fi
fi
conf_apache_version=2
PATH_PROFTPD_CONF="${LOCALBASE}/etc/proftpd.conf"
if [ ! -f ${LOCALBASE}/etc/pure-ftpd.conf ] ; then
	if [ -f ${LOCALBASE}/etc/pure-ftpd.conf.sample ] ; then
		cp ${LOCALBASE}/etc/pure-ftpd.conf.sample ${LOCALBASE}/etc/pure-ftpd.conf
	fi
fi
PATH_PUREFTPD_CONF="${LOCALBASE}/etc/pure-ftpd.conf"
PATH_DOVECOT_CONF="${LOCALBASE}/etc/dovecot.conf"
PATH_COURIER_CONF_PATH="${LOCALBASE}/etc/courier"
PATH_COURIER_AUTHD_CONF_PATH="${LOCALBASE}/etc/courier"
if [ ! -f $PATH_COURIER_AUTHD_CONF_PATH/authdaemonrc ]; then
	if [ -f ${LOCALBASE}/etc/authlib/authdaemonrc ]; then
		PATH_COURIER_AUTHD_CONF_PATH="${LOCALBASE}/etc/authlib"
	fi
fi
PATH_POSTFIX_CONF="${LOCALBASE}/etc/postfix/main.cf"
PATH_POSTFIX_ETC="${LOCALBASE}/etc/postfix"
PATH_SASL_PASSWD2="${LOCALBASE}/sbin/saslpasswd2"
PATH_MAILDROP_BIN="${LOCALBASE}/bin/maildrop"
PATH_USERDB_BIN="${LOCALBASE}/sbin/userdb"
PATH_QMAIL_NEWU="${LOCALBASE}/bin/qmail-newu"
PATH_QMAIL_CTRL="${QMAIL_DIR}/control"
PATH_PHP_CGI="${LOCALBASE}/bin/php"
FREERADIUS_ETC="${LOCALBASE}/etc/raddb"
PATH_DTC_SHARED="${LOCALBASE}/www/dtc"
PATH_CRONTAB_CONF=/etc/crontab
PATH_DTC_CRON_FILE=${LOCALBASE}/etc/cron.d/dtc
PATH_AWSTATS_ETC=${LOCALBASE}/etc/awstats
PATH_AMAVISD_CONF=${LOCALBASE}/etc/amavisd.conf
AMAVISD_USER=vscan
PATH_CLAMAV_CONF=${LOCALBASE}/etc/clamd.conf
MYSQL_DB_SOCKET_PATH="/tmp/mysql.sock"
PATH_CGIBIN="${LOCALBASE}/www/cgi-bin"

PATH_SASLLIB=${LOCALBASE}/lib/sasl2

PATH_SUDOERS_CONF="${LOCALBASE}/etc/sudoers"
PATH_RRDTOOL="${LOCALBASE}/bin/rrdtool"

PATH_CYRUS_CONF=${LOCALBASE}/etc/imapd.conf

PATH_MYSQMAIL_CONF=${LOCALBASE}/etc/mysqmail.conf

PATH_DTC_ETC="${LOCALBASE}/var/dtc/etc"
PATH_DTC_ADMIN=$PATH_DTC_SHARED"/admin"
PATH_DTC_CLIENT=$PATH_DTC_SHARED"/client"

PATH_BASH=${LOCALBASE}/bin/bash

USER_ADD_CMD=adduser
GROUP_ADD_CMD="pw groupadd"
USER_MOD_CMD="pw usermod"
PASSWD_CMD=passwd
DTC_SAVED_INSTALL_CONFIG=${PATH_DTC_SHARED}/saved_install_config

DKFILTER_INIT_SCRIPT=${LOCALBASE}/etc/rc.d/dkfilter
