Index: head/mail/davmail/Makefile =================================================================== --- head/mail/davmail/Makefile (revision 443885) +++ head/mail/davmail/Makefile (revision 443886) @@ -1,61 +1,62 @@ # Created by: John Prather # $FreeBSD$ PORTNAME= davmail PORTVERSION= 4.8.0 +PORTREVISION= 1 CATEGORIES= mail java MASTER_SITES= SF/davmail/davmail/${PORTVERSION} DISTNAME= ${PORTNAME}-src-${PORTVERSION}-${REVISION} MAINTAINER= john.c.prather@gmail.com COMMENT= POP/IMAP/SMTP/Caldav/Carddav/LDAP Exchange Gateway LICENSE= GPLv2 USES= dos2unix tar:tgz DOS2UNIX_FILES= build.xml NO_ARCH= yes USE_ANT= yes USE_JAVA= yes JAVA_VERSION= 1.6+ ALL_TARGET= release REVISION= 2479 # 4.8.0 # port build number, same as on DISTNAME MAKE_ARGS= -Drevision=${REVISION} MAKE_ENV+= "ANT_OPTS=-Dfile.encoding=UTF-8" USERS= davmail GROUPS= davmail DATADIR= ${JAVASHAREDIR}/${PORTNAME} USE_RC_SUBR= davmail -SUB_FILES= davmail.sh +SUB_FILES= davmail.sh pkg-message post-patch: @${REINPLACE_CMD} -e 's#exec=\"davmail\"#exec=\"${PREFIX}/bin/davmail\"#' \ -e 's#icon=\"/usr/share/davmail/davmail.png\"#icon=\"${DATADIR}/davmail.png\"#' \ ${WRKSRC}/build.xml do-install: @cd ${WRKSRC}/dist && ${FIND} . -type d \ -exec ${MKDIR} ${STAGEDIR}${DATADIR}/\{} \; @cd ${WRKSRC}/dist && ${FIND} . -type f \ -not -name "*.deb" \ -not -name "*.md5" \ -not -name "*.MD5" \ -not -name "*.tgz" \ -not -name "*.exe" \ -not -name "swt-*.jar" \ -not -name "*.zip" \ -not -name "*.war" \ -not -name "*.rpm" \ -not -name "*.desktop" \ -exec ${INSTALL_DATA} \{} ${STAGEDIR}${DATADIR}/\{} \; @${FIND} ${STAGEDIR}/${DATADIR} -depth -empty -type d -delete ${INSTALL_SCRIPT} ${WRKDIR}/davmail.sh ${STAGEDIR}${PREFIX}/bin/davmail ${INSTALL_DATA} ${WRKSRC}/src/etc/davmail.properties \ ${STAGEDIR}${PREFIX}/etc/davmail.properties.sample ${INSTALL_DATA} ${WRKSRC}/dist/davmail.desktop ${STAGEDIR}${PREFIX}/share/applications/ .include Index: head/mail/davmail/files/davmail.in =================================================================== --- head/mail/davmail/files/davmail.in (revision 443885) +++ head/mail/davmail/files/davmail.in (revision 443886) @@ -1,67 +1,117 @@ #!/bin/sh # $FreeBSD$ # # PROVIDE: davmail # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf or /etc/rc.conf.local to # enable davmail: # davmail_enable (bool): Set to "NO" by default. # davmail_config (path): Set to # "%%PREFIX%%/etc/davmail.properties" # by default +# davmail_profiles: Set to "" by default . /etc/rc.subr name="davmail" rcvar=davmail_enable load_rc_config $name : ${davmail_enable="NO"} : ${davmail_config="%%PREFIX%%/etc/davmail.properties"} : ${davmail_user="davmail"} : ${davmail_group="davmail"} start_precmd="${name}_prestart" start_cmd="${name}_start" davmail_procname() { JAVAVM_DRYRUN=yes "%%LOCALBASE%%/bin/java" | \ /usr/bin/awk -F= '{if ($1=="JAVAVM_PROG") print $2}' 2> /dev/null } pidfiledir="/var/run/davmail" pidfile="${pidfiledir}/davmail.pid" procname="$(davmail_procname)" required_files=${davmail_config} + +if [ -n "$2" ]; then + profile="$2" + if [ "x${davmail_profiles}" != "x" ]; then + if [ ! -f %%PREFIX%%/etc/davmail.${profile}.properties ]; then + echo "You must setup a davmail.${profile}.properties config file" + return 1 + fi + eval davmail_enable="\${davmail_${profile}_enable:-${davmail_enable}}" + pidfile="${pidfiledir}/davmail.${profile}.pid" + davmail_config="%%PREFIX%%/etc/davmail.${profile}.properties" + required_files="${davmail_config}" + fi +else + if [ "x${davmail_profiles}" != "x" -a "x$1" != "x" ]; then + for profile in ${davmail_profiles}; do + eval _enable="\${davmail_${profile}_enable}" + case "x${_enable:-${davmail_enable}}" in + x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee]) + continue + ;; + x[Yy][Ee][Ss]) + ;; + *) + if test -z "$_enable"; then + _var=davmail_enable + else + _var=davmail_"${profile}"_enable + fi + echo "Bad value" \ + "'${_enable:-${davmail_enable}}'" \ + "for ${_var}. " \ + "Profile ${profile} skipped." + continue + ;; + esac + echo "===> davmail profile: ${profile}" + %%PREFIX%%/etc/rc.d/davmail $1 ${profile} + retcode="$?" + if [ "0${retcode}" -ne 0 ]; then + failed="${profile} (${retcode}) ${failed:-}" + else + success="${profile} ${success:-}" + fi + done + exit 0 + fi +fi + command="/usr/sbin/daemon" command_args="-p ${pidfile} %%LOCALBASE%%/bin/java -cp '%%DATADIR%%/davmail.jar:%%DATADIR%%/lib/*' davmail.DavGateway '${davmail_config}'" davmail_daemon() { su -m ${davmail_user} -c "env -i PATH=${PATH} ${command} ${command_args}" } davmail_prestart() { if [ ! -d "${pidfiledir}" ]; then install -d -o "${davmail_user}" -g "${davmail_group}" -m 750 "${pidfiledir}" fi } davmail_start() { if [ -z "$rc_fast" -a -n "$rc_pid" ]; then echo 1>&2 "${name} already running? (pid=$rc_pid)." return 1 fi echo "Starting ${name}." { davmail_daemon 2>&1 | /usr/bin/logger -p daemon.info -t davmail; } & } run_rc_command "$1" Index: head/mail/davmail/files/pkg-message.in =================================================================== --- head/mail/davmail/files/pkg-message.in (nonexistent) +++ head/mail/davmail/files/pkg-message.in (revision 443886) @@ -0,0 +1,9 @@ +In order to connect to several exchange servers, it is needed setup davmail +profiles. You have to set davmail_profiles in rc.conf, and configure +%%LOCALBASE%%/etc/davmail..properties properly. Example: + +davmail_profiles="exchange1 exchange2" +(and configure both %%LOCALBASE%%/etc/davmail.exchange[12].properties) + +You can also disable an specific profile by mean of +davmail__enable="NO" in rc.conf. Property changes on: head/mail/davmail/files/pkg-message.in ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property