--- calendarserver-2.4.dfsg.orig/debian/calendarserver-doc-api.docs +++ calendarserver-2.4.dfsg/debian/calendarserver-doc-api.docs @@ -0,0 +1 @@ +#doc/apidocs --- calendarserver-2.4.dfsg.orig/debian/calendarserver.manpages +++ calendarserver-2.4.dfsg/debian/calendarserver.manpages @@ -0,0 +1,4 @@ +doc/caldavd.8 +doc/caladmin.8 +doc/calendarserver_export.8 +doc/calendarserver_manage_principals.8 --- calendarserver-2.4.dfsg.orig/debian/copyright +++ calendarserver-2.4.dfsg/debian/copyright @@ -0,0 +1,41 @@ +This package was debianized by Guido Guenther on +Sun, 27 Aug 2006 19:53:15 +0200. + +It was downloaded from http://trac.calendarserver.org/browser/CalendarServer + +Upstream Author: Cyrus Daboo + +Copyright: 2006 Apple Computer, Inc. All rights reserved. + +License: + +You are free to distribute this software under the terms of the Apache License +2.0. The full text of this license can be found in the file +/usr/share/common-licenses/Apache-2.0. + +Except for bin/xattr which is: + +## +# Copyright (c) 2007 Apple Inc. +# +# This is the MIT license. This software may also be distributed under the +# same terms as Python (the PSF license). +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +## --- calendarserver-2.4.dfsg.orig/debian/calendarserver.postinst +++ calendarserver-2.4.dfsg/debian/calendarserver.postinst @@ -0,0 +1,70 @@ +#!/bin/sh +# postinst script for calendarserver +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# + +case "$1" in + configure) + if ! getent passwd caldavd >/dev/null 2>&1; then + adduser --system --home /var/spool/caldavd --no-create-home \ + --gecos "calendarserver daemon" --group --disabled-password \ + caldavd + fi + adduser caldavd ssl-cert + + for dir in spool run log; do + if [ ! -d /var/$dir/caldavd ]; then + mkdir -p /var/$dir/caldavd + fi + if ! dpkg-statoverride --list /var/$dir/caldavd >/dev/null 2>&1; then + chown caldavd: /var/$dir/caldavd + fi + done + + for file in calendaruserproxy.sqlite resourceinfo.sqlite; do + if [ ! -f /var/run/caldavd/$file ]; then + touch /var/run/caldavd/$file + fi + if ! dpkg-statoverride --list /var/run/caldavd/$file >/dev/null 2>&1; then + chown caldavd: /var/run/caldavd/$file + fi + done + + # Upgrade NSS users and groups data directories + if [ -f /etc/caldavd/caldavd.plist.upgrade.nss.tmp ]; then + python /usr/share/doc/calendarserver/scripts/upgrade-nss-data-directories.py + rm -f /etc/caldavd/caldavd.plist.upgrade.nss.tmp + fi + ;; + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- calendarserver-2.4.dfsg.orig/debian/calendarserver.dirs +++ calendarserver-2.4.dfsg/debian/calendarserver.dirs @@ -0,0 +1,3 @@ +/var/log/caldavd +/var/run/caldavd +/var/spool/caldavd --- calendarserver-2.4.dfsg.orig/debian/TODO +++ calendarserver-2.4.dfsg/debian/TODO @@ -0,0 +1,2 @@ +* fix apidoc build +* push pydirector patches upstream --- calendarserver-2.4.dfsg.orig/debian/control +++ calendarserver-2.4.dfsg/debian/control @@ -0,0 +1,24 @@ +Source: calendarserver +Section: python +Priority: optional +Maintainer: Rahul Amaram +Build-Depends: cdbs (>= 0.4.43), debhelper (>= 5), quilt, python, python-central +Standards-Version: 3.9.1 +Homepage: http://calendarserver.org +XS-Python-Version: >= 2.5 + +Package: calendarserver +Architecture: all +Depends: ${python:Depends}, ${misc:Depends}, python-plist, + python-kerberos (>= 1.1+svn4241), python-pysqlite2, python-openssl, + python-vobject (>= 0.8.1c), python-twisted-calendarserver (>= 8.2.0.svn27622), + python-dateutil (>= 1.2), + python-xattr, + ssl-cert, adduser, lsb-base (>= 3.0-10), memcached (>=1.2.6) +Recommends: python-pydirector, python-ldap +XB-Python-Version: ${python:Versions} +Description: Apple's Calendar Server + Apple's Calendarserver is a standalone caldav server with: + * Basic or Kerberos Authentication + * support for shared calendars + --- calendarserver-2.4.dfsg.orig/debian/calendarserver.docs +++ calendarserver-2.4.dfsg/debian/calendarserver.docs @@ -0,0 +1 @@ +README --- calendarserver-2.4.dfsg.orig/debian/calendarserver.preinst +++ calendarserver-2.4.dfsg/debian/calendarserver.preinst @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +# Backup configuration file for upgrading NSS users and groups data directories in postinst +if [ \( "$1" = "install" -o "$1" = "upgrade" \) -a "`echo $2 | cut -d - -f 1`" = "1.2.dfsg" ]; then + if [ -f /etc/caldavd/caldavd.plist -a ! -e /etc/caldavd/caldavd.plist.upgrade.nss.tmp ]; then + cp -a /etc/caldavd/caldavd.plist /etc/caldavd/caldavd.plist.upgrade.nss.tmp + fi +fi + +#DEBHELPER# --- calendarserver-2.4.dfsg.orig/debian/changelog +++ calendarserver-2.4.dfsg/debian/changelog @@ -0,0 +1,315 @@ +calendarserver (2.4.dfsg-5) unstable; urgency=high + + * Backing up configuration file in calendarserver.preinst was happening + only during upgrade. This has been modified to happen during install as + well where the configuration file had not been purged during the previous + uninstallation. + + -- Rahul Amaram Wed, 19 Jan 2011 14:24:14 +0530 + +calendarserver (2.4.dfsg-4) unstable; urgency=high + + * Moved the code for upgrading data directories of NSS users and groups + into a separate file and executing this file from postinst as it cannot + be assumed that python would be configured when preinst is called + (inspite of adding python to Pre-Depends) + * Moved ${python:Depends} and python-plist from Pre-Depends to Depends + + -- Rahul Amaram Fri, 31 Dec 2010 14:58:23 +0530 + +calendarserver (2.4.dfsg-3) unstable; urgency=low + + * Added calendarserver.preinst script for moving data directories of NSS users + and groups + * Moved ${python:Depends} from Depends to Pre-Depends. Added python-plist to + Pre-Depends. + * Added python-ldap as recommended package (Closes: #600799) + * Moved python-pydirector from suggested package to recommended package + * Added information about disabling of group calendaring in calendarserver 2.x + in NEWS (Closes: #600999) + + -- Rahul Amaram Fri, 17 Dec 2010 00:00:00 +0530 + +calendarserver (2.4.dfsg-2.1) unstable; urgency=high + + * Non-maintainer upload. + * Do not set PYTHONPATH env var, not needed (Closes: #605166, #605157) + * Prevent setup.py from automagically setting #PYTHONPATH in an insecure way + + -- Dmitrijs Ledkovs Fri, 03 Dec 2010 21:28:40 +0000 + +calendarserver (2.4.dfsg-2) unstable; urgency=low + + * Removed Uploaders field in debian/changelog + * Changed build dependency python-dev to python + * Updated standards version to 3.9.1 + * $remote_fs dependency has been added in init.d + * Added NSS directory service backend + * Added sample configuration for LDAP directory backend + * Added PAM configuration file + + -- Rahul Amaram Wed, 25 Aug 2010 15:23:37 +0530 + +calendarserver (2.4.dfsg-1) experimental; urgency=low + + * New upstream release (Closes: #579610) + * add LDAP directory backend + * remove NSS directory backend (will be added soon) + * add patch for linux xattr fix. Related Calendarserver ticket: + http://trac.calendarserver.org/ticket/337 + + -- Rahul Amaram Wed, 28 Jul 2010 13:57:56 +0530 + +calendarserver (1.2.dfsg-9) unstable; urgency=low + + [ Guido Günther ] + * [e933bae] Orphan package + * [aa801ee] use lower case http in the principals name since this is + what iCal expects. clients don't break. (Closes: #514931) - thanks + to Arthur P Prokosch for pointing this out and testing that other + * [2de5e32] We need both principals in the servers's keytab. (Closes: + #514931) + + [ Christoph Goehre ] + * [080f99a] remove package depends 'python-xml' python-xml was merged into + the python core package and removed from unstable on 16th August 2009 + + -- Guido Günther Sun, 16 May 2010 15:15:51 +0200 + +calendarserver (1.2.dfsg-8) unstable; urgency=low + + * [8b63fa5] fix basic auth via apache directoryService (Closes: + #503727) - thanks to Thomas Viehmann for the patch + * [a9f92f3] minor fix: tabs vs. spaces + + -- Guido Günther Thu, 06 Nov 2008 09:57:56 +0100 + +calendarserver (1.2.dfsg-7) experimental; urgency=low + + * [972f1c3] add more info about the name service switch backend and + warn about ldap server search limits (Closes: #499963) + * [45cc01f] add Ticket207-2.patch fixes "Events more than 356 days + from creation are ignored" (Closes: #489188) - Patch by Peter Mogensen + + -- Guido Guenther Thu, 02 Oct 2008 13:18:01 +0200 + +calendarserver (1.2.dfsg-6) unstable; urgency=low + + * [cf51d29] allow dh_installinit to start/stop the daemon + * [f2450f8] don't start calendarserver by default + * [67f428c] don't fail when trying to stop a not running daemon + * [b3386ab] bump standards version + * [da9254c] add README.source + + -- Guido Guenther Fri, 08 Aug 2008 11:58:23 +0200 + +calendarserver (1.2.dfsg-5) unstable; urgency=low + + * [b52ad1f] remove dependency on python-plistlib, it's included in included + in python2.5 and in Debian's python2.4 + + -- Guido Guenther Fri, 08 Aug 2008 10:36:43 +0200 + +calendarserver (1.2.dfsg-4) unstable; urgency=low + + * [41eff3c] nss backend: use shortname for groups and users. The groupPrefix + makes sure these don't overlap. This way we don't have to use random uids + for the calendars on disk which makes administration a lot easier. + * [1d6701b] depend on python-openssl instead of the transitional + package python-pyopenssl + * [d90a173] refer to /usr/share/common-licenses/Apache-2.0 instead of + shipping the whole license + * [1937567] update upstream URL + + -- Guido Guenther Sun, 22 Jun 2008 21:05:39 +0200 + +calendarserver (1.2.dfsg-3) unstable; urgency=low + + [ Guido Guenther ] + * upload to unstable - we no longer conflict on twisted + * [31d2b55] drop dependency on ctypes - it's already included in python2.5 + * [652da62] Mention XFS (Closes: #483987) - thanks to Peter Mann + * [29edb85] add Homepage: + * [0c5bcee] redirect stderr to /dev/null on daemon restart This is a + temporary workaround until the twisted deprecation warnings got + fixed. + + [ Noel Köthe ] + * [1c03474] xs- prefix from Vcs fields + + -- Guido Guenther Thu, 19 Jun 2008 17:05:15 +0200 + +calendarserver (1.2.dfsg-2) experimental; urgency=low + + [ Guido Guenther ] + * fix epydoc errors + * use a python-twisted-calendarserver that doesn't ship the whole twisted + + [ Noel Köthe ] + * bind the caldavd only to localhost as described in README.Debian + + -- Guido Guenther Mon, 05 May 2008 17:28:58 +0200 + +calendarserver (1.2.dfsg-1) unstable; urgency=low + + [ Guido Guenther ] + * New upstream 1.2 + * add NSS directory backend + * bump python-twisted-calendarserver dependency to one that has the patches + for 1.2 + * README.Debian: use non SSL port + + [ Noel Köthe ] + * README.Debian: + * s/sudoers.xml/sudoers.plist/ + * correcting path + * update TODO + + -- Guido Guenther Sun, 27 Apr 2008 10:36:57 +0200 + +calendarserver (1.2.dfsg~dev020221-5) unstable; urgency=low + + * first upload to unstable + * tighten dependencies and drop suggests superflous suggests + * switch to Python 2.5 + * README.Debian: add URI for group calendars + + -- Guido Guenther Sun, 20 Apr 2008 13:59:04 +0200 + +calendarserver (1.2.dfsg~dev020221-4) experimental; urgency=low + + * update README.Debian on SPNEGO/Kerberos + * fix snakeoil certificate paths + + -- Guido Guenther Sun, 16 Mar 2008 12:48:34 +0100 + +calendarserver (1.2.dfsg~dev020221-3) experimental; urgency=low + + * repackage upstream branch and remove RFCs too make the document dfsg clean + * add license of bin/xattr + + -- Guido Guenther Wed, 27 Feb 2008 10:31:48 +0100 + +calendarserver (1.2~dev020221-2) experimental; urgency=low + + * disable the api-doc generation until it works with newer epydoc + + -- Guido Guenther Tue, 26 Feb 2008 11:01:00 +0100 + +calendarserver (1.2~dev020221-1) experimental; urgency=low + + * first upload to experimental (Closes: #384644) + * switch to upstreams 1.2 development branch + * drop krb5 patch, applied upstream + * refreh paths.diff + * README.Debian: add calendar URI + * depend on renamed python-twisted-calendarserver package + + -- Guido Guenther Thu, 21 Feb 2008 17:54:56 +0100 + +calendarserver (0.0.svn1755-1) experimental; urgency=low + + * UNRELEASED + * New Upstream SVN Snapshot + * update dependencies + * drop opendirectory-dummy.patch, not needed anymore, can be disabled via + the config file + * drop caldavd-kerberos.patch, not needed anymore. Kerberos can be enabled + via config file now + * update paths.diff to new layout and config options + * new fix-krb-service.diff: fix kerberos service names + * calendarserver.init: daemon switches users itself, new commandline options + * set process count to avoid pydirector for now + + -- Guido Guenther Thu, 09 Aug 2007 10:24:46 +0200 + +calendarserver (0.0.svn209-2) calendarserver; urgency=low + + * create /var/run/caldavd (needed inc ase /var/run is on a tmpfs) + * drop dependencies on python-dateutil and python-zopeinterface since + these are indirect dependencies of python-vobject and + twisted-calendarserver respectively. + * build the api documentation + + -- Guido Guenther Mon, 2 Oct 2006 11:03:27 +0200 + +calendarserver (0.0.svn209-1) calendarserver; urgency=low + + * New Upstream Version + * depend on newer pykerberos + * depend on newer twisted-calendarserver + + -- Guido Guenther Wed, 27 Sep 2006 12:34:28 +0200 + +calendarserver (0.0.svn197-1) calendarserver; urgency=low + + * New Upstream Version + * depend on newer twisted + * twiddle path patch to apply again + + -- Guido Guenther Tue, 26 Sep 2006 10:21:00 +0200 + +calendarserver (0.0.svn188-1) unstable; urgency=low + + * New upstream version 0.0.svn188 + * bump dependencies on python-vobject + * depend on python-xml + * adjust patch path to look for twisted unter /usr/lib/caldavd + since we ship our own twisted version in this subdir now. This way + we don't have to conflict with the twisted shipped in Debian. + * depend on twisted-calendarserver (which was formerly + python-twisted-acl-branch) + + -- Guido Guenther Mon, 25 Sep 2006 18:33:19 +0200 + +calendarserver (0.0.svn142-3) unstable; urgency=low + + * add a sample diff for kerberos authentication + + -- Guido Guenther Tue, 19 Sep 2006 10:06:53 +0200 + +calendarserver (0.0.svn142-2) unstable; urgency=low + + * depend on python-plistlib + + -- Guido Guenther Mon, 18 Sep 2006 19:54:24 +0200 + +calendarserver (0.0.svn142-1) unstable; urgency=low + + * new SVN version (only patches merged into twisted) + * depend on more recent twisted-acl-branch + + -- Guido Guenther Mon, 18 Sep 2006 17:06:15 +0200 + +calendarserver (0.0.svn135-2) unstable; urgency=low + + * really drop upstream-patches/ + * fix restart target in init script, use LSB logging + * add LSB header + + -- Guido Guenther Mon, 18 Sep 2006 16:00:45 +0200 + +calendarserver (0.0.svn135-1) unstable; urgency=low + + * New upstream svn version + * no need to rename patches to upstream-patches, upstream changed that to + lib-patches + * depend on newer twisted-acl-branch and newer pykerberos + * remove superflous heimdal-dev from build-depends + * dropped patches (applied upstream): + * bashism + * move-patch-dir + * linux-xattr + * use snake-oil certificates for SSL + + -- Guido Guenther Fri, 15 Sep 2006 18:38:10 +0200 + +calendarserver (0.0.svn62-1) unstable; urgency=low + + * Initial release + * Add dummies for OpenDirectory interaction from: + http://svn.macosforge.org/projects/calendarserver/browser/PyOpenDirectory + until we have a proper port + + -- Guido Guenther Wed, 6 Sep 2006 13:45:40 +0200 + --- calendarserver-2.4.dfsg.orig/debian/calendarserver.default +++ calendarserver-2.4.dfsg/debian/calendarserver.default @@ -0,0 +1,8 @@ +# Defaults for calendarserver initscript (/etc/init.d/calendarserver) +# This is a POSIX shell fragment + +# uncomment to start calendarserver on system startup +#start_calendarserver=yes + +# options to pass to calendarserver on startup +#DAEMON_OPTS="" --- calendarserver-2.4.dfsg.orig/debian/calendarserver.examples +++ calendarserver-2.4.dfsg/debian/calendarserver.examples @@ -0,0 +1,5 @@ +conf/caldavd.plist +conf/sudoers.plist +conf/auth/accounts.xml +conf/auth/accounts.htauth +conf/auth/accounts.htdigest --- calendarserver-2.4.dfsg.orig/debian/pycompat +++ calendarserver-2.4.dfsg/debian/pycompat @@ -0,0 +1 @@ +2 --- calendarserver-2.4.dfsg.orig/debian/README.Debian +++ calendarserver-2.4.dfsg/debian/README.Debian @@ -0,0 +1,123 @@ +calendar server for Debian +========================== + +Basic Setup +=========== +Since calendarserver uses extended attributes you must mount the filesystem +that contains the calendars (/var/spool/caldavd by default) with extended +attributes enabled. On ext2/ext3 filesystems use the user_xattr mount option, +XFS has extended attributes enabled by default. + +You have to add a /etc/caldavd/accounts.xml to tell caldavd about your accounts +and users. See /usr/share/doc/calendarserver/examples/accounts.xml for an +example. Likewise you have to add a /etc/caldavd/sudoers.plist. Both files have +to be present, otherwise the calendarserver will not work. + +By default calendarserver listens on localhost only so the URI to your caldav +calendar will typically look like: + + http://localhost:8008/calendars/users//calendar/ + +where is the username of a calendarserver user as specified in +accounts.xml. And for groups defined in accounts.xml it's: + + http://localhost:8008/calendars/groups//calendar/ + + +Loadbalancing +============= +In order to enable laod balancing onto different processors/cores you need to +install python-pydirecotor and set the ProcessCount in +/etc/caldavd/caldavd.plist accordingly. + + +Enabling SPNEGO/Kerberos +======================== + +To make SPNEGO/Kerberos authentication work you have to add service principals +for HTTP/caldavd.example.com@EXAMPLE.COM and +http/caldavd.example.com@EXAMPLE.COM to your servers keytab /etc/krb5.keytab +(replace caldavd.example.com by the fqdn of your caldav server and EXAMPLE.COM +by your Kerberos realm). +The uppercase http variant is used by most clients like iceowl and icedove with +iceowl-extension while the lowercase version is used by iCal. The keytab must +be readable for user caldavd which can be achieved by: + +chgrp caldavd /etc/krb5.keytab +chmod 0640 /etc/krb5.keytab + +Now you have to specify the name of a ServicePrincipal in +/etc/caldavd/caldavd.plist: + + + Kerberos + + Enabled + + ServicePrincipal + http/caldavd.example.com@EXAMPLE.COM + + +Note: if you use iceowl/iceowl-extension the +network.negotiate-auth.trusted-uris in iceowl/icedove must match on your +calendarservers uri otherwise SPNEGO will not work. A good choice is +"https://". + + +Nameservice Switch Backend +========================== +If you don't want to manage accounts in a separate XML file you can use the +names service switch backend. Details on how to set this up can be found at: + +http://honk.sigxcpu.org/con/Apple_Calendarser_with_Name_Service_Switch_directory_backend.html + +Note that in order to function properly "getent passwd" must list all users +that should be able to access the calendarserver. This might not be the case if +you hit the search limit of your LDAP server. + +Also note that the username and groupname (without the prefix) shouldn't be the same else +calendarserver might get confused. + +PAM authentication is supported. The pam service name is "caldav". Basic Authentication should +be enabled and Digest Authentication should be disabled for PAM authentication to work. It is +suggested to use PAM authentication in conjunction with SSL (https) so that the password is not +sent in plain text. For PAM authentication against local unix passwords, the user "caldavd" +should be added to the "shadow" group. + + -- Guido Guenther Thu, 30 Apr 2008 16:17:56 +0100 + + +LDAP Directory Backend +====================== +Details of LDAP Directory backend can be found at: + +http://trac.calendarserver.org/ticket/260 + +Possible authentication methods are "LDAP" (default) and "PAM". The pam service name is "caldav". +For PAM/LDAP authentication, Basic Authentication should be enabled and Digest Authentication should +be disabled (as shown below). It is suggested to use PAM/LDAP authentication in conjunction with +SSL (https) so that the password is not sent in plain text. For PAM authentication against local +unix passwords, the user "caldavd" should be added to the "shadow" group. + + + Basic + + Enabled + + + + + Digest + + Enabled + + Algorithm + md5 + Qop + + + +For ldap anonymous binding, the dn and password entries should be present in the configuration file +but their values should be empty. + + -- Rahul Amaram Tue, 24 Aug 2010 22:05:00 +0530 --- calendarserver-2.4.dfsg.orig/debian/NEWS +++ calendarserver-2.4.dfsg/debian/NEWS @@ -0,0 +1,7 @@ +calendarserver (2.4.dfsg-3) unstable; urgency=low + + * Group calendaring has been disabled in calendarserver 2.x. For more information + on this, see http://trac.calendarserver.org/ticket/330. + + -- Rahul Amaram Fri, 17 Dec 2010 00:00:00 +0530 + --- calendarserver-2.4.dfsg.orig/debian/calendarserver.init.d +++ calendarserver-2.4.dfsg/debian/calendarserver.init.d @@ -0,0 +1,97 @@ +#! /bin/sh +# +# calendarserver startup script +# +### BEGIN INIT INFO +# Provides: caldavserver +# Required-Start: $remote_fs $network +# Required-Stop: $remote_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: CalDAV Calendarserver +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/bin/caldavd +NAME=caldavd +DESC=calendarserver +RUNDIR=/var/run/caldavd/ +SPOOLDIR=/var/spool/caldavd/ + +test -x $DAEMON || exit 0 + +# Include calendarserver defaults if available +if [ -f /etc/default/calendarserver ] ; then + . /etc/default/calendarserver +fi + +. /lib/lsb/init-functions + +set -e + +check_start_daemon() { + if [ ! "$start_calendarserver" = "yes" ]; then + log_warning_msg "Not starting calendarserver, disabled via /etc/default/calendarserver" + return 1 + else + return 0 + fi +} + +case "$1" in + start) + if check_start_daemon; then + log_daemon_msg "Starting $DESC" "$NAME" + mkdir -p $RUNDIR + chown --reference=$SPOOLDIR $RUNDIR + if start-stop-daemon --start --quiet --pidfile $RUNDIR$NAME.pid \ + --exec $DAEMON -- $DAEMON_OPTS 2>/dev/null; then + log_end_msg 0 + RET=0 + else + log_end_msg 1 + RET=1 + fi + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + if start-stop-daemon --oknodo --stop --quiet --pidfile $RUNDIR$NAME.pid \ + --exec /usr/bin/python; then + log_end_msg 0 + RET=0 + else + log_end_msg 1 + RET=1 + fi + ;; + restart|force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + if check_start_daemon; then + log_daemon_msg "Restarting $DESC" "$NAME" + start-stop-daemon --stop --quiet --oknodo --pidfile \ + $RUNDIR$NAME.pid --exec /usr/bin/python + sleep 1 + if start-stop-daemon --start --quiet --pidfile \ + $RUNDIR$NAME.pid --exec $DAEMON -- $DAEMON_OPTS 2>/dev/null; then + log_end_msg 0 + RET=0 + else + log_end_msg 1 + RET=1 + fi + fi + ;; + *) + N=/etc/init.d/$NAME + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit $RET --- calendarserver-2.4.dfsg.orig/debian/compat +++ calendarserver-2.4.dfsg/debian/compat @@ -0,0 +1 @@ +5 --- calendarserver-2.4.dfsg.orig/debian/pyversions +++ calendarserver-2.4.dfsg/debian/pyversions @@ -0,0 +1 @@ +2.5- --- calendarserver-2.4.dfsg.orig/debian/rules +++ calendarserver-2.4.dfsg/debian/rules @@ -0,0 +1,30 @@ +#!/usr/bin/make -f + +DEB_PYTHON_SYSTEM = pycentral + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/python-distutils.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + +DEB_DESTDIR = $(CURDIR)/debian/calendarserver +DEB_DH_INSTALLPAM_ARGS := --name=caldav + +calendarserver-doc-api-stamp: + #cd doc/Developer && pydoctor -c twistedcaldav.cfg --resolve-aliases --make-html + touch calendarserver-doc-api-stamp + +build/calendarserver-doc-api:: calendarserver-doc-api-stamp + +install/calendarserver:: + rm -rf $(DEB_DESTDIR) + set -e; for buildver in $(cdbs_python_build_versions); do \ + cd $(CURDIR) && cd $(DEB_SRCDIR) && python$$buildver setup.py install --root=$(DEB_DESTDIR) --install-purelib=/usr/lib/twisted-calendarserver/lib/python$$buildver/site-packages/ --install-platlib=/usr/lib/twisted-calendarserver/lib/python$$buildver/site-packages/ $(DEB_PYTHON_INSTALL_ARGS_ALL); \ + done + +binary-fixup/calendarserver:: + install -D -m 0755 -p -o root -g root $(CURDIR)/debian/upgrade-nss-data-directories.py $(DEB_DESTDIR)/usr/share/doc/calendarserver/scripts/upgrade-nss-data-directories.py + +clean:: + -rm twistedcaldav/version.py + -rm -rf doc/Developer/apidocs calendarserver-doc-api-stamp + --- calendarserver-2.4.dfsg.orig/debian/calendarserver.TODO +++ calendarserver-2.4.dfsg/debian/calendarserver.TODO @@ -0,0 +1,2 @@ + + --- calendarserver-2.4.dfsg.orig/debian/calendarserver.caldav.pam +++ calendarserver-2.4.dfsg/debian/calendarserver.caldav.pam @@ -0,0 +1,6 @@ +#%PAM-1.0 + +@include common-auth +@include common-account +@include common-session + --- calendarserver-2.4.dfsg.orig/debian/README.source +++ calendarserver-2.4.dfsg/debian/README.source @@ -0,0 +1,57 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +To configure quilt to use debian/patches instead of patches, you want +either to export QUILT_PATCHES=debian/patches in your environment +or use this snippet in your ~/.quiltrc: + + for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do + if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then + export QUILT_PATCHES=debian/patches + fi + done + +To get the fully patched source after unpacking the source package, cd to +the root level of the source package and run: + + quilt push -a + +The last patch listed in debian/patches/series will become the current +patch. + +To add a new set of changes, first run quilt push -a, and then run: + + quilt new + +where is a descriptive name for the patch, used as the filename in +debian/patches. Then, for every file that will be modified by this patch, +run: + + quilt add + +before editing those files. You must tell quilt with quilt add what files +will be part of the patch before making changes or quilt will not work +properly. After editing the files, run: + + quilt refresh + +to save the results as a patch. + +Alternately, if you already have an external patch and you just want to +add it to the build system, run quilt push -a and then: + + quilt import -P /path/to/patch + quilt push -a + +(add -p 0 to quilt import if needed). as above is the filename to +use in debian/patches. The last quilt push -a will apply the patch to +make sure it works properly. + +To remove an existing patch from the list of patches that will be applied, +run: + + quilt delete + +You may need to run quilt pop -a to unapply patches first before running +this command. --- calendarserver-2.4.dfsg.orig/debian/upgrade-nss-data-directories.py +++ calendarserver-2.4.dfsg/debian/upgrade-nss-data-directories.py @@ -0,0 +1,158 @@ +#!/usr/bin/python + +import os +import shutil +import pwd +import grp +import plistlib +import copy +import StringIO +from uuid import UUID, uuid5 + + +def main(): + + # Init params + defaultConfigFile = "/etc/caldavd/caldavd.plist.upgrade.nss.tmp" + defaultConfig = { + "DirectoryService": { + "type": "twistedcaldav.directory.xmlfile.XMLDirectoryService", + }, + "DocumentRoot": "/Library/CalendarServer/Documents", + } + serviceDefaultParams = { + "twistedcaldav.directory.nss.NssDirectoryService": { + "realmName": "Test Realm", + "groupPrefix": "caldavd-", + "firstValidUid": 1000, + "lastValidUid": 65533, + "firstValidGid": 1000, + "lastValidGid": 65533, + } + } + recordType_users = "users" + recordType_groups = "groups" + nssServiceBaseGUID = "8EFFFAF1-5221-4813-B971-58506B963573" + + # Function to generate uuid from name + def uuidFromName(namespace, name): + """ + Generate a version 5 (SHA-1) UUID from a namespace UUID and a name. + See http://www.ietf.org/rfc/rfc4122.txt, section 4.3. + @param namespace: a UUID denoting the namespace of the generated UUID. + @param name: a byte string to generate the UUID from. + """ + # We don't want Unicode here; convert to UTF-8 + if type(name) is unicode: + name = name.encode("utf-8") + + return str(uuid5(UUID(namespace), name)) + + # Function to update config + def _update_config(configElement, defaultConfigElement): + for key, value in defaultConfigElement.iteritems(): + if key not in configElement: + configElement[key] = copy.deepcopy(value) + elif isinstance(configElement[key], dict) and \ + isinstance(value, dict): + _update_config(configElement[key], value) + + + # Function to move individual user/group directory + def _move_directory(nssServiceGUID, documentRoot, recordType, shortName): + guid = uuidFromName(nssServiceGUID, "%s:%s" % (recordType, shortName)) + olddir = os.path.join(documentRoot, "calendars", "__uids__", shortName) + newdir = os.path.join(documentRoot, "calendars", "__uids__", guid) + print "Moving directory for %s '%s' (GUID: %s) ..." % \ + (recordType[:-1], shortName, guid) + if (not os.path.isdir(olddir)): + print "Old data directory '%s' does not exist. Nothing to move." % \ + (olddir) + return + if (os.path.isdir(newdir)): + print "New data directory '%s' already exists. Aborting move." % \ + (newdir) + return + shutil.move(olddir, newdir) + print "Data directory successfully moved from '%s' to '%s'." % \ + (olddir, newdir) + + # Begin + print ("Moving caldavd directories of NSS users and groups as the " + "directory names in calendarserver 2.x are based on UUID " + "rather than username/groupname as in calendarserver 1.x ...\n") + + # Check if config file exists. + if not os.path.isfile(defaultConfigFile): + print "Caldavd config file %s does not exist. Exiting." % \ + (defaultConfigFile) + return + + # Load configuration file + configPlist = plistlib.readPlist(defaultConfigFile) + + # Update default configuration + s = StringIO.StringIO() + plistlib.writePlist(defaultConfig, s) + defaultConfigPlist = plistlib.readPlistFromString(s.getvalue()) + _update_config(configPlist, defaultConfigPlist) + + # If NSS is not the default directory service, exit + if configPlist.DirectoryService.type != \ + "twistedcaldav.directory.nss.NssDirectoryService": + print "Directory service NssDirectoryService is not configured in " \ + "%s. Exiting." % (defaultConfigFile) + return + + # Update with service default params + s = StringIO.StringIO() + plistlib.writePlist( + {"params": serviceDefaultParams[ + "twistedcaldav.directory.nss.NssDirectoryService"]}, + s + ) + nssServiceDefaultParamsPlist = plistlib.readPlistFromString(s.getvalue()) + _update_config(configPlist.DirectoryService, nssServiceDefaultParamsPlist) + + # Generate serviceGUID + nssServiceGUID = uuidFromName( + nssServiceBaseGUID, + configPlist.DirectoryService.params.realmName + ) + print "NSS Directory Service GUID - %s\n" % (nssServiceGUID) + + # Move users' data directories + print "Moving data directories of users ..." + users = pwd.getpwall() + for user in users: + if user[2] >= configPlist.DirectoryService.params.firstValidUid and \ + user[2] <= configPlist.DirectoryService.params.lastValidUid: + _move_directory( + nssServiceGUID, + configPlist.DocumentRoot, + recordType_users, + user[0] + ) + print + + # Move groups' data directories + print "Moving data directories of groups ..." + groups = grp.getgrall() + for group in groups: + if group[2] >= configPlist.DirectoryService.params.firstValidGid and \ + group[2] <= configPlist.DirectoryService.params.lastValidGid and \ + group[0].startswith(configPlist.DirectoryService.params.groupPrefix): + _move_directory( + nssServiceGUID, + configPlist.DocumentRoot, + recordType_groups, + group[0].replace( + configPlist.DirectoryService.params.groupPrefix,'',1 + ) + ) + print + + +if __name__ == "__main__": + main() + --- calendarserver-2.4.dfsg.orig/debian/patches/secure-python-path.patch +++ calendarserver-2.4.dfsg/debian/patches/secure-python-path.patch @@ -0,0 +1,64 @@ +Removes setting PYTHONPATH in an insecure way, not needed on Debian. +Removes "rewritting" rules from setup.py that did that. +Index: b/setup.py +=================================================================== +--- a/setup.py 2010-12-09 19:21:45.000000000 -0500 ++++ b/setup.py 2010-12-09 19:22:25.000000000 -0500 +@@ -125,43 +125,3 @@ + if root: + install_lib = install_lib[len(root):] + +- for script in dist.scripts: +- scriptPath = os.path.join(install_scripts, os.path.basename(script)) +- +- print "rewriting %s" % (scriptPath,) +- +- script = [] +- +- fileType = None +- +- for line in file(scriptPath, "r"): +- if not fileType: +- if line.startswith("#!"): +- if "python" in line.lower(): +- fileType = "python" +- elif "sh" in line.lower(): +- fileType = "sh" +- +- line = line.rstrip("\n") +- if fileType == "sh": +- if line == "#PYTHONPATH": +- script.append('PYTHONPATH="%s:$PYTHONPATH"' % (install_lib,)) +- elif line == "#PATH": +- script.append('PATH="%s:$PATH"' % (os.path.join(base, "bin"),)) +- else: +- script.append(line) +- +- elif fileType == "python": +- if line == "#PYTHONPATH": +- script.append('PYTHONPATH="%s"' % (install_lib,)) +- elif line == "#PATH": +- script.append('PATH="%s"' % (os.path.join(base, "bin"),)) +- else: +- script.append(line) +- +- else: +- script.append(line) +- +- newScript = open(scriptPath, "w") +- newScript.write("\n".join(script)) +- newScript.close() +Index: b/bin/caldavd +=================================================================== +--- a/bin/caldavd 2010-12-09 19:21:51.000000000 -0500 ++++ b/bin/caldavd 2010-12-09 19:22:41.000000000 -0500 +@@ -16,9 +16,6 @@ + # limitations under the License. + ## + +-#PATH +-#PYTHONPATH +- + daemonize=""; + username=""; + groupname=""; --- calendarserver-2.4.dfsg.orig/debian/patches/paths.diff +++ calendarserver-2.4.dfsg/debian/patches/paths.diff @@ -0,0 +1,175 @@ +diff -Naur calendarserver-2.4.dfsg.orig/bin/caldavd calendarserver-2.4.dfsg/bin/caldavd +--- calendarserver-2.4.dfsg.orig/bin/caldavd 2008-10-29 05:06:36.000000000 +0530 ++++ calendarserver-2.4.dfsg/bin/caldavd 2010-08-24 21:59:30.000000000 +0530 +@@ -23,7 +23,7 @@ + username=""; + groupname=""; + configfile=""; +-twistdpath="$(type -p twistd)"; ++twistdpath="/usr/lib/twisted-calendarserver/bin/twistd"; + plugin_name="caldav"; + service_type=""; + profile=""; +@@ -116,7 +116,7 @@ + + if [ $# != 0 ]; then usage "Unrecognized arguments:" "$@"; fi; + +-export PYTHONPATH ++export PYTHONPATH=`${python} -c 'import sys; print "/usr/lib/twisted-calendarserver/lib/python%s/site-packages" % (sys.version[:3])'` + + echo exec "${python}" "${twistdpath}" "${twistd_reactor}" ${daemonize} ${username} ${groupname} "${plugin_name}" ${configfile} ${service_type} ${profile} "${child_reactor}"; + +diff -Naur calendarserver-2.4.dfsg.orig/bin/calendarserver_export calendarserver-2.4.dfsg/bin/calendarserver_export +--- calendarserver-2.4.dfsg.orig/bin/calendarserver_export 2009-05-08 02:42:08.000000000 +0530 ++++ calendarserver-2.4.dfsg/bin/calendarserver_export 2010-08-24 21:59:30.000000000 +0530 +@@ -17,7 +17,7 @@ + + import sys + +-#PYTHONPATH ++PYTHONPATH = "/usr/lib/twisted-calendarserver/lib/python%s/site-packages" % (sys.version[:3]) + + if __name__ == "__main__": + if "PYTHONPATH" in globals(): +diff -Naur calendarserver-2.4.dfsg.orig/bin/calendarserver_manage_principals calendarserver-2.4.dfsg/bin/calendarserver_manage_principals +--- calendarserver-2.4.dfsg.orig/bin/calendarserver_manage_principals 2009-05-08 02:59:14.000000000 +0530 ++++ calendarserver-2.4.dfsg/bin/calendarserver_manage_principals 2010-08-24 21:59:30.000000000 +0530 +@@ -19,7 +19,7 @@ + from __future__ import with_statement + import sys + +-#PYTHONPATH ++PYTHONPATH = "/usr/lib/twisted-calendarserver/lib/python%s/site-packages" % (sys.version[:3]) + + if __name__ == "__main__": + if "PYTHONPATH" in globals(): +diff -Naur calendarserver-2.4.dfsg.orig/bin/calendarserver_warmup calendarserver-2.4.dfsg/bin/calendarserver_warmup +--- calendarserver-2.4.dfsg.orig/bin/calendarserver_warmup 2009-05-09 04:04:49.000000000 +0530 ++++ calendarserver-2.4.dfsg/bin/calendarserver_warmup 2010-08-24 21:59:30.000000000 +0530 +@@ -17,7 +17,7 @@ + + import sys + +-#PYTHONPATH ++PYTHONPATH = "/usr/lib/twisted-calendarserver/lib/python%s/site-packages" % (sys.version[:3]) + + if __name__ == "__main__": + if "PYTHONPATH" in globals(): +diff -Naur calendarserver-2.4.dfsg.orig/conf/caldavd.plist calendarserver-2.4.dfsg/conf/caldavd.plist +--- calendarserver-2.4.dfsg.orig/conf/caldavd.plist 2010-08-24 21:58:56.000000000 +0530 ++++ calendarserver-2.4.dfsg/conf/caldavd.plist 2010-08-24 21:59:30.000000000 +0530 +@@ -36,13 +36,13 @@ + + + HTTPPort +- 80 ++ 8008 + + + + + + +@@ -78,11 +78,11 @@ + + + DataRoot +- /Library/CalendarServer/Data/ ++ /var/run/caldavd/ + + + DocumentRoot +- /Library/CalendarServer/Documents/ ++ /var/spool/caldavd/ + + + Aliases +@@ -391,7 +391,7 @@ + + + GlobalStatsSocket +- /var/run/caldavd-stats.sock ++ /var/run/caldavd/caldavd-stats.sock + + + ServerStatsFile +@@ -399,7 +399,7 @@ + + + PIDFile +- /var/run/caldavd.pid ++ /var/run/caldavd/caldavd.pid + + + + + UserName +- daemon ++ caldavd + + GroupName +- daemon ++ caldavd + + ProcessType + Combined +@@ -431,7 +431,7 @@ + MultiProcess + + ProcessCount +- 0 ++ 1 + + + +@@ -588,6 +588,32 @@ + EnableWebAdmin + + ++ ++ Twisted ++ ++ twistd ++ /usr/lib/twisted-calendarserver/bin/twistd ++ ++ ++ ++ PythonDirector ++ ++ pydir ++ /usr/share/pydirector/pydir.py ++ ControlSocket ++ /var/run/caldavd/caldavd-pydir.sock ++ ++ ++ ++ ControlSocket ++ /var/run/caldavd/caldavd.sock ++ ++ ++ Memcached ++ ++ ServerEnabled ++ ++ + + + +diff -Naur calendarserver-2.4.dfsg.orig/setup.py calendarserver-2.4.dfsg/setup.py +--- calendarserver-2.4.dfsg.orig/setup.py 2009-05-08 02:42:08.000000000 +0530 ++++ calendarserver-2.4.dfsg/setup.py 2010-08-24 21:59:30.000000000 +0530 +@@ -110,7 +110,7 @@ + "bin/calendarserver_export", + "bin/calendarserver_manage_principals" + ], +- data_files = [ ("caldavd", ["conf/caldavd.plist"]) ], ++ data_files = [ ("/etc/caldavd", ["conf/caldavd.plist", "conf/sudoers.plist", "conf/auth/accounts.xml"]) ], + ext_modules = extensions, + py_modules = ["kqreactor", "memcacheclient"], + ) --- calendarserver-2.4.dfsg.orig/debian/patches/ldapdirectory.patch +++ calendarserver-2.4.dfsg/debian/patches/ldapdirectory.patch @@ -0,0 +1,634 @@ +Index: calendarserver-2.4.dfsg/conf/caldavd.plist +=================================================================== +--- calendarserver-2.4.dfsg.orig/conf/caldavd.plist 2010-08-24 21:22:46.000000000 +0530 ++++ calendarserver-2.4.dfsg/conf/caldavd.plist 2010-08-24 21:49:54.000000000 +0530 +@@ -191,6 +191,100 @@ + + --> + ++ ++ ++ + + ++ ++ ++ ++ ++ ++ ++ +