Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2014 19:45:09 +0000 (UTC)
From:      John Marino <marino@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r372810 - in head/www/calendarserver: . files
Message-ID:  <201411191945.sAJJj9RS072585@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marino
Date: Wed Nov 19 19:45:08 2014
New Revision: 372810
URL: https://svnweb.freebsd.org/changeset/ports/372810
QAT: https://qat.redports.org/buildarchive/r372810/

Log:
  www/calendarserver: Fix issues on FreeBSD 10
  
   * fix RC script
   * Limit to python 2
   * update txdav/base/propertystore for FreeBSD 10
   * clean up and remove @dir* (by marino)
  
  PR:		194457
  Submitted by:	holger (freyther.de)
  Final fix:	Axel Rau (maintainer)

Added:
  head/www/calendarserver/files/patch-twext__python__log.py   (contents, props changed)
  head/www/calendarserver/files/patch-txdav__base__propertystore__xattr.py   (contents, props changed)
Deleted:
  head/www/calendarserver/files/patch-twext_python_log.py
Modified:
  head/www/calendarserver/Makefile
  head/www/calendarserver/files/caldavd.in
  head/www/calendarserver/pkg-plist

Modified: head/www/calendarserver/Makefile
==============================================================================
--- head/www/calendarserver/Makefile	Wed Nov 19 19:40:09 2014	(r372809)
+++ head/www/calendarserver/Makefile	Wed Nov 19 19:45:08 2014	(r372810)
@@ -2,7 +2,7 @@
 
 PORTNAME=	calendarserver
 PORTVERSION=	5.1
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	www python
 MASTER_SITES=	LOCAL/wg
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -33,18 +33,25 @@ EXAMPLES_DESC=	Install configuration exa
 DOCS_DESC=	Install additional documentation
 
 NEED_ROOT=	yes
-USES=		shebangfix pgsql:9.0+ python twisted:run,conch,mail,names,runner,web,words
+USES=		shebangfix pgsql:9.0+ python \
+		twisted:run,conch,mail,names,runner,web,words
 USE_PYTHON=	autoplist distutils
 
 SUB_FILES=	pkg-message
 SUB_LIST+=	USER=${USERS}
 
-SHEBANG_FILES=\
-	${WRKSRC}/calendarserver/tools/backup_pg.py \
-	${WRKSRC}/calendarserver/tools/backup.py \
-	${WRKSRC}/twext/python/test/pullpipe.py
+python_OLD_CMD=	/usr/bin/env python
+python_CMD=	${PYTHON_CMD}
+
+SHEBANG_FILES=	bin/calendarserver_* \
+		bin/icalendar_split \
+		bin/proxyclean \
+		calendarserver/tools/backup_pg.py \
+		calendarserver/tools/backup.py \
+		twext/python/test/pullpipe.py
 
 USE_RC_SUBR=	caldavd
+SUB_LIST+=	PYTHON_CMD=${PYTHON_CMD}
 
 SVN_REPOSITORY_URL=	http://svn.calendarserver.org/repository/calendarserver
 SVN_TAG1=	CalendarServer/tags/release/${DISTNAME}
@@ -77,10 +84,8 @@ maint-gen-distfile:
 	fi
 
 post-patch:
-
 	@${REINPLACE_CMD} -e 's|"{number} ({info})".format(number=version_number, info=version_info)|"5.1"|' ${WRKSRC}/setup.py
 	@${REINPLACE_CMD} -e 's|distutils.core|setuptools|g' ${WRKSRC}/setup.py
-	@${REINPLACE_CMD} -e 's|bin/bash|usr/bin/env bash|' ${WRKSRC}/bin/caldavd
 	@${REINPLACE_CMD} -e 's|/usr/bin|${LOCALBASE}/bin|g' ${WRKSRC}/calendarserver/tools/bootstrapdatabase.py
 	@${REINPLACE_CMD} -e 's|"/etc/caldavd/caldavd.plist"|"${ETCDIR}/caldavd.plist"|g' ${WRKSRC}/twistedcaldav/stdconfig.py
 	@${REINPLACE_CMD} -e 's|/usr/share/caldavd/lib/python/txdav/common/datastore|${SHAREDIR}|' ${WRKSRC}/calendarserver/tools/bootstrapdatabase.py
@@ -88,15 +93,17 @@ post-patch:
 
 post-install:
 	@${MKDIR} ${STAGEDIR}${ETCDIR}/auth
-	@${MKDIR} ${STAGEDIR}${ETCDIR}
 	(cd ${WRKSRC}/bin && ${COPYTREE_BIN} . ${STAGEDIR}${PREFIX}/bin)
 	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
 	(cd ${WRKSRC}/conf && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
-	cd ${WRKSRC}/doc && \
-	for i in `ls |${GREP} -v '.8'`; do \
+	(cd ${WRKSRC}/doc && \
+		for i in `ls |${GREP} -v '.8'`; do \
 		${MKDIR} ${STAGEDIR}${DOCSDIR}/$${i} && \
-		${INSTALL_MAN} ${WRKSRC}/doc/$${i}/* ${STAGEDIR}${DOCSDIR}/$${i}; done
-	${CP} -p ${WRKSRC}/txdav/common/datastore/sql_schema/current.sql ${STAGEDIR}${DOCSDIR}
+		${INSTALL_MAN} ${WRKSRC}/doc/$${i}/* \
+		${STAGEDIR}${DOCSDIR}/$${i}; \
+		done)
+	${CP} -p ${WRKSRC}/txdav/common/datastore/sql_schema/current.sql \
+		${STAGEDIR}${DOCSDIR}
 	${INSTALL_MAN} ${WRKSRC}/doc/*.8 ${STAGEDIR}${PREFIX}/man/man8
 
 .include <bsd.port.mk>

Modified: head/www/calendarserver/files/caldavd.in
==============================================================================
--- head/www/calendarserver/files/caldavd.in	Wed Nov 19 19:40:09 2014	(r372809)
+++ head/www/calendarserver/files/caldavd.in	Wed Nov 19 19:45:08 2014	(r372810)
@@ -3,7 +3,7 @@
 # $FreeBSD$
 #
 # PROVIDE: caldavd
-# REQUIRE: DAEMON
+# REQUIRE: LOGIN
 #
 # Add the following lines to /etc/rc.conf to run caldavd:
 #
@@ -20,21 +20,18 @@
 : ${caldavd_enable="NO"}
 : ${caldavd_conf="%%PREFIX%%/etc/caldavd/caldavd.plist"}
 
+
 name="caldavd"
-rcvar=`set_rcvar`
+
 command="%%PREFIX%%/bin/caldavd"
 command_args=" -f ${caldavd_conf} -R kqueue"
 
-extra_commands="reload"
 pidfile="/var/db/${name}/${name}.pid"
-
-
 required_files="${caldavd_conf}"
 
-stop_cmd=" if [ -f ${pidfile} ] ; then kill -TERM `cat ${pidfile}` ; else echo 'Not running.'; fi "
-start_precmd="install -d -o %%USER%% /var/db/caldavd/Data/Documents /var/db/caldavd/Documents && install -d /var/log/caldavd"
-reload_cmd=" if [ -f ${pidfile} ] ; then kill -HUP `cat ${pidfile}` ; else echo 'Not running.'; fi "
-status_cmd=" if [ -f ${pidfile} ] ; then ps -xl `cat ${pidfile}` ; else echo 'Not running.'; fi "
+procname="%%PYTHON_CMD%%"    
+PATH=${PATH}:%%PREFIX%%/bin
+
+start_precmd="install -d -o caldavd /var/db/caldavd/Data/Documents /var/db/caldavd/Documents && install -d /var/log/caldavd"
 
-load_rc_config ${name}
 run_rc_command "$1"

Added: head/www/calendarserver/files/patch-twext__python__log.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/calendarserver/files/patch-twext__python__log.py	Wed Nov 19 19:45:08 2014	(r372810)
@@ -0,0 +1,50 @@
+--- twext/python/log.py.orig	2013-09-17 23:08:55 UTC
++++ twext/python/log.py
+@@ -932,24 +932,29 @@
+         # Don't patch this module
+         if moduleName is __name__:
+             continue
+-
+-        for name, obj in module.__dict__.iteritems():
+-            newLogger = Logger(namespace=module.__name__)
+-            legacyLogger = LegacyLogger(logger=newLogger)
+-
+-            if obj is twisted.python.log:
+-                log.info("Replacing Twisted log module object {0} in {1}"
+-                         .format(name, module.__name__))
+-                setattr(module, name, legacyLogger)
+-            elif obj is twisted.python.log.msg:
+-                log.info("Replacing Twisted log.msg object {0} in {1}"
+-                         .format(name, module.__name__))
+-                setattr(module, name, legacyLogger.msg)
+-            elif obj is twisted.python.log.err:
+-                log.info("Replacing Twisted log.err object {0} in {1}"
+-                         .format(name, module.__name__))
+-                setattr(module, name, legacyLogger.err)
+-
++    
++        try:
++            for name, obj in module.__dict__.iteritems():
++                newLogger = Logger(namespace=module.__name__)
++                legacyLogger = LegacyLogger(logger=newLogger)
++    
++                if obj is twisted.python.log:
++                    log.info("Replacing Twisted log module object {0} in {1}"
++                             .format(name, module.__name__))
++                    setattr(module, name, legacyLogger)
++                elif obj is twisted.python.log.msg:
++                    log.info("Replacing Twisted log.msg object {0} in {1}"
++                             .format(name, module.__name__))
++                    setattr(module, name, legacyLogger.msg)
++                elif obj is twisted.python.log.err:
++                    log.info("Replacing Twisted log.err object {0} in {1}"
++                             .format(name, module.__name__))
++                    setattr(module, name, legacyLogger.err)
++        except (AttributeError, RuntimeError,):
++            # Can't look up __name__.  A hack in the "six" module causes
++            # this.  Skip the module.
++            # See https://trac.calendarserver.org/ticket/832
++            continue
+ 
+ 
+ ######################################################################

Added: head/www/calendarserver/files/patch-txdav__base__propertystore__xattr.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/calendarserver/files/patch-txdav__base__propertystore__xattr.py	Wed Nov 19 19:45:08 2014	(r372810)
@@ -0,0 +1,20 @@
+--- txdav/base/propertystore/xattr.py.orig	2013-05-30 01:18:39 UTC
++++ txdav/base/propertystore/xattr.py
+@@ -47,10 +47,14 @@
+ # expose.  Its value is 93.
+ #
+ 
+-if sys.platform in ("darwin", "freebsd8", "freebsd9"):
+-    _ERRNO_NO_ATTR = getattr(errno, "ENOATTR", 93)
+-else:
++_ERRNO_NO_ATTR = 0
++try:
+     _ERRNO_NO_ATTR = errno.ENODATA
++except AttributeError:
++    if sys.platform[:6] == 'darwin' or sys.platform[:7] == 'freebsd':
++        _ERRNO_NO_ATTR = getattr(errno, "ENOATTR", 93)
++    else:
++        raise
+ 
+ 
+ 

Modified: head/www/calendarserver/pkg-plist
==============================================================================
--- head/www/calendarserver/pkg-plist	Wed Nov 19 19:40:09 2014	(r372809)
+++ head/www/calendarserver/pkg-plist	Wed Nov 19 19:45:08 2014	(r372810)
@@ -119,15 +119,3 @@ man/man8/calendarserver_shell.8.gz
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/servertoserver.dtd
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/sudoers.plist
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/test/accounts.xml
-%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/test
-%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/resources
-%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%/auth
-%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%%
-%%PORTDOCS%%@dirrmtry %%DOCSDIR%%/RFC
-%%PORTDOCS%%@dirrmtry %%DOCSDIR%%/Extensions
-%%PORTDOCS%%@dirrmtry %%DOCSDIR%%/Developer
-%%PORTDOCS%%@dirrmtry %%DOCSDIR%%/Client-Server
-%%PORTDOCS%%@dirrmtry %%DOCSDIR%%/Admin
-%%PORTDOCS%%@dirrm %%DOCSDIR%%
-@dirrmtry etc/caldavd/auth
-@dirrmtry etc/caldavd



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411191945.sAJJj9RS072585>