From owner-svn-ports-head@freebsd.org Mon Jun 19 17:25:59 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E789DA1500; Mon, 19 Jun 2017 17:25:59 +0000 (UTC) (envelope-from rodrigo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D2F57CEB3; Mon, 19 Jun 2017 17:25:59 +0000 (UTC) (envelope-from rodrigo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5JHPwjd050118; Mon, 19 Jun 2017 17:25:58 GMT (envelope-from rodrigo@FreeBSD.org) Received: (from rodrigo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5JHPwvc050115; Mon, 19 Jun 2017 17:25:58 GMT (envelope-from rodrigo@FreeBSD.org) Message-Id: <201706191725.v5JHPwvc050115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigo set sender to rodrigo@FreeBSD.org using -f From: Rodrigo Osorio Date: Mon, 19 Jun 2017 17:25:58 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r443886 - in head/mail/davmail: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jun 2017 17:25:59 -0000 Author: rodrigo Date: Mon Jun 19 17:25:57 2017 New Revision: 443886 URL: https://svnweb.freebsd.org/changeset/ports/443886 Log: Add profiles suport in davemail. It is useful when you need to connect to more than one exchange server. Bump portrevioon PR: 218140 Submitted by: jjuanino@gmail.com Approved by: maintainer Added: head/mail/davmail/files/pkg-message.in (contents, props changed) Modified: head/mail/davmail/Makefile head/mail/davmail/files/davmail.in Modified: head/mail/davmail/Makefile ============================================================================== --- head/mail/davmail/Makefile Mon Jun 19 17:04:24 2017 (r443885) +++ head/mail/davmail/Makefile Mon Jun 19 17:25:57 2017 (r443886) @@ -3,6 +3,7 @@ PORTNAME= davmail PORTVERSION= 4.8.0 +PORTREVISION= 1 CATEGORIES= mail java MASTER_SITES= SF/davmail/davmail/${PORTVERSION} DISTNAME= ${PORTNAME}-src-${PORTVERSION}-${REVISION} @@ -30,7 +31,7 @@ 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\"#' \ Modified: head/mail/davmail/files/davmail.in ============================================================================== --- head/mail/davmail/files/davmail.in Mon Jun 19 17:04:24 2017 (r443885) +++ head/mail/davmail/files/davmail.in Mon Jun 19 17:25:57 2017 (r443886) @@ -12,6 +12,7 @@ # davmail_config (path): Set to # "%%PREFIX%%/etc/davmail.properties" # by default +# davmail_profiles: Set to "" by default . /etc/rc.subr @@ -38,6 +39,55 @@ 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}'" Added: head/mail/davmail/files/pkg-message.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/davmail/files/pkg-message.in Mon Jun 19 17:25:57 2017 (r443886) @@ -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.