. $GRIMOIRE/FUNCTIONS                                                 &&
#if [[ $PROFTPD_DEVEL == "n" ]]; then
if [[ $(get_sorcery_kernel_config CONFIG_SECURITY) != y ]]; then
  config_query_option PROFTPD_CAPS                                  \
  "You don't have capabilities enabled in your kernel, do you still \
   want to build them?" n "" "--disable-cap"                            
fi
#fi                                                                    &&

config_query_option PROFTPD_IP6 "enable IPv6 support?"                \
y "--enable-ipv6" ""                                                  &&

config_query PROFTPD_MOD                                              \
"Choose optional user contributed modules to install?" n              &&

#radius module failed (probably missing dep), all the others not in
#the query are yet to be tried.
if [[ $PROFTPD_MOD == "y" ]]; then
  config_query_multi PROFTPD_MODS "Choose among this list:"           \
  mod_ratio mod_readme mod_rewrite mod_tls mod_wrap                   \
  mod_sql mod_ldap                                                    &&

  PROFTPD_MODS="--with-modules=`echo $PROFTPD_MODS | sed 's/\ /:/g'`" &&

  if [[ "x`echo $PROFTPD_MODS | grep sql`" != "x" ]]; then 
    config_query_list PROFTPD_SQL                                     \
    "You chose mod_sql, now which DBMS do you want:" mod_sql_mysql    \
     mod_sql_postgres                                                 &&

    if [[ "x${PROFTPD_SQL}" == "xmod_sql_mysql" ]]; then
      SQL_INC="/usr/include/mysql"
    else
	  SQL_INC="/usr/include/postgresql"
    fi
    
    PROFTPD_MODS="${PROFTPD_MODS}:${PROFTPD_SQL}                     \
    --with-includes=${SQL_INC}"                                      
  fi                                                                   
fi

