default_pre_build &&
cd "$SOURCE_DIRECTORY" &&

#
# We don't want to install into /usr/local, so
# we'll just copy the files correctly
#
patch  -p0  <  ${SPELL_DIRECTORY}/mk.diff  &&

#
# Fix CFLAGS
#
sedit '
	/^CFLAGS[\t ]*=/!b
	:C /\\$/ {N; b C}
	s/=[\t ]*-O2/+=/
	s/ -Werror / /
' Makefile &&

#
# Should be made to allow someone to say "n" even if
# the package is installed, but this is the easy way
# I'm doing it for now. :)
#
if is_depends_enabled ${SPELL} tcp_wrappers; then
  sedit  "/^#undef VSF_BUILD_TCPWRAPPERS/{s/undef/define/}"  builddefs.h
fi  &&

if is_depends_enabled ${SPELL} $(get_spell_provider ${SPELL} SSL); then
  sedit  "/^#undef VSF_BUILD_SSL/{s/undef/define/}"  builddefs.h
fi  &&

#
# builddefs.h defaults to using Linux-PAM
#
if ! is_depends_enabled ${SPELL} linux-pam; then
  sedit  "/^#define VSF_BUILD_PAM/{s/define/undef/}"  builddefs.h
fi
