b981135edd
fix deinstall problem PR: 39003 Submitted by: maintainer
305 lines
9.7 KiB
Bash
305 lines
9.7 KiB
Bash
#!/bin/sh
|
|
# $FreeBSD: /tmp/pcvs/ports/mail/courier/scripts/Attic/configure.courier,v 1.3 2002-06-08 18:54:01 ijliao Exp $
|
|
|
|
[ -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc ] && exit
|
|
|
|
tempfile=`mktemp -t checklist`
|
|
|
|
if [ -x ${PREFIX}/pgsql/bin/postgres -a ! -x ${PREFIX}/bin/postgres ]; then
|
|
PGSQLBASE=${PREFIX}/pgsql
|
|
PGSQLINCLUDES=${PGSQLBASE}/include
|
|
else
|
|
PGSQLBASE=${PREFIX}
|
|
PGSQLINCLUDES=${PGSQLBASE}/include/pgsql
|
|
fi
|
|
|
|
if [ ":${BATCH}" = ':yes' ]; then
|
|
[ ":${WITH_EXPECT}" = ':yes' ] && OPTIONS="${OPTIONS} \"Expect\""
|
|
[ ":${WITH_GNUPG}" = ':yes' ] && OPTIONS="${OPTIONS} \"GnuPG\""
|
|
[ ":${WITH_ASPELL}" = ':yes' ] && OPTIONS="${OPTIONS} \"ASpell\""
|
|
[ ":${WITH_ISPELL}" = ':yes' ] && OPTIONS="${OPTIONS} \"ISpell\""
|
|
[ ":${WITH_LDAP1}" = ':yes' ] && OPTIONS="${OPTIONS} \"OpenLDAP1\""
|
|
[ ":${WITH_LDAP2}" = ':yes' ] && OPTIONS="${OPTIONS} \"OpenLDAP2\""
|
|
[ ":${WITH_MYSQL}" = ':yes' ] && OPTIONS="${OPTIONS} \"MySQL\""
|
|
[ ":${WITH_PGSQL}" = ':yes' ] && OPTIONS="${OPTIONS} \"PostgreSQL\""
|
|
[ ":${WITH_VPOPMAIL}" = ':yes' ] && OPTIONS="${OPTIONS} \"VPopMail\""
|
|
[ ":${WITH_PROCMAIL}" = ':yes' ] && OPTIONS="${OPTIONS} \"Procmail\""
|
|
[ ":${WITH_SENDFAX}" = ':yes' ] && OPTIONS="${OPTIONS} \"SendFax\""
|
|
[ ":${WITH_IPV6}" = ':yes' ] && OPTIONS="${OPTIONS} \"IPv6\""
|
|
[ -n "${OPTIONS}" ] && set ${OPTIONS}
|
|
else
|
|
if [ ":${WITH_EXPECT}" = ':yes' \
|
|
-o -x ${LOCALBASE}/bin/expect ]; then
|
|
SET_EXPECT="ON"
|
|
else
|
|
SET_EXPECT="OFF"
|
|
fi
|
|
if [ ":${WITH_GNUPG}" = ':yes' \
|
|
-o -x ${LOCALBASE}/bin/gpg ]; then
|
|
SET_GNUPG="ON"
|
|
else
|
|
SET_GNUPG="OFF"
|
|
fi
|
|
if [ ":${WITH_ASPELL}" = ':yes' \
|
|
-o -x ${LOCALBASE}/bin/aspell ]; then
|
|
SET_ASPELL="ON"
|
|
SET_ISPELL="OFF"
|
|
else
|
|
SET_ASPELL="OFF"
|
|
fi
|
|
if [ ":${WITH_ISPELL}" = ':yes' \
|
|
-o -x ${LOCALBASE}/bin/ispell \
|
|
-a "${SET_ASPELL}" = "OFF" ]; then
|
|
SET_ISPELL="ON"
|
|
SET_ASPELL="OFF"
|
|
else
|
|
SET_ISPELL="OFF"
|
|
fi
|
|
if [ ":${WITH_LDAP1}" = ':yes' \
|
|
-o -f ${LOCALBASE}/lib/libldap.so.1 \
|
|
-a -f ${LOCALBASE}/lib/liblber.so.1 ]; then
|
|
SET_LDAP1="ON"
|
|
SET_LDAP2="OFF"
|
|
else
|
|
SET_LDAP1="OFF"
|
|
fi
|
|
if [ ":${WITH_LDAP2}" = ':yes' \
|
|
-o -f ${LOCALBASE}/lib/libldap.so.2 \
|
|
-a -f ${LOCALBASE}/lib/liblber.so.2 ]; then
|
|
SET_LDAP1="OFF"
|
|
SET_LDAP2="ON"
|
|
else
|
|
SET_LDAP2="OFF"
|
|
fi
|
|
if [ ":${WITH_MYSQL}" = ':yes' \
|
|
-o -f ${LOCALBASE}/lib/mysql/libmysqlclient.so.10 ]; then
|
|
SET_MYSQL="ON"
|
|
else
|
|
SET_MYSQL="OFF"
|
|
fi
|
|
if [ ":${WITH_PGSQL}" = ':yes' \
|
|
-o -f ${PGSQLBASE}/lib/libpq.so.2 ]; then
|
|
SET_PGSQL="ON"
|
|
else
|
|
SET_PGSQL="OFF"
|
|
fi
|
|
if [ ":${WITH_VPOPMAIL}" = ':yes' \
|
|
-o -f ${LOCALBASE}/vpopmail/lib/libvpopmail.a ]; then
|
|
SET_VPOPMAIL="ON" # authvchkpw and authmysql
|
|
SET_MYSQL="OFF" # are mutually exclusive
|
|
else
|
|
SET_VPOPMAIL="OFF"
|
|
fi
|
|
if [ ":${WITH_PROCMAIL}" = ':yes' \
|
|
-o -x ${LOCALBASE}/bin/procmail ]; then
|
|
SET_PROCMAIL="ON"
|
|
else
|
|
SET_PROCMAIL="OFF"
|
|
fi
|
|
if [ ":${WITH_SENDFAX}" = ':yes' \
|
|
-o -x ${LOCALBASE}/bin/pnmscale \
|
|
-a -x ${LOCALBASE}/bin/giftopnm \
|
|
-a -x ${LOCALBASE}/bin/jpegtopnm \
|
|
-a -x ${LOCALBASE}/bin/ppmtopgm \
|
|
-a -x ${LOCALBASE}/bin/pgmtopbm \
|
|
-a -x ${LOCALBASE}/bin/pbmtog3 \
|
|
-a -x ${LOCALBASE}/bin/g3topbm \
|
|
-a -x ${LOCALBASE}/bin/pngtopnm \
|
|
-a -x ${LOCALBASE}/bin/pnmtopng \
|
|
-a -x ${LOCALBASE}/bin/gs ]; then
|
|
SET_SENDFAX="ON"
|
|
else
|
|
SET_SENDFAX="OFF"
|
|
fi
|
|
if [ ":${WITH_IPV6}" = ':yes' ]; then
|
|
SET_IPV6="ON"
|
|
else
|
|
SET_IPV6="OFF"
|
|
fi
|
|
|
|
/usr/bin/dialog --title "Courier configuration options" --clear \
|
|
--checklist "\n\
|
|
Please select desired options:" -1 -1 16 \
|
|
Expect "Expect support for WebMail change passwd" ${SET_EXPECT} \
|
|
GnuPG "GNU Privacy Guard support for WebMail" ${SET_GNUPG} \
|
|
ASpell "ASpell support for WebMail" ${SET_ASPELL} \
|
|
ISpell "ISpell support for WebMail" ${SET_ISPELL} \
|
|
OpenLDAP1 "OpenLDAP 1.x authentication support" ${SET_LDAP1} \
|
|
OpenLDAP2 "OpenLDAP 2.x authentication support" ${SET_LDAP2} \
|
|
MySQL "MySQL authentication support" ${SET_MYSQL} \
|
|
PostgreSQL "PostgreSQL authentication support" ${SET_PGSQL} \
|
|
VPopMail "VPopMail authentication support" ${SET_VPOPMAIL} \
|
|
Procmail "Procmail local delivery support" ${SET_PROCMAIL} \
|
|
SendFax "mgetty+sendfax support" ${SET_SENDFAX} \
|
|
IPv6 "IPv6 support (experimental)" ${SET_IPV6} \
|
|
2> ${tempfile}
|
|
|
|
retval=$?
|
|
|
|
[ -s ${tempfile} ] && set `cat ${tempfile}`
|
|
rm -f ${tempfile}
|
|
|
|
case ${retval} in
|
|
0) [ -z "$*" ] && echo "Nothing selected" ;;
|
|
1) echo "Cancel pressed." && exit 1 ;;
|
|
esac
|
|
fi
|
|
|
|
${MKDIR} ${WRKDIRPREFIX}${CURDIR}
|
|
exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
|
|
|
|
echo "PREFIX= ${PREFIX}"
|
|
|
|
WITH_ISPELL="--without-ispell"
|
|
WITH_LDAP="--without-authldap"
|
|
WITH_MYSQL="--without-authmysql"
|
|
WITH_PGSQL="--without-authpgsql"
|
|
WITH_VCHKPW="--without-authvchkpw"
|
|
WITH_IPV6="--without-ipv6"
|
|
|
|
SUB_FAX="@comment "
|
|
SUB_LDAP="@comment "
|
|
SUB_MYSQL="@comment "
|
|
SUB_PGSQL="@comment "
|
|
|
|
while [ "$1" ]; do
|
|
case $1 in
|
|
\"Expect\")
|
|
echo "BUILD_DEPENDS+= expect:\${PORTSDIR}/lang/expect"
|
|
;;
|
|
\"GnuPG\")
|
|
echo "BUILD_DEPENDS+= gpg:\${PORTSDIR}/security/gnupg"
|
|
;;
|
|
\"ASpell\")
|
|
if [ "$ISPELL" ]; then
|
|
echo "ASpell and ISpell are mutually exclusive." > /dev/stderr
|
|
rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
|
|
exit 1
|
|
fi
|
|
echo "BUILD_DEPENDS+= aspell:\${PORTSDIR}/textproc/aspell"
|
|
WITH_ISPELL="--with-ispell=\${LOCALBASE}/bin/aspell"
|
|
ASPELL=1
|
|
;;
|
|
\"ISpell\")
|
|
if [ "$ASPELL" ]; then
|
|
echo "ASpell and ISpell are mutually exclusive." > /dev/stderr
|
|
rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
|
|
exit 1
|
|
fi
|
|
echo "BUILD_DEPENDS+= ispell:\${PORTSDIR}/textproc/ispell"
|
|
WITH_ISPELL="--with-ispell=\${LOCALBASE}/bin/ispell"
|
|
ISPELL=1
|
|
;;
|
|
\"OpenLDAP1\")
|
|
if [ "$OPENLDAP2" ]; then
|
|
echo "OpenLDAP1 and OpenLDAP2 are mutually exclusive." > /dev/stderr
|
|
rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
|
|
exit 1
|
|
fi
|
|
echo "LIB_DEPENDS+= ldap.1:\${PORTSDIR}/net/openldap"
|
|
CPPFLAGS="${CPPFLAGS} -I\${LOCALBASE}/include"
|
|
LDFLAGS="${LDFLAGS} -L\${LOCALBASE}/lib"
|
|
WITH_LDAP="--with-authldap"
|
|
PKGNAMESUFFIX="${PKGNAMESUFFIX}-ldap"
|
|
SUB_LDAP=""
|
|
OPENLDAP1=1
|
|
;;
|
|
\"OpenLDAP2\")
|
|
if [ "$OPENLDAP1" ]; then
|
|
echo "OpenLDAP1 and OpenLDAP2 are mutually exclusive." > /dev/stderr
|
|
rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
|
|
exit 1
|
|
fi
|
|
echo "LIB_DEPENDS+= ldap.2:\${PORTSDIR}/net/openldap2"
|
|
CPPFLAGS="${CPPFLAGS} -I\${LOCALBASE}/include"
|
|
LDFLAGS="${LDFLAGS} -L\${LOCALBASE}/lib"
|
|
WITH_LDAP="--with-authldap"
|
|
PKGNAMESUFFIX="${PKGNAMESUFFIX}-ldap"
|
|
SUB_LDAP=""
|
|
OPENLDAP2=1
|
|
;;
|
|
\"MySQL\")
|
|
if [ -f ${LOCALBASE}/vpopmail/lib/libvpopmail.a ]; then
|
|
echo "VPopMAil and MySQL are mutually exclusive." > /dev/stderr
|
|
echo "Uninstall VPopMAil if you want MySQL authentication." > /dev/stderr
|
|
rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
|
|
exit 1
|
|
else
|
|
echo "LIB_DEPENDS+= mysqlclient.10:\${PORTSDIR}/databases/mysql323-client"
|
|
WITH_MYSQL="--with-authmysql"
|
|
WITH_MYSQL="${WITH_MYSQL} --with-mysql-libs=\${LOCALBASE}/lib/mysql"
|
|
WITH_MYSQL="${WITH_MYSQL} --with-mysql-includes=\${LOCALBASE}/include/mysql"
|
|
PKGNAMESUFFIX="${PKGNAMESUFFIX}-mysql"
|
|
SUB_MYSQL=""
|
|
fi
|
|
;;
|
|
\"PostgreSQL\")
|
|
echo "LIB_DEPENDS+= pq.2:\${PORTSDIR}/databases/postgresql7"
|
|
WITH_PGSQL="--with-authpgsql"
|
|
WITH_PGSQL="${WITH_PGSQL} --with-pgsql-libs=${PGSQLBASE}/lib"
|
|
WITH_PGSQL="${WITH_PGSQL} --with-pgsql-includes=${PGSQLINCLUDES}"
|
|
PKGNAMESUFFIX="${PKGNAMESUFFIX}-pgsql"
|
|
SUB_PGSQL=""
|
|
;;
|
|
\"VPopMail\")
|
|
echo "BUILD_DEPENDS+= \${LOCALBASE}/vpopmail/lib/libvpopmail.a:\${PORTSDIR}/mail/vpopmail"
|
|
WITH_VCHKPW="--with-authvchkpw"
|
|
PKGNAMESUFFIX="${PKGNAMESUFFIX}-vpopmail"
|
|
;;
|
|
\"Procmail\")
|
|
echo "BUILD_DEPENDS+= procmail:\${PORTSDIR}/mail/procmail"
|
|
;;
|
|
\"SendFax\")
|
|
echo "BUILD_DEPENDS+= gs:\${PORTSDIR}/print/ghostscript-gnu"
|
|
echo "BUILD_DEPENDS+= pnmscale:\${PORTSDIR}/graphics/netpbm"
|
|
echo "BUILD_DEPENDS+= giftopnm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "BUILD_DEPENDS+= jpegtopnm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "BUILD_DEPENDS+= ppmtopgm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "BUILD_DEPENDS+= pgmtopbm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "BUILD_DEPENDS+= pbmtog3:\${PORTSDIR}/graphics/netpbm"
|
|
echo "BUILD_DEPENDS+= g3topbm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "BUILD_DEPENDS+= pngtopnm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "BUILD_DEPENDS+= pnmtopng:\${PORTSDIR}/graphics/netpbm"
|
|
echo "RUN_DEPENDS+= gs:\${PORTSDIR}/print/ghostscript-gnu"
|
|
echo "RUN_DEPENDS+= pnmscale:\${PORTSDIR}/graphics/netpbm"
|
|
echo "RUN_DEPENDS+= giftopnm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "RUN_DEPENDS+= jpegtopnm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "RUN_DEPENDS+= ppmtopgm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "RUN_DEPENDS+= pgmtopbm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "RUN_DEPENDS+= pbmtog3:\${PORTSDIR}/graphics/netpbm"
|
|
echo "RUN_DEPENDS+= g3topbm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "RUN_DEPENDS+= pngtopnm:\${PORTSDIR}/graphics/netpbm"
|
|
echo "RUN_DEPENDS+= pnmtopng:\${PORTSDIR}/graphics/netpbm"
|
|
echo "WITH_FAX= yes"
|
|
WITH_TRANSPORT="${WITH_TRANSPORT} fax"
|
|
SUB_FAX=""
|
|
;;
|
|
\"IPv6\")
|
|
WITH_IPV6=""
|
|
;;
|
|
*)
|
|
echo "Invalid option(s): $*" > /dev/stderr
|
|
rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
|
|
exit 1
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
[ -n "${CPPFLAGS}" ] && echo "CONFIGURE_ENV+= CPPFLAGS='${CPPFLAGS}'"
|
|
[ -n "${LDFLAGS}" ] && echo "CONFIGURE_ENV+= LDFLAGS='${LDFLAGS}'"
|
|
[ -n "${LIBS}" ] && echo "CONFIGURE_ENV+= LIBS='${LIBS}'"
|
|
echo "CONFIGURE_ARGS+= ${WITH_ISPELL}"
|
|
echo "CONFIGURE_ARGS+= ${WITH_LDAP}"
|
|
echo "CONFIGURE_ARGS+= ${WITH_MYSQL}"
|
|
echo "CONFIGURE_ARGS+= ${WITH_PGSQL}"
|
|
echo "CONFIGURE_ARGS+= ${WITH_VCHKPW}"
|
|
echo "CONFIGURE_ARGS+= ${WITH_IPV6}"
|
|
echo "CONFIGURE_ARGS+= --with-transport='${WITH_TRANSPORT}'"
|
|
echo "PLIST_SUB+= SUB_FAX='${SUB_FAX}'"
|
|
echo "PLIST_SUB+= SUB_LDAP='${SUB_LDAP}'"
|
|
echo "PLIST_SUB+= SUB_MYSQL='${SUB_MYSQL}'"
|
|
echo "PLIST_SUB+= SUB_PGSQL='${SUB_PGSQL}'"
|
|
[ -n "${PKGNAMESUFFIX}" ] && echo "PKGNAMESUFFIX= ${PKGNAMESUFFIX}"
|
|
|
|
exit 0
|