#-*-sh-*-
#ident	"@(#)smail:RELEASE-3_2_0_114:EDITME-netbsdpkg,v 1.15 2001/06/23 03:48:05 woods Exp"
#
# netbsdpkg -- a netbsd install under "$PREFIX" with lots of options
#
# This should also work for FreeBSD and OpenBSD, or by hand with
# $PREFIX set in the environment (which is what the pkgsrc do-build
# target does).  Note though that you'll probably want the
# "mailwrapper" program too since this package explictly does *not*
# replace sendmail directly but installs in $PREFIX/libexec/smail.
#
if [ -z "$PREFIX" ] ; then
        echo "You have not set PREFIX in the environment!!!"
        exit 2
fi
# 
# these are all OK on NetBSD-1.3.2 thorugh 1.5T
# 
CWARNS="-Wall -Wshadow -Wswitch -Wreturn-type -Wpointer-arith -Wconversion -Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes"
# 
# -pipe may slow down small-memory systems
# 
CFLAGS="-g -O2 -pipe $CWARNS"
LDFLAGS="-g -O2 -pipe"
#
# don't waste time searching the sysem default directories twice for
# package libident and libwhoson.
#
if [ "$PREFIX" != /usr ]; then
	CPPFLAGS="-I${PREFIX}/include"
	LDFLAGS="${LDFLAGS} -Wl,-R${PREFIX}/lib -L${PREFIX}/lib"
fi
OS_TYPE=bsd4.4-lite
MISC_DEFINES="SMAIL_LOG_STYLE=2"
MISC_DEFINES="$MISC_DEFINES:NO_FORWARDTO_FILE"
MISC_DEFINES="$MISC_DEFINES:USE_TARGET_DOMAIN"
MISC_DEFINES="$MISC_DEFINES:USE_LSEARCH_REGEXCMP"
MISC_DEFINES="$MISC_DEFINES:USE_STRICT_MX"
MISC_DEFINES="$MISC_DEFINES:LOG_SMTP_NON_COMPLIANCE"
MISC_DEFINES="$MISC_DEFINES:LOG_SMTP_ILLEGAL_OPERAND_WARNING"
#
HAVE=EHLO
#
HAVE=$HAVE:RFC1413
LIBS="-lident"
#
HAVE=$HAVE:LIBWHOSON
LIBS="$LIBS -lwhoson"
# 
# It would be nice to be able to force this to /etc/smail if
# PREFIX=/usr, but that cannot yet be done with NetBSD's pkg tools.
# (PLIST entries always have the value of $PREFIX added to them)
#
LIB_DIR=$PREFIX/etc/smail
# 
UTIL_BIN_DIR=$PREFIX/libexec/smail
# 
# force everything into $PREFIX/libexec/smail
# note that the pkgsrc Makefile will fix a couple things up for us...
#
SMAIL_BIN_DIR=$UTIL_BIN_DIR
# 
# Note that the following two depend on having mailwrapper to replace sendmail
#
NEWALIASES="$UTIL_BIN_DIR/newaliases"
OTHER_SMAIL_NAMES="$UTIL_BIN_DIR/sendmail:$UTIL_BIN_DIR/rmail"
# 
# set SMAIL_NAME empty to use $SMAIL_BIN_DIR/smail
#
SMAIL_NAME=''
# 
# Note that the pkg_* tools will not know about these /var places, but
# that's OK because they get created at run-time....
#
SPOOL_DIRS=/var/spool/smail
TMP_DIR=/var/spool/smail/tmp
LOG_DIR=/var/log/smail
UNSHAR_MAP_DIR=/var/spool/uumaps
NEWS_SPOOL_DIR=/var/spool/news
UUWHO_FILE=/var/spool/smail/uuwho
# 
# WARNING: some older versions of pkgsrc will need 'cd $PREFIX; ln -s . share'
# 
MAN1=$PREFIX/share/man/man1
MAN1_EXT=1
MAN5=$PREFIX/share/man/man5
MAN5_EXT=5
MAN8=$PREFIX/share/man/man8
MAN8_EXT=8
# 
# The pkg_* tools won't know about /etc/aliases either, but we're
# simply stealing it from sendmail anyway so there's no need to
# include it in the binary package.
# 
if [ -f /etc/mail/aliases ] ; then
	ALIASES_FILE=/etc/mail/aliases
else
	ALIASES_FILE=/etc/aliases
fi
# 
# ... note we are eliminating the use of db for alias files
#
ALIASES_TYPE=lsearch
# 
FORCE_PATHS_FILE=forcepaths
FORCE_PATHS_TYPE=lsearch
# 
FORCE_SMTP_FILE=forcesmtp
FORCE_SMTP_TYPE=lsearch
# 
REWRITE_FILE=rewrite
REWRITE_TYPE=lsearch
#
# this assumes you use the HDB UUCP style config, which is
# the only one that will work with UUCP_SYSTEM_FILE anyway...
# (and if this file does not exist "uuname" is used instead)
#
UUCP_SYSTEM_FILE=/etc/uucp/Systems
MISC_C_DEFINES='
#define NO_ALIASES_OPTIONAL		/* aliases file is not optional */
#define ALIASES_TRYAGAIN		/* defer message if no aliases file */
#define NO_FORCE_PATHS_OPTIONAL		/* forcepaths file is not optional */
#define FORCE_PATHS_TRYAGAIN		/* defer message if no forcepaths file */
#define NO_FORCE_SMTP_OPTIONAL		/* forcesmtp file is not optional */
#define FORCE_SMTP_TRYAGAIN		/* defer message if no forcesmtp file */
#define NO_REWRITE_OPTIONAL		/* rewrite file is not optional */
#define REWRITE_TRYAGAIN		/* defer message if no rewrite file */
'
