ports/154903: [UPDATE] [PATCH] mail/davmail: update to 3.8.8 && new rc script
Chris Rees
utisoft at gmail.com
Sun Feb 20 08:30:11 UTC 2011
>Number: 154903
>Category: ports
>Synopsis: [UPDATE] [PATCH] mail/davmail: update to 3.8.8 && new rc script
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Sun Feb 20 08:30:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Chris Rees
>Release: FreeBSD 8.1-RELEASE-p1 i386
>Organization:
>Environment:
System: FreeBSD amnesiac.bayofrum.net 8.1-RELEASE-p1 FreeBSD 8.1-RELEASE-p1 #0: Sun Dec 12 15:14:48 GMT 2010 root at amnesiac.bayofrum.net:/usr/obj/usr/src/sys/GENERIC i386
>Description:
Davmail is great, but it doesn't come with an rc script, and doesn't come with a sample config file.
>How-To-Repeat:
>Fix:
- Update to 3.8.8
- Include new rc script
- Include & install default configuration file
- Canonicalise post-build sedding to take advantage of SUB_FILES
- Hide (@ prefix) commands issued during do-install target
Submitted by: utisoft_at_gmail.com
davmail-3.8.8.diff is also available at http://www.bayofrum.net/~chris/patches/davmail-3.8.8.diff
--- davmail-3.8.8.diff begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/davmail/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile 4 Jan 2011 22:40:34 -0000 1.2
+++ Makefile 16 Feb 2011 20:19:20 -0000
@@ -1,4 +1,4 @@
-# New ports collection makefile for: davmail
+# New ports collection Makefile for: davmail
# Date created: 28 Oct 2010
# Whom: John Prather
#
@@ -6,10 +6,10 @@
#
PORTNAME= davmail
-PORTVERSION= 3.8.7
+PORTVERSION= 3.8.8
CATEGORIES= mail java
MASTER_SITES= SF/davmail/davmail/${PORTVERSION}
-DISTNAME= ${PORTNAME}-src-${PORTVERSION}-1558
+DISTNAME= ${PORTNAME}-src-${PORTVERSION}-1608
EXTRACT_SUFX= .tgz
MAINTAINER= john.c.prather at gmail.com
@@ -23,16 +23,16 @@
DATADIR= ${JAVASHAREDIR}/${PORTNAME}
-post-build:
- ${CP} ${FILESDIR}/davmail.sh.in ${WRKDIR}/davmail.sh
- ${REINPLACE_CMD} -e "s|%BASE%|${DATADIR}|" \
- -e "s|%JAVASHAREDIR%|${JAVASHAREDIR}|" \
- ${WRKDIR}/davmail.sh
+USE_RC_SUBR= davmail
+SUB_FILES= davmail.sh
+SUB_LIST= JAVASHAREDIR=${JAVASHAREDIR} \
+ JAVAJARDIR=${JAVAJARDIR} \
+ PORTNAME=${PORTNAME}
do-install:
- cd ${WRKSRC}/dist && ${FIND} . -type d \
+ @cd ${WRKSRC}/dist && ${FIND} . -type d \
-exec ${MKDIR} ${DATADIR}/\{} \;
- cd ${WRKSRC}/dist && ${FIND} . -type f \
+ @cd ${WRKSRC}/dist && ${FIND} . -type f \
-not -name "*.deb" \
-not -name "*.tgz" \
-not -name "*.exe" \
@@ -41,6 +41,14 @@
-not -name "*.war" \
-not -name "*.rpm" \
-exec ${INSTALL_DATA} \{} ${DATADIR}/\{} \;
- ${INSTALL_SCRIPT} ${WRKDIR}/davmail.sh ${PREFIX}/bin/davmail
+ @${INSTALL_SCRIPT} ${WRKDIR}/davmail.sh ${PREFIX}/bin/davmail
+ @${INSTALL_DATA} ${FILESDIR}/davmail.properties.sample \
+ ${PREFIX}/etc
+
+post-install:
+ @if [ ! -f ${PREFIX}/etc/davmail.properties ]; then \
+ ${CP} -p ${PREFIX}/etc/davmail.properties.sample \
+ ${PREFIX}/etc/davmail.properties ; \
+ fi
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/davmail/distinfo,v
retrieving revision 1.2
diff -u -r1.2 distinfo
--- distinfo 4 Jan 2011 22:40:34 -0000 1.2
+++ distinfo 16 Feb 2011 20:19:20 -0000
@@ -1,2 +1,2 @@
-SHA256 (davmail-src-3.8.7-1558.tgz) = a44b5355de0af0bc524d81209eb079545a7dd523262a54216db21615aa65136f
-SIZE (davmail-src-3.8.7-1558.tgz) = 17231662
+SHA256 (davmail-src-3.8.8-1608.tgz) = 3c34b9092d85e6daba218f0177c99304f2a71eb097b640bf5fa07fad1d0753b6
+SIZE (davmail-src-3.8.8-1608.tgz) = 17272220
Index: pkg-plist
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/davmail/pkg-plist,v
retrieving revision 1.2
diff -u -r1.2 pkg-plist
--- pkg-plist 4 Jan 2011 22:40:34 -0000 1.2
+++ pkg-plist 16 Feb 2011 20:19:20 -0000
@@ -1,4 +1,7 @@
bin/davmail
+ at unexec if cmp -s %D/etc/davmail.properties.sample %D/etc/davmail.properties; then rm -f %D/etc/davmail.properties ; fi
+etc/davmail.properties.sample
+ at exec if [ ! -f %D/etc/davmail.properties ] ; then cp -p %D/%F %B/davmail.properties; fi
%%JAVASHAREDIR%%/davmail/lib/slf4j-log4j12-1.3.1.jar
%%JAVASHAREDIR%%/davmail/lib/log4j-1.2.15.jar
%%JAVASHAREDIR%%/davmail/lib/commons-collections-3.1.jar
Index: files/davmail.in
===================================================================
RCS file: files/davmail.in
diff -N files/davmail.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/davmail.in 16 Feb 2011 20:19:20 -0000
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: %%PORTNAME%%
+# REQUIRE: LOGIN
+#
+# Add the following lines to /etc/rc.conf or /etc/rc.conf.local to
+# enable %%PORTNAME%%:
+# %%PORTNAME%%_enable (bool): Set to "NO" by default.
+# %%PORTNAME%%_config (path): Set to
+# "%%PREFIX%%/etc/%%PORTNAME%%.properties"
+# by default
+
+. /etc/rc.subr
+
+name="%%PORTNAME%%"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+: ${%%PORTNAME%%_enable="NO"}
+: ${%%PORTNAME%%_config="%%PREFIX%%/etc/%%PORTNAME%%.properties"}
+
+start_cmd="${name}_start"
+
+procname="java"
+pidfile="/var/run/%%PORTNAME%%.pid"
+required_files=${%%PORTNAME%%_config}
+
+%%PORTNAME%%_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}."
+ for i in %%DATADIR%%/lib/*; do export CLASSPATH=$CLASSPATH:$i; done
+ java -cp %%DATADIR%%/%%PORTNAME%%.jar:$CLASSPATH:%%JAVAJARDIR%%/swt.jar %%PORTNAME%%.DavGateway ${davmail_config} >> /var/log/%%PORTNAME%%-error.log 2>&1 &
+ echo -n $! > ${pidfile}
+}
+
+run_rc_command "$1"
Index: files/davmail.properties.sample
===================================================================
RCS file: files/davmail.properties.sample
diff -N files/davmail.properties.sample
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/davmail.properties.sample 16 Feb 2011 20:19:20 -0000
@@ -0,0 +1,30 @@
+davmail.url=https://--your-exchange-server-uri--/owa
+davmail.popPort=1110
+davmail.imapPort=1143
+davmail.smtpPort=1025
+davmail.caldavPort=1080
+davmail.ldapPort=1389
+davmail.keepDelay=30
+davmail.sentKeepDelay=90
+davmail.caldavPastDelay=90
+davmail.imapIdleDelay=
+davmail.useSystemProxies=false
+davmail.enableProxy=false
+davmail.proxyHost=
+davmail.proxyPort=
+davmail.proxyUser=
+davmail.proxyPassword=
+davmail.ssl.keystoreType=JKS
+davmail.ssl.keyPass=
+davmail.ssl.keystoreFile=
+davmail.ssl.keystorePass=
+davmail.server=true
+davmail.server.certificate.hash=
+davmail.bindAddress=
+davmail.allowRemote=true
+davmail.disableUpdateCheck=false
+log4j.rootLogger=WARN
+log4j.logger.davmail=DEBUG
+log4j.logger.org.apache.commons.httpclient=WARN
+log4j.logger.httpclient.wire=WARN
+davmail.logFilePath=/var/log/davmail.log
Index: files/davmail.sh.in
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/davmail/files/davmail.sh.in,v
retrieving revision 1.1
diff -u -r1.1 davmail.sh.in
--- files/davmail.sh.in 23 Nov 2010 15:58:03 -0000 1.1
+++ files/davmail.sh.in 16 Feb 2011 20:19:20 -0000
@@ -1,4 +1,5 @@
#!/bin/sh
-BASE="%BASE%"
+# $FreeBSD$
+BASE="%%DATADIR%%"
for i in $BASE/lib/*; do export CLASSPATH=$CLASSPATH:$i; done
-java -cp $BASE/davmail.jar:$CLASSPATH:%JAVASHAREDIR%/classes/swt.jar davmail.DavGateway $1
+java -cp $BASE/davmail.jar:$CLASSPATH:%%JAVASHAREDIR%%/classes/swt.jar davmail.DavGateway $1
--- davmail-3.8.8.diff ends here ---
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list