<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[12988] CalendarServer/trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/12988">12988</a></dd>
<dt>Author</dt> <dd>wsanchez@apple.com</dd>
<dt>Date</dt> <dd>2014-03-21 12:51:51 -0700 (Fri, 21 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>obsolete</pre>

<h3>Removed Paths</h3>
<ul>
<li><a href="#CalendarServertrunkrunomgdontusethisitssolastyear">CalendarServer/trunk/run.omg-dont-use-this-its-so-last-year</a></li>
<li><a href="#CalendarServertrunksupportbuildsh">CalendarServer/trunk/support/build.sh</a></li>
<li><a href="#CalendarServertrunksupportpysh">CalendarServer/trunk/support/py.sh</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkrunomgdontusethisitssolastyear"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/run.omg-dont-use-this-its-so-last-year (12987 => 12988)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/run.omg-dont-use-this-its-so-last-year        2014-03-21 19:47:59 UTC (rev 12987)
+++ CalendarServer/trunk/run.omg-dont-use-this-its-so-last-year        2014-03-21 19:51:51 UTC (rev 12988)
</span><span class="lines">@@ -1,250 +0,0 @@
</span><del>-#!/usr/bin/env bash
-# -*- sh-basic-offset: 2 -*-
-
-##
-# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##
-
-##
-# WARNING: This script is intended for use by developers working on
-# the Calendar Server code base.  It is not intended for use in a
-# deployment configuration.
-#
-# DO NOT use this script as a system startup tool (eg. in /etc/init.d,
-# /Library/StartupItems, launchd plists, etc.)
-#
-# For those uses, install the server properly (eg. with &quot;./run -i
-# /tmp/foo &amp;&amp; cd /tmp/foo &amp;&amp; pax -pe -rvw . /&quot;) and use the caldavd
-# executable to start the server.
-##
-
-set -e;
-set -u;
-
-wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)&quot; &amp;&amp; pwd)&quot;;
-
-# Echo the usage for the main 'run' script, then exit with an error.
-usage () {
-  program=&quot;$(basename &quot;$0&quot;)&quot;;
-
-  if [ &quot;${1--}&quot; != &quot;-&quot; ]; then
-    echo &quot;$@&quot;;
-    echo;
-  fi;
-
-  echo &quot;Usage: ${program} [-hvgsfnpdkrR] [-K key] [-iIb dst] [-t type] [-S statsdirectory] [-P plugin]&quot;;
-  echo &quot;Options:&quot;;
-  echo &quot;        -h  Print this help and exit&quot;;
-  echo &quot;        -v  Be verbose&quot;;
-  echo &quot;        -g  Get dependencies only; don't run setup or run the server.&quot;;
-  echo &quot;        -s  Run setup only; don't run server&quot;;
-  echo &quot;        -f  Force setup to run&quot;;
-  echo &quot;        -n  Do not run setup&quot;;
-  echo &quot;        -p  Print PYTHONPATH value for server and exit&quot;;
-  echo &quot;        -e  Print =-separated environment variables required to run and exit&quot;;
-  echo &quot;        -d  Run caldavd as a daemon&quot;;
-  echo &quot;        -k  Stop caldavd&quot;;
-  echo &quot;        -r  Restart caldavd&quot;;
-  echo &quot;        -K  Print value of configuration key and exit&quot;;
-  echo &quot;        -i  Perform a system install into dst; implies -s&quot;;
-  echo &quot;        -I  Perform a home install into dst; implies -s&quot;;
-  echo &quot;        -b  Perform a bundled install (include all dependencies) into dst; implies -s&quot;;
-  echo &quot;        -t  Select the server process type (Master, Slave or Combined) [${service_type}]&quot;;
-  echo &quot;        -S  Write a pstats object for each process to the given directory when the server is stopped.&quot;;
-  echo &quot;        -P  Select the twistd plugin name [${plugin_name}]&quot;;
-  echo &quot;        -R  Twisted Reactor plugin to execute [${reactor}]&quot;;
-
-  if [ &quot;${1-}&quot; == &quot;-&quot; ]; then
-    return 0;
-  fi;
-  exit 64;
-}
-
-# Parse command-line options to set up state which controls the behavior of the
-# functions in build.sh.
-parse_options () {
-  OPTIND=1;
-  while getopts &quot;ahvgsfnpedkrK:i:I:b:t:S:P:R:&quot; option; do
-    case &quot;${option}&quot; in
-      '?') usage; ;;
-      'h') usage -; exit 0; ;;
-      'v')       verbose=&quot;-v&quot;; ;;
-      'f')   force_setup=&quot;true&quot;; ;;
-      'k')          kill=&quot;true&quot;; ;;
-      'r')       restart=&quot;true&quot;; ;;
-      'd')     daemonize=&quot;&quot;; ;;
-      'P')   plugin_name=&quot;${OPTARG}&quot;; ;;
-      'R')       reactor=&quot;-R ${OPTARG}&quot;; ;;
-      't')  service_type=&quot;${OPTARG}&quot;; ;;
-      'K')      read_key=&quot;${OPTARG}&quot;; ;;
-      'S')       profile=&quot;-p ${OPTARG}&quot;; ;;
-      'g') do_get=&quot;true&quot; ; do_setup=&quot;false&quot;; do_run=&quot;false&quot;; ;;
-      's') do_get=&quot;true&quot; ; do_setup=&quot;true&quot; ; do_run=&quot;false&quot;; ;;
-      'p')
-        do_get=&quot;false&quot;; do_setup=&quot;false&quot;; do_run=&quot;false&quot;; print_path=&quot;true&quot;;
-        ;;
-      'e')
-        do_get=&quot;false&quot;; do_setup=&quot;false&quot;; do_run=&quot;false&quot;; print_path=&quot;true&quot;;
-        print_environment=&quot;true&quot;;
-        ;;
-      'i')
-        do_get=&quot;true&quot;;
-        do_setup=&quot;true&quot;;
-        do_run=&quot;false&quot;;
-        install=&quot;${OPTARG}&quot;;
-        install_flag=&quot;--root=&quot;;
-        ;;
-      'I')
-        do_get=&quot;true&quot;;
-        do_setup=&quot;true&quot;;
-        do_run=&quot;false&quot;;
-        install=&quot;${wd}/build/dst&quot;;
-        install_flag=&quot;--root=&quot;;
-        install_home=&quot;${OPTARG}&quot;;
-        ;;
-      'b')
-        do_bundle=&quot;true&quot;;
-        do_get=&quot;true&quot;;
-        do_setup=&quot;true&quot;;
-        do_run=&quot;false&quot;;
-        install=&quot;${OPTARG}&quot;;
-        install_flag=&quot;--root=&quot;;
-        ;;
-      'n') do_get=&quot;false&quot; ; do_setup=&quot;false&quot;; ;;
-    esac;
-  done;
-  shift $((${OPTIND} - 1));
-  if [ $# != 0 ]; then
-    usage &quot;Unrecognized arguments:&quot; &quot;$@&quot;;
-  fi;
-}
-
-. &quot;${wd}/support/build.sh&quot;;
-
-# Actually run the server.  (Or, exit, if things aren't sufficiently set up in
-# order to do that.)
-run () {
-  echo &quot;Using ${python} as Python&quot;;
-
-  if &quot;${do_run}&quot;; then
-    if [ ! -f &quot;${config}&quot; ]; then
-      echo &quot;&quot;;
-      echo &quot;Missing config file: ${config}&quot;;
-      echo &quot;You might want to start by copying the test configuration:&quot;;
-      echo &quot;&quot;;
-      echo &quot;  cp conf/caldavd-test.plist conf/caldavd-dev.plist&quot;;
-      echo &quot;&quot;;
-      if [ -t 0 ]; then
-        # Interactive shell
-        echo -n &quot;Would you like to copy the test configuration now? [y/n]&quot;;
-        read answer;
-        case &quot;${answer}&quot; in
-          y|yes|Y|YES|Yes)
-            echo &quot;Copying test cofiguration...&quot;;
-            cp &quot;${wd}/conf/caldavd-test.plist&quot; &quot;${wd}/conf/caldavd-dev.plist&quot;;
-            ;;
-          *)
-            exit 1;
-            ;;
-        esac;
-      else
-        exit 1;
-      fi;
-    fi;
-
-    cd &quot;${wd}&quot;;
-    if [ ! -d &quot;${wd}/data&quot; ]; then
-      mkdir &quot;${wd}/data&quot;;
-    fi;
-
-    echo &quot;&quot;;
-    echo &quot;Starting server...&quot;;
-    exec ${caldavd_wrapper_command}                   \
-        &quot;${caldav}/bin/caldavd&quot; ${daemonize}      \
-        -f &quot;${config}&quot;                                \
-        -P &quot;${plugin_name}&quot;                           \
-        -t &quot;${service_type}&quot;                          \
-        ${reactor}                                    \
-        ${profile};
-    cd /;
-  fi;
-}
-
-
-# The main-point of the 'run' script: parse all options, decide what to do,
-# then do it.
-run_main () {
-  parse_options &quot;$@&quot;;
-
-  # If we've been asked to read a configuration key, just read it and exit.
-  if [ -n &quot;${read_key}&quot; ]; then
-    value=&quot;$(&quot;${caldav}/bin/calendarserver_config&quot; &quot;${read_key}&quot;)&quot;;
-    IFS=&quot;=&quot;; set ${value}; echo &quot;$2&quot;; unset IFS;
-    exit $?;
-  fi;
-
-  if &quot;${kill}&quot; || &quot;${restart}&quot;; then
-    pidfile=&quot;$(&quot;${caldav}/bin/calendarserver_config&quot; &quot;PIDFile&quot;)&quot;;
-    # Split key and value on &quot;=&quot; and just grab the value
-    IFS=&quot;=&quot;; set ${pidfile}; pidfile=&quot;$2&quot;; unset IFS;
-    if [ ! -r &quot;${pidfile}&quot; ]; then
-      echo &quot;Unreadable PID file: ${pidfile}&quot;;
-      exit 1
-    fi;
-    pid=&quot;$(cat &quot;${pidfile}&quot; | head -1)&quot;;
-    if [ -z &quot;${pid}&quot; ]; then
-      echo &quot;No PID in PID file: ${pidfile}&quot;;
-      exit 1;
-    fi;
-    echo &quot;Killing process ${pid}&quot;;
-    kill -TERM &quot;${pid}&quot;;
-    if ! &quot;${restart}&quot;; then
-      exit 0;
-    fi;
-  fi;
-
-  # About to do something for real; let's enumerate (and depending on options,
-  # possibly download and/or install) the dependencies.
-  dependencies;
-
-  # Now that all the dependencies are set up, let's see if we're just being
-  # asked to print the path.
-  if &quot;${print_path}&quot;; then
-    if &quot;${print_environment}&quot;; then
-      &quot;${PYTHON}&quot; -c &quot;import os; print repr(dict(os.environ))&quot;
-    else
-      echo &quot;${PYTHONPATH}&quot;;
-    fi;
-    exit 0;
-  fi;
-
-  # If we're installing, install the calendar server itself.
-  py_install &quot;Calendar Server&quot; &quot;${caldav}&quot;;
-
-  if [ -n &quot;${install_home:-}&quot; ]; then
-    do_home_install;
-  fi;
-
-  if &quot;${do_bundle}&quot;; then
-    write_environment;
-  fi;
-
-  # Finally, run the server.
-  run;
-}
-
-
-run_main &quot;$@&quot;;
-
</del></span></pre></div>
<a id="CalendarServertrunksupportbuildsh"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/support/build.sh (12987 => 12988)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/support/build.sh        2014-03-21 19:47:59 UTC (rev 12987)
+++ CalendarServer/trunk/support/build.sh        2014-03-21 19:51:51 UTC (rev 12988)
</span><span class="lines">@@ -1,971 +0,0 @@
</span><del>-# -*- sh-basic-offset: 2 -*-
-
-##
-# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##
-
-set -e
-set -u
-
-. &quot;${wd}/support/py.sh&quot;;
-
-echo_header () {
-  if ! &quot;${print_path}&quot;; then
-    echo &quot;$@&quot;;
-    echo &quot;&quot;;
-  fi;
-}
-
-using_system () {
-  local name=&quot;$1&quot;; shift;
-  echo_header &quot;Using system version of ${name}.&quot;;
-}
-
-# Provide a default value: if the variable named by the first argument is
-# empty, set it to the default in the second argument.
-conditional_set () {
-  local var=&quot;$1&quot;; shift;
-  local default=&quot;$1&quot;; shift;
-  if [ -z &quot;$(eval echo &quot;\${${var}:-}&quot;)&quot; ]; then
-    eval &quot;${var}=\${default:-}&quot;;
-  fi;
-}
-
-# Checks for presence of a C header, optionally with a version comparison.
-# With only a header file name, try to include it, returning nonzero if absent.
-# With 3 params, also attempt a version check, returning nonzero if too old.
-# Param 2 is a minimum acceptable version number
-# Param 3 is a #define from the source that holds the installed version number
-# Examples:
-#   Assert that ldap.h is present
-#     find_header &quot;ldap.h&quot;
-#   Assert that ldap.h is present with a version &gt;= 20344
-#     find_header &quot;ldap.h&quot; 20344 &quot;LDAP_VENDOR_VERSION&quot;
-find_header () {
-  sys_header=&quot;$1&quot;; shift;
-  if [ $# -ge 1 ]; then
-        min_version=&quot;$1&quot;; shift;
-      version_macro=&quot;$1&quot;; shift;
-  fi;
-
-  # No min_version given:
-  # Check for presence of a header. We use the &quot;-c&quot; cc option because we don't
-  # need to emit a file; cc exits nonzero if it can't find the header
-  if [ -z &quot;${min_version:-}&quot; ]; then
-    echo &quot;#include &lt;${sys_header}&gt;&quot; | cc -x c -c - -o /dev/null 2&gt; /dev/null;
-    return &quot;$?&quot;;
-  fi;
-
-  # Check for presence of a header of specified version
-  found_version=&quot;$(printf &quot;#include &lt;${sys_header}&gt;\n${version_macro}\n&quot; | cc -x c -E - | tail -1)&quot;;
-
-  if [ &quot;${found_version}&quot; == &quot;${version_macro}&quot; ]; then
-    # Macro was not replaced
-    return 1;
-  fi;
-
-  if cmp_version &quot;${min_version}&quot; &quot;${found_version}&quot;; then
-    return 0;
-  else
-    return 1;
-  fi;
-};
-
-# Initialize all the global state required to use this library.
-init_build () {
-            verbose=&quot;&quot;;
-             do_get=&quot;true&quot;;
-           do_setup=&quot;true&quot;;
-             do_run=&quot;true&quot;;
-          do_bundle=&quot;false&quot;;
-        force_setup=&quot;false&quot;;
-      disable_setup=&quot;false&quot;;
-         print_path=&quot;false&quot;;
-  print_environment=&quot;false&quot;;
-            install=&quot;&quot;;
-          daemonize=&quot;-X -L&quot;;
-               kill=&quot;false&quot;;
-            restart=&quot;false&quot;;
-        plugin_name=&quot;caldav&quot;;
-       service_type=&quot;Combined&quot;;
-           read_key=&quot;&quot;;
-            profile=&quot;&quot;;
-            reactor=&quot;&quot;;
-
-  # These variables are defaults for things which might be configured by
-  # environment; only set them if they're un-set.
-  conditional_set wd &quot;$(pwd)&quot;;
-  conditional_set config &quot;${wd}/conf/caldavd-dev.plist&quot;;
-  conditional_set caldav &quot;${wd}&quot;;
-  conditional_set CALENDARSERVER_BUILD_DEPS &quot;${caldav}/..&quot;;
-
-  if [ -z &quot;${CALENDARSERVER_CACHE_DEPS-}&quot; ]; then
-    cache_deps=&quot;${wd}/.dependencies&quot;;
-  else
-    cache_deps=&quot;${CALENDARSERVER_CACHE_DEPS}&quot;;
-  fi;
-
-  mkdir -p &quot;${CALENDARSERVER_BUILD_DEPS}&quot;;
-  top=&quot;$(cd &quot;${CALENDARSERVER_BUILD_DEPS}&quot; &amp;&amp; pwd -L)&quot;;
-
-  if [ -z &quot;${caldavd_wrapper_command:-}&quot; ]; then
-    if [ &quot;$(uname -s)&quot; == &quot;Darwin&quot; ] &amp;&amp; [ &quot;$(uname -r | cut -d . -f 1)&quot; -ge 9 ]; then
-      caldavd_wrapper_command=&quot;launchctl bsexec /&quot;;
-    else
-      caldavd_wrapper_command=&quot;&quot;;
-    fi;
-  fi;
-
-  patches=&quot;${caldav}/lib-patches&quot;;
-
-  # Find some hashing commands
-  # sha1() = sha1 hash, if available
-  # md5()  = md5 hash, if available
-  # hash() = default hash function
-  # $hash  = name of the type of hash used by hash()
-
-  hash=&quot;&quot;;
-
-  if type -ft openssl &gt; /dev/null; then
-    if [ -z &quot;${hash}&quot; ]; then hash=&quot;md5&quot;; fi;
-    md5 () { &quot;$(type -p openssl)&quot; dgst -md5 &quot;$@&quot;; }
-  elif type -ft md5 &gt; /dev/null; then
-    if [ -z &quot;${hash}&quot; ]; then hash=&quot;md5&quot;; fi;
-    md5 () { &quot;$(type -p md5)&quot; &quot;$@&quot;; }
-  elif type -ft md5sum &gt; /dev/null; then
-    if [ -z &quot;${hash}&quot; ]; then hash=&quot;md5&quot;; fi;
-    md5 () { &quot;$(type -p md5sum)&quot; &quot;$@&quot;; }
-  fi;
-
-  if type -ft sha1sum &gt; /dev/null; then
-    if [ -z &quot;${hash}&quot; ]; then hash=&quot;sha1sum&quot;; fi;
-    sha1 () { &quot;$(type -p sha1sum)&quot; &quot;$@&quot;; }
-  fi;
-  if type -ft shasum &gt; /dev/null; then
-    if [ -z &quot;${hash}&quot; ]; then hash=&quot;sha1&quot;; fi;
-    sha1 () { &quot;$(type -p shasum)&quot; &quot;$@&quot;; }
-  fi;
-
-  if [ &quot;${hash}&quot; == &quot;sha1&quot; ]; then
-    hash () { sha1 &quot;$@&quot;; }
-  elif [ &quot;${hash}&quot; == &quot;md5&quot; ]; then
-    hash () { md5 &quot;$@&quot;; }
-  elif type -t cksum &gt; /dev/null; then
-    hash=&quot;hash&quot;;
-    hash () { cksum &quot;$@&quot; | cut -f 1 -d &quot; &quot;; }
-  elif type -t sum &gt; /dev/null; then
-    hash=&quot;hash&quot;;
-    hash () { sum &quot;$@&quot; | cut -f 1 -d &quot; &quot;; }
-  else
-    hash () { echo &quot;INTERNAL ERROR: No hash function.&quot;; exit 1; }
-  fi;
-
-  if [ -n &quot;${install}&quot; ] &amp;&amp; ! echo &quot;${install}&quot; | grep '^/' &gt; /dev/null; then
-    install=&quot;$(pwd)/${install}&quot;;
-  fi;
-
-  svn_uri_base=&quot;$(svn info &quot;${caldav}&quot; --xml 2&gt; /dev/null | sed -n 's|^.*&lt;root&gt;\(.*\)&lt;/root&gt;.*$|\1|p')&quot;;
-
-  conditional_set svn_uri_base &quot;http://svn.calendarserver.org/repository/calendarserver&quot;;
-}
-
-
-# This is a hack, but it's needed because installing with --home doesn't work
-# for python-dateutil.
-do_home_install () {
-  install -d &quot;${install_home}&quot;;
-  install -d &quot;${install_home}/bin&quot;;
-  install -d &quot;${install_home}/conf&quot;;
-  install -d &quot;${install_home}/lib/python&quot;;
-
-  rsync -av &quot;${install}${py_prefix}/bin/&quot; &quot;${install_home}/bin/&quot;;
-  rsync -av &quot;${install}${py_libdir}/&quot; &quot;${install_home}/lib/python/&quot;;
-  rsync -av &quot;${install}${py_prefix}/caldavd/&quot; &quot;${install_home}/caldavd/&quot;;
-
-  rm -rf &quot;${install}&quot;;
-}
-
-
-# Apply patches from lib-patches to the given dependency codebase.
-apply_patches () {
-  local name=&quot;$1&quot;; shift;
-  local path=&quot;$1&quot;; shift;
-
-  if [ -d &quot;${patches}/${name}&quot; ]; then
-    echo &quot;&quot;;
-    echo &quot;Applying patches to ${name} in ${path}...&quot;;
-
-    cd &quot;${path}&quot;;
-    find &quot;${patches}/${name}&quot;                  \
-        -type f                                \
-        -name '*.patch'                        \
-        -print                                 \
-        -exec patch -p0 --forward -i '{}' ';';
-    cd /;
-
-  fi;
-
-  echo &quot;&quot;;
-  if [ -e &quot;${path}/setup.py&quot; ]; then
-    echo &quot;Removing build directory ${path}/build...&quot;;
-    rm -rf &quot;${path}/build&quot;;
-    echo &quot;Removing pyc files from ${path}...&quot;;
-    find &quot;${path}&quot; -type f -name '*.pyc' -print0 | xargs -0 rm -f;
-  fi;
-}
-
-
-# If do_get is turned on, get an archive file containing a dependency via HTTP.
-www_get () {
-  if ! &quot;${do_get}&quot;; then return 0; fi;
-
-  local  md5=&quot;&quot;;
-  local sha1=&quot;&quot;;
-
-  OPTIND=1;
-  while getopts &quot;m:s:&quot; option; do
-    case &quot;${option}&quot; in
-      'm')  md5=&quot;${OPTARG}&quot;; ;;
-      's') sha1=&quot;${OPTARG}&quot;; ;;
-    esac;
-  done;
-  shift $((${OPTIND} - 1));
-
-  local name=&quot;$1&quot;; shift;
-  local path=&quot;$1&quot;; shift;
-  local  url=&quot;$1&quot;; shift;
-
-  if &quot;${force_setup}&quot; || [ ! -d &quot;${path}&quot; ]; then
-    local ext=&quot;$(echo &quot;${url}&quot; | sed 's|^.*\.\([^.]*\)$|\1|')&quot;;
-
-    untar () { tar -xvf -; }
-    unzipstream () { tmp=&quot;$(mktemp -t ccsXXXXX)&quot;; cat &gt; &quot;${tmp}&quot;; unzip &quot;${tmp}&quot;; rm &quot;${tmp}&quot;; }
-    case &quot;${ext}&quot; in
-      gz|tgz) decompress=&quot;gzip -d -c&quot;; unpack=&quot;untar&quot;; ;;
-      bz2)    decompress=&quot;bzip2 -d -c&quot;; unpack=&quot;untar&quot;; ;;
-      tar)    decompress=&quot;untar&quot;; unpack=&quot;untar&quot;; ;;
-      zip)    decompress=&quot;cat&quot;; unpack=&quot;unzipstream&quot;; ;;
-      *)
-        echo &quot;Error in www_get of URL ${url}: Unknown extension ${ext}&quot;;
-        exit 1;
-        ;;
-    esac;
-
-    echo &quot;&quot;;
-
-    if [ -n &quot;${cache_deps}&quot; ] &amp;&amp; [ -n &quot;${hash}&quot; ]; then
-      mkdir -p &quot;${cache_deps}&quot;;
-
-      local cache_basename=&quot;$(echo ${name} | tr '[ ]' '_')-$(echo &quot;${url}&quot; | hash)-$(basename &quot;${url}&quot;)&quot;;
-      local cache_file=&quot;${cache_deps}/${cache_basename}&quot;;
-
-      check_hash () {
-        local file=&quot;$1&quot;; shift;
-
-        local sum=&quot;$(md5 &quot;${file}&quot; | perl -pe 's|^.*([0-9a-f]{32}).*$|\1|')&quot;;
-        if [ -n &quot;${md5}&quot; ]; then
-          echo &quot;Checking MD5 sum for ${name}...&quot;;
-          if [ &quot;${md5}&quot; != &quot;${sum}&quot; ]; then
-            echo &quot;ERROR: MD5 sum for downloaded file is wrong: ${sum} != ${md5}&quot;;
-            return 1;
-          fi;
-        else
-          echo &quot;MD5 sum for ${name} is ${sum}&quot;;
-        fi;
-
-        local sum=&quot;$(sha1 &quot;${file}&quot; | perl -pe 's|^.*([0-9a-f]{40}).*$|\1|')&quot;;
-        if [ -n &quot;${sha1}&quot; ]; then
-          echo &quot;Checking SHA1 sum for ${name}...&quot;;
-          if [ &quot;${sha1}&quot; != &quot;${sum}&quot; ]; then
-            echo &quot;ERROR: SHA1 sum for downloaded file is wrong: ${sum} != ${sha1}&quot;;
-            return 1;
-          fi;
-        else
-          echo &quot;SHA1 sum for ${name} is ${sum}&quot;;
-        fi;
-      }
-
-      if [ ! -f &quot;${cache_file}&quot; ]; then
-        echo &quot;No cache file: ${cache_file}&quot;;
-
-        echo &quot;Downloading ${name}...&quot;;
-
-        local pkg_host=&quot;static.calendarserver.org&quot;;
-        local pkg_path=&quot;/pkg&quot;;
-
-        #
-        # Try getting a copy from calendarserver.org.
-        #
-        local tmp=&quot;$(mktemp &quot;/tmp/${cache_basename}.XXXXXX&quot;)&quot;;
-        curl -L &quot;http://${pkg_host}${pkg_path}/${cache_basename}&quot; -o &quot;${tmp}&quot; || true;
-        echo &quot;&quot;;
-        if [ ! -s &quot;${tmp}&quot; ] || grep '&lt;title&gt;404 Not Found&lt;/title&gt;' &quot;${tmp}&quot; &gt; /dev/null; then
-          rm -f &quot;${tmp}&quot;;
-          echo &quot;${name} is not available from calendarserver.org; trying upstream source.&quot;;
-        elif ! check_hash &quot;${tmp}&quot;; then
-          rm -f &quot;${tmp}&quot;;
-          echo &quot;${name} from calendarserver.org is invalid; trying upstream source.&quot;;
-        fi;
-
-        #
-        # That didn't work. Try getting a copy from the upstream source.
-        #
-        if [ ! -f &quot;${tmp}&quot; ]; then
-          curl -L &quot;${url}&quot; -o &quot;${tmp}&quot;;
-          echo &quot;&quot;;
-
-          if [ ! -s &quot;${tmp}&quot; ] || grep '&lt;title&gt;404 Not Found&lt;/title&gt;' &quot;${tmp}&quot; &gt; /dev/null; then
-            rm -f &quot;${tmp}&quot;;
-            echo &quot;${name} is not available from upstream source: ${url}&quot;;
-            exit 1;
-          elif ! check_hash &quot;${tmp}&quot;; then
-            rm -f &quot;${tmp}&quot;;
-            echo &quot;${name} from upstream source is invalid: ${url}&quot;;
-            exit 1;
-          fi;
-
-          if egrep &quot;^${pkg_host}&quot; &quot;${HOME}/.ssh/known_hosts&quot; &gt; /dev/null 2&gt;&amp;1; then
-            echo &quot;Copying cache file up to ${pkg_host}.&quot;;
-            if ! scp &quot;${tmp}&quot; &quot;${pkg_host}:/var/www/static${pkg_path}/${cache_basename}&quot;; then
-              echo &quot;Failed to copy cache file up to ${pkg_host}.&quot;;
-            fi;
-            echo &quot;&quot;
-          fi;
-        fi;
-
-        #
-        # OK, we should be good
-        #
-        mv &quot;${tmp}&quot; &quot;${cache_file}&quot;;
-      else
-        #
-        # We have the file cached, just verify hash
-        #
-        if ! check_hash &quot;${cache_file}&quot;; then
-          exit 1;
-        fi;
-      fi;
-
-      echo &quot;Unpacking ${name} from cache...&quot;;
-      get () { cat &quot;${cache_file}&quot;; }
-    else
-      echo &quot;Downloading ${name}...&quot;;
-      get () { curl -L &quot;${url}&quot;; }
-    fi;
-
-    rm -rf &quot;${path}&quot;;
-    cd &quot;$(dirname &quot;${path}&quot;)&quot;;
-    get | ${decompress} | ${unpack};
-    apply_patches &quot;${name}&quot; &quot;${path}&quot;;
-    cd /;
-  fi;
-}
-
-
-# If do_get is turned on, check a name out from SVN.
-svn_get () {
-  if ! &quot;${do_get}&quot;; then
-    return 0;
-  fi;
-
-  local     name=&quot;$1&quot;; shift;
-  local     path=&quot;$1&quot;; shift;
-  local      uri=&quot;$1&quot;; shift;
-  local revision=&quot;$1&quot;; shift;
-
-  if [ -d &quot;${path}&quot; ]; then
-    local wc_uri=&quot;$(svn info --xml &quot;${path}&quot; 2&gt; /dev/null | sed -n 's|^.*&lt;url&gt;\(.*\)&lt;/url&gt;.*$|\1|p')&quot;;
-
-    if &quot;${force_setup}&quot;; then
-      # Verify that we have a working copy checked out from the correct URI
-      if [ &quot;${wc_uri}&quot; != &quot;${uri}&quot; ]; then
-        echo &quot;Current working copy (${path}) is from the wrong URI: ${wc_uri} != ${uri}&quot;;
-        rm -rf &quot;${path}&quot;;
-        svn_get &quot;${name}&quot; &quot;${path}&quot; &quot;${uri}&quot; &quot;${revision}&quot;;
-        return $?;
-      fi;
-
-      echo &quot;Reverting ${name}...&quot;;
-      svn revert -R &quot;${path}&quot;;
-
-      echo &quot;Updating ${name}...&quot;;
-      svn update -r &quot;${revision}&quot; &quot;${path}&quot;;
-
-      apply_patches &quot;${name}&quot; &quot;${path}&quot;;
-    else
-      if ! &quot;${print_path}&quot;; then
-        # Verify that we have a working copy checked out from the correct URI
-        if [ &quot;${wc_uri}&quot; != &quot;${uri}&quot; ]; then
-          echo &quot;Current working copy (${path}) is from the wrong URI: ${wc_uri} != ${uri}&quot;;
-          echo &quot;Performing repository switch for ${name}...&quot;;
-          svn switch -r &quot;${revision}&quot; &quot;${uri}&quot; &quot;${path}&quot;;
-
-          apply_patches &quot;${name}&quot; &quot;${path}&quot;;
-        else
-          local svnversion=&quot;$(svnversion &quot;${path}&quot;)&quot;;
-          if [ &quot;${svnversion%%[M:]*}&quot; != &quot;${revision}&quot; ]; then
-            echo &quot;Updating ${name}...&quot;;
-            svn update -r &quot;${revision}&quot; &quot;${path}&quot;;
-
-            apply_patches &quot;${name}&quot; &quot;${path}&quot;;
-          fi;
-        fi;
-      fi;
-    fi;
-  else
-    checkout () {
-      echo &quot;Checking out ${name}...&quot;;
-      svn checkout -r &quot;${revision}&quot; &quot;${uri}@${revision}&quot; &quot;${path}&quot;;
-    }
-
-    if [ &quot;${revision}&quot; != &quot;HEAD&quot; ] &amp;&amp; \
-       [ -n &quot;${cache_deps}&quot; ] &amp;&amp; \
-       [ -n &quot;${hash}&quot; ] \
-    ; then
-      local cacheid=&quot;${name}-$(echo &quot;${uri}&quot; | hash)&quot;;
-      local cache_file=&quot;${cache_deps}/${cacheid}@r${revision}.tgz&quot;;
-
-      mkdir -p &quot;${cache_deps}&quot;;
-
-      if [ -f &quot;${cache_file}&quot; ]; then
-        echo &quot;Unpacking ${name} from cache...&quot;;
-        mkdir -p &quot;${path}&quot;;
-        tar -C &quot;${path}&quot; -xvzf &quot;${cache_file}&quot;;
-      else
-        checkout;
-        echo &quot;Caching ${name}...&quot;;
-        tar -C &quot;${path}&quot; -cvzf &quot;${cache_file}&quot; .;
-      fi;
-    else
-      checkout;
-    fi;
-
-    apply_patches &quot;${name}&quot; &quot;${path}&quot;;
-  fi;
-}
-
-
-# (optionally) Invoke 'python setup.py build' on the given python project.
-py_build () {
-  local     name=&quot;$1&quot;; shift;
-  local     path=&quot;$1&quot;; shift;
-  local optional=&quot;$1&quot;; shift;
-
-  if &quot;${do_setup}&quot;; then
-    echo_header &quot;Building ${name}...&quot;;
-    cd &quot;${path}&quot;;
-    if ! &quot;${python}&quot; ./setup.py -q build \
-        --build-lib &quot;build/${py_platform_libdir}&quot; &quot;$@&quot;; then
-      if &quot;${optional}&quot;; then
-        echo &quot;WARNING: ${name} failed to build.&quot;;
-        echo &quot;WARNING: ${name} is not required to run the server;&quot;\
-             &quot;continuing without it.&quot;;
-      else
-        return $?;
-      fi;
-    fi;
-    cd /;
-  fi;
-}
-
-# If in install mode, install the given package from the given path.
-# (Otherwise do nothing.)
-py_install () {
-  local name=&quot;$1&quot;; shift;
-  local path=&quot;$1&quot;; shift;
-
-  if [ -n &quot;${install}&quot; ]; then
-    echo &quot;&quot;;
-    echo &quot;Installing ${name}...&quot;;
-    cd &quot;${path}&quot;;
-    if &quot;${do_bundle}&quot;; then
-      # Since we've built our own Python, an option-free installation is the
-      # best bet.
-      &quot;${python}&quot; ./setup.py install;
-    else
-      &quot;${python}&quot; ./setup.py install &quot;${install_flag}${install}&quot;;
-    fi;
-    cd /;
-  fi;
-}
-
-
-# Declare a dependency on a Python project.
-py_dependency () {
-  local optional=&quot;false&quot;; # Is this dependency optional?
-  local override=&quot;false&quot;; # Do I need to get this dependency even if the system
-                          # already has it?
-  local  inplace=&quot;&quot;;      # Do development in-place; don't run setup.py to
-                          # build, and instead add the source directory plus the
-                          # given relative path directly to sys.path.
-  local skip_egg=&quot;false&quot;; # Skip even the 'egg_info' step, because nothing needs
-                          # to be built.
-  local revision=&quot;0&quot;;     # Revision (if svn)
-  local get_type=&quot;www&quot;;   # Protocol to use
-  local  version=&quot;&quot;;      # Minimum version required
-  local   f_hash=&quot;&quot;;      # Checksum flag
-
-  OPTIND=1;
-  while getopts &quot;ofi:er:v:m:s:&quot; option; do
-    case &quot;${option}&quot; in
-      'o') optional=&quot;true&quot;; ;;
-      'f') override=&quot;true&quot;; ;;
-      'e') skip_egg=&quot;true&quot;; ;;
-      'r') get_type=&quot;svn&quot;; revision=&quot;${OPTARG}&quot;; ;;
-      'v')  version=&quot;-v ${OPTARG}&quot;; ;;
-      'm')   f_hash=&quot;-m ${OPTARG}&quot;; ;;
-      's')   f_hash=&quot;-s ${OPTARG}&quot;; ;;
-      'i')
-        if [ -z &quot;${OPTARG}&quot; ]; then
-          inplace=&quot;.&quot;;
-        else
-          inplace=&quot;${OPTARG}&quot;;
-        fi;
-        ;;
-    esac;
-  done;
-  shift $((${OPTIND} - 1));
-
-  # args
-  local         name=&quot;$1&quot;; shift; # the name of the package (for display)
-  local       module=&quot;$1&quot;; shift; # the name of the python module.
-  local distribution=&quot;$1&quot;; shift; # the name of the directory to put the
-                                  # distribution into.
-  local      get_uri=&quot;$1&quot;; shift; # what URL should be fetched?
-
-  local srcdir=&quot;${top}/${distribution}&quot;
-
-  if &quot;${override}&quot; || ! py_have_module ${version} &quot;${module}&quot;; then
-    &quot;${get_type}_get&quot; ${f_hash} &quot;${name}&quot; &quot;${srcdir}&quot; &quot;${get_uri}&quot; &quot;${revision}&quot;
-    if [ -n &quot;${inplace}&quot; ]; then
-      if &quot;${do_setup}&quot; &amp;&amp; &quot;${override}&quot; &amp;&amp; ! &quot;${skip_egg}&quot;; then
-        echo;
-        if py_have_module setuptools; then
-          echo_header &quot;Building ${name}... [overrides system, building egg-info only]&quot;;
-          cd &quot;${srcdir}&quot;;
-          &quot;${python}&quot; ./setup.py -q egg_info 2&gt;&amp;1 | (
-            grep -i -v 'Unrecognized .svn/entries' || true);
-          cd /;
-        fi;
-      fi;
-    else
-      py_build &quot;${name}&quot; &quot;${srcdir}&quot; &quot;${optional}&quot;;
-    fi;
-    py_install &quot;${name}&quot; &quot;${srcdir}&quot;;
-
-    if [ -n &quot;${inplace}&quot; ]; then
-      if [ &quot;${inplace}&quot; == &quot;.&quot; ]; then
-        local add_pythonpath=&quot;${srcdir}&quot;;
-      else
-        local add_pythonpath=&quot;${srcdir}/${inplace}&quot;;
-      fi;
-      local add_path=&quot;${srcdir}/bin&quot;;
-    else
-      local add_pythonpath=&quot;${srcdir}/build/${py_platform_libdir}&quot;;
-      local add_path=&quot;${srcdir}/build/${py_platform_scripts}&quot;;
-    fi;
-    export PYTHONPATH=&quot;${add_pythonpath}:${PYTHONPATH:-}&quot;;
-    if [ -d &quot;${add_path}&quot; ]; then
-      export PATH=&quot;${add_path}:${PATH}&quot;;
-    fi;
-  else
-    using_system &quot;${name}&quot;;
-  fi;
-}
-
-# Run 'make' with the given command line, prepending a -j option appropriate to
-# the number of CPUs on the current machine, if that can be determined.
-jmake () {
-  case &quot;$(uname -s)&quot; in
-    Darwin|Linux)
-      ncpu=&quot;$(getconf _NPROCESSORS_ONLN)&quot;;
-      ;;
-    FreeBSD)
-      ncpu=&quot;$(sysctl hw.ncpu)&quot;;
-      ncpu=&quot;${ncpu##hw.ncpu: }&quot;;
-      ;;
-  esac;
-
-  if [ -n &quot;${ncpu:-}&quot; ] &amp;&amp; [[ &quot;${ncpu}&quot; =~ ^[0-9]+$ ]]; then
-    make -j &quot;${ncpu}&quot; &quot;$@&quot;;
-  else
-    make &quot;$@&quot;;
-  fi;
-}
-
-# Declare a dependency on a C project built with autotools.
-c_dependency () {
-  local f_hash=&quot;&quot;;
-
-  OPTIND=1;
-  while getopts &quot;m:s:&quot; option; do
-    case &quot;${option}&quot; in
-      'm') f_hash=&quot;-m ${OPTARG}&quot;; ;;
-      's') f_hash=&quot;-s ${OPTARG}&quot;; ;;
-    esac;
-  done;
-  shift $((${OPTIND} - 1));
-
-  local name=&quot;$1&quot;; shift;
-  local path=&quot;$1&quot;; shift;
-  local  uri=&quot;$1&quot;; shift;
-
-  # Extra arguments are processed below, as arguments to './configure'.
-
-  if &quot;${do_bundle}&quot;; then
-    local dstroot=&quot;${install}&quot;;
-    srcdir=&quot;${install}/src/${path}&quot;;
-  else
-    srcdir=&quot;${top}/${path}&quot;;
-    local dstroot=&quot;${srcdir}/_root&quot;;
-  fi;
-
-  www_get ${f_hash} &quot;${name}&quot; &quot;${srcdir}&quot; &quot;${uri}&quot;;
-
-  export              PATH=&quot;${dstroot}/bin:${PATH}&quot;;
-  export    C_INCLUDE_PATH=&quot;${dstroot}/include:${C_INCLUDE_PATH:-}&quot;;
-  export   LD_LIBRARY_PATH=&quot;${dstroot}/lib:${dstroot}/lib64:${LD_LIBRARY_PATH:-}&quot;;
-  export          CPPFLAGS=&quot;-I${dstroot}/include ${CPPFLAGS:-} &quot;;
-  export           LDFLAGS=&quot;-L${dstroot}/lib -L${dstroot}/lib64 ${LDFLAGS:-} &quot;;
-  export DYLD_LIBRARY_PATH=&quot;${dstroot}/lib:${dstroot}/lib64:${DYLD_LIBRARY_PATH:-}&quot;;
-  export PKG_CONFIG_PATH=&quot;${dstroot}/lib/pkgconfig:${PKG_CONFIG_PATH:-}&quot;;
-
-  if &quot;${do_setup}&quot;; then
-    if &quot;${force_setup}&quot; || &quot;${do_bundle}&quot; || [ ! -d &quot;${dstroot}&quot; ]; then
-      echo &quot;Building ${name}...&quot;;
-      cd &quot;${srcdir}&quot;;
-      ./configure --prefix=&quot;${dstroot}&quot; &quot;$@&quot;;
-      jmake;
-      jmake install;
-    else
-      echo &quot;Using built ${name}.&quot;;
-      echo &quot;&quot;;
-    fi;
-  fi;
-}
-
-# Used only when bundling: write out, into the bundle, an 'environment.sh' file
-# that contains all the environment variables necessary to invoke commands in
-# the deployed bundle.
-
-write_environment () {
-  local dstroot=&quot;${install}&quot;;
-  cat &gt; &quot;${dstroot}/environment.sh&quot; &lt;&lt; __EOF__
-export              PATH=&quot;${dstroot}/bin:\${PATH}&quot;;
-export    C_INCLUDE_PATH=&quot;${dstroot}/include:\${C_INCLUDE_PATH:-}&quot;;
-export   LD_LIBRARY_PATH=&quot;${dstroot}/lib:${dstroot}/lib64:\${LD_LIBRARY_PATH:-}:\$ORACLE_HOME&quot;;
-export          CPPFLAGS=&quot;-I${dstroot}/include \${CPPFLAGS:-} &quot;;
-export           LDFLAGS=&quot;-L${dstroot}/lib -L${dstroot}/lib64 \${LDFLAGS:-} &quot;;
-export DYLD_LIBRARY_PATH=&quot;${dstroot}/lib:${dstroot}/lib64:\${DYLD_LIBRARY_PATH:-}:\$ORACLE_HOME&quot;;
-__EOF__
-}
-
-
-#
-# Enumerate all the dependencies with c_dependency and py_dependency;
-# depending on options parsed by ../run:parse_options and on-disk
-# state, this may do as little as update the PATH, DYLD_LIBRARY_PATH,
-# LD_LIBRARY_PATH and PYTHONPATH, or, it may do as much as download
-# and install all dependencies.
-#
-dependencies () {
-
-  #
-  # Dependencies compiled from C source code
-  #
-
-
-  if &quot;${do_bundle}&quot;; then
-    # First a bit of bootstrapping: fill out the standard directory structure.
-    for topdir in bin lib include share src; do
-      mkdir -p &quot;${install}/${topdir}&quot;;
-    done;
-
-    # Normally we depend on the system Python, but a bundle install should be as
-    # self-contained as possible.
-    local pyfn=&quot;Python-2.7.5&quot;;
-    c_dependency -m &quot;6334b666b7ff2038c761d7b27ba699c1&quot; \
-        &quot;Python&quot; &quot;${pyfn}&quot; \
-        &quot;http://www.python.org/ftp/python/2.7.5/${pyfn}.tar.bz2&quot; \
-        --enable-shared;
-    # Be sure to use the Python we just built.
-    export PYTHON=&quot;$(type -p python)&quot;;
-    init_py;
-  fi;
-
-  if type -P memcached &gt; /dev/null; then
-    using_system &quot;memcached&quot;;
-  else
-    local le=&quot;libevent-2.0.21-stable&quot;;
-    local mc=&quot;memcached-1.4.16&quot;;
-    c_dependency -m &quot;b2405cc9ebf264aa47ff615d9de527a2&quot; \
-      &quot;libevent&quot; &quot;${le}&quot; \
-      &quot;http://github.com/downloads/libevent/libevent/${le}.tar.gz&quot;;
-    c_dependency -m &quot;1c5781fecb52d70b615c6d0c9c140c9c&quot; \
-      &quot;memcached&quot; &quot;${mc}&quot; \
-      &quot;http://www.memcached.org/files/${mc}.tar.gz&quot;;
-    # &quot;http://memcached.googlecode.com/files/${mc}.tar.gz&quot;;
-  fi;
-
-  if type -P postgres &gt; /dev/null; then
-    using_system &quot;Postgres&quot;;
-  else
-    local v=&quot;9.3.1&quot;;
-    local n=&quot;postgresql&quot;;
-    local p=&quot;${n}-${v}&quot;;
-
-    if type -P dtrace &gt; /dev/null; then
-      local enable_dtrace=&quot;--enable-dtrace&quot;;
-    else
-      local enable_dtrace=&quot;&quot;;
-    fi;
-
-    c_dependency -m &quot;c003d871f712d4d3895956b028a96e74&quot; \
-      &quot;PostgreSQL&quot; &quot;${p}&quot; \
-      &quot;http://ftp.postgresql.org/pub/source/v${v}/${p}.tar.bz2&quot; \
-      --with-python ${enable_dtrace};
-  fi;
-
-  if find_header ldap.h 20428 LDAP_VENDOR_VERSION; then
-    using_system &quot;OpenLDAP&quot;;
-  else
-    local v=&quot;2.4.38&quot;;
-    local n=&quot;openldap&quot;;
-    local p=&quot;${n}-${v}&quot;;
-    c_dependency -m &quot;39831848c731bcaef235a04e0d14412f&quot; \
-      &quot;OpenLDAP&quot; &quot;${p}&quot; \
-      &quot;http://www.openldap.org/software/download/OpenLDAP/${n}-release/${p}.tgz&quot; \
-      --disable-bdb --disable-hdb;
-  fi;
-
-  if find_header ffi/ffi.h; then
-    using_system &quot;libffi&quot;;
-  else
-    c_dependency -m &quot;45f3b6dbc9ee7c7dfbbbc5feba571529&quot; \
-      &quot;libffi&quot; &quot;libffi-3.0.13&quot; \
-      &quot;ftp://sourceware.org/pub/libffi/libffi-3.0.13.tar.gz&quot;
-  fi;
-
-  #
-  # Python dependencies
-  #
-
-  # First, let's make sure that we ourselves are on PYTHONPATH, in case some
-  # code (like, let's say, trial) decides to chdir somewhere.
-  export PYTHONPATH=&quot;${wd}:${PYTHONPATH:-}&quot;;
-
-  # Sourceforge mirror hostname.
-  local sf=&quot;superb-sea2.dl.sourceforge.net&quot;;
-  local st=&quot;setuptools-1.4&quot;;
-  local pypi=&quot;http://pypi.python.org/packages/source&quot;;
-
-  py_dependency -v 1 -m &quot;5710464bc5a61d75f5087f15ce63cfe0&quot; \
-    &quot;setuptools&quot; &quot;setuptools&quot; &quot;${st}&quot; \
-    &quot;$pypi/s/setuptools/${st}.tar.gz&quot;;
-
-  local v=&quot;0.6&quot;;
-  local n=&quot;cffi&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v &quot;0.6&quot; -m &quot;5be33b1ab0247a984d42b27344519337&quot; \
-    &quot;${n}&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;${pypi}/c/${n}/${p}.tar.gz&quot;;
-
-  local v=&quot;2.10&quot;;
-  local n=&quot;pycparser&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v &quot;0.6&quot; -m &quot;d87aed98c8a9f386aa56d365fe4d515f&quot; \
-    &quot;${n}&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;${pypi}/p/${n}/${p}.tar.gz&quot;;
-
-  local v=&quot;4.0.5&quot;;
-  local n=&quot;zope.interface&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v 4 -m &quot;caf26025ae1b02da124a58340e423dfe&quot; \
-    &quot;Zope Interface&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;http://pypi.python.org/packages/source/z/${n}/${p}.zip&quot;;
-
-  local v=&quot;0.12&quot;;
-  local n=&quot;pyOpenSSL&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v 0.12 -m &quot;60a7bbb6160950823eddcbba2cbcb0d6&quot; \
-    &quot;${n}&quot; &quot;OpenSSL&quot; &quot;${p}&quot; \
-    &quot;http://pypi.python.org/packages/source/p/${n}/${p}.tar.gz&quot;;
-
-  local n=&quot;PyKerberos&quot;;
-  if type -P krb5-config &gt; /dev/null; then
-    local v=&quot;9409&quot;;
-    local p=&quot;${n}-${v}&quot;;
-    py_dependency -r &quot;${v}&quot; \
-      &quot;${n}&quot; &quot;kerberos&quot; &quot;${p}&quot; \
-      &quot;${svn_uri_base}/${n}/trunk&quot;;
-  fi;
-
-  local v=&quot;0.6.4&quot;;
-  local n=&quot;xattr&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v 0.6 -m &quot;1bef31afb7038800f8d5cfa2f4562b37&quot; \
-    &quot;${n}&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;${pypi}/x/${n}/${n}-${v}.tar.gz&quot;;
-
-  if [ -n &quot;${ORACLE_HOME:-}&quot; ]; then
-    local v=&quot;5.1.2&quot;;
-    local n=&quot;cx_Oracle&quot;;
-    local p=&quot;${n}-${v}&quot;;
-    py_dependency -v &quot;${v}&quot; -m &quot;462f309e00f7bff7100e2077fc43172c&quot; \
-      &quot;${n}&quot; &quot;${n}&quot; &quot;${p}&quot; \
-      &quot;http://${sf}/project/cx-oracle/${v}/${p}.tar.gz&quot;;
-  fi;
-
-  local v=&quot;4.1.1&quot;;
-  local n=&quot;PyGreSQL&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v &quot;${v}&quot; -m &quot;71d0b8c5a382f635572eb52fee47cd08&quot; \
-    &quot;${n}&quot; &quot;pgdb&quot; &quot;${p}&quot; \
-    &quot;${pypi}/P/${n}/${p}.tgz&quot;;
-
-  local v=&quot;0.1.2&quot;;
-  local n=&quot;sqlparse&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v &quot;${v}&quot; -s &quot;978874e5ebbd78e6d419e8182ce4fb3c30379642&quot; \
-    &quot;SQLParse&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;http://python-sqlparse.googlecode.com/files/${p}.tar.gz&quot;;
-
-  local v=&quot;2.6.1&quot;;
-  local n=&quot;pycrypto&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v &quot;${v}&quot; -m &quot;55a61a054aa66812daf5161a0d5d7eda&quot; \
-    &quot;PyCrypto&quot; &quot;Crypto&quot; &quot;${p}&quot; \
-    &quot;http://ftp.dlitz.net/pub/dlitz/crypto/${n}/${p}.tar.gz&quot;;
-
-  local v=&quot;0.1.7&quot;;
-  local n=&quot;pyasn1&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v &quot;${v}&quot; -m &quot;2cbd80fcd4c7b1c82180d3d76fee18c8&quot; \
-    &quot;${n}&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;${pypi}/p/${n}/${p}.tar.gz&quot;;
-
-  local v=&quot;13.2.0&quot;;
-  local n=&quot;Twisted&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v 13.2 -m &quot;83fe6c0c911cc1602dbffb036be0ba79&quot; \
-    &quot;${n}&quot; &quot;twisted&quot; &quot;${p}&quot; \
-    &quot;${pypi}/T/${n}/${p}.tar.bz2&quot;;
-
-  local v=&quot;12414&quot;;
-  local n=&quot;twext&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -fe -r &quot;${v}&quot; \
-    &quot;${n}&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;${svn_uri_base}/${n}/trunk&quot;;
-
-  local v=&quot;1.5&quot;;
-  local n=&quot;python-dateutil&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -m &quot;35f3732db3f2cc4afdc68a8533b60a52&quot; \
-    &quot;${n}&quot; &quot;dateutil&quot; &quot;${p}&quot; \
-    &quot;http://www.labix.org/download/${n}/${p}.tar.gz&quot;;
-
-  local v=&quot;1.2.0&quot;;
-  local n=&quot;psutil&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -m &quot;f8ae906249e65db21f17d873ae07e584&quot; \
-    &quot;${n}&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;${pypi}/p/${n}/${p}.tar.gz&quot;;
-
-  local v=&quot;2.4.13&quot;;
-  local n=&quot;python-ldap&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v &quot;${v}&quot; -m &quot;74b7b50267761540451eade44b2049ee&quot; \
-    &quot;Python-LDAP&quot; &quot;ldap&quot; &quot;${p}&quot; \
-    &quot;${pypi}/p/${n}/${p}.tar.gz&quot;;
-
-  local v=&quot;12724&quot;;
-  local n=&quot;PyCalendar&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -fe -i &quot;src&quot; -r &quot;${v}&quot; \
-    &quot;${n}&quot; &quot;pycalendar&quot; &quot;${p}&quot; \
-    &quot;${svn_uri_base}/${n}/trunk&quot;;
-
-  # Can't add &quot;-v 2011g&quot; to args because the version check expects numbers.
-  local v=&quot;2013.8&quot;;
-  local n=&quot;pytz&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -m &quot;37750ca749ed3a52523b9682b0b7e381&quot; \
-    &quot;${n}&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;${pypi}/p/${n}/${p}.tar.gz&quot;;
-
-  #
-  # Tool dependencies.  The code itself doesn't depend on these, but
-  # they are useful to developers.
-  #
-
-  if type -P pyflakes &gt; /dev/null; then
-    using_system &quot;PyFlakes&quot;;
-  else
-    local v=&quot;0.6.1&quot;;
-    local n=&quot;pyflakes&quot;;
-    local p=&quot;${n}-${v}&quot;;
-    py_dependency -v &quot;${v}&quot; -m &quot;00debd2280b962e915dfee552a675915&quot; \
-      &quot;Pyflakes&quot; &quot;${n}&quot; &quot;${p}&quot; \
-      &quot;${pypi}/p/${n}/${p}.tar.gz&quot;;
-  fi;

-  local v=&quot;12068&quot;;
-  local n=&quot;CalDAVClientLibrary&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -o -r &quot;${v}&quot; \
-    &quot;${n}&quot; &quot;caldavclientlibrary&quot; &quot;${p}&quot; \
-    &quot;${svn_uri_base}/${n}/trunk&quot;;
-
-  local v=&quot;1.1.8&quot;;
-  local n=&quot;setproctitle&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -v &quot;1.0&quot; -m &quot;728f4c8c6031bbe56083a48594027edd&quot; \
-    &quot;${n}&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;${pypi}/s/${n}/${p}.tar.gz&quot;;
-
-  svn_get &quot;CalDAVTester&quot; &quot;${top}/CalDAVTester&quot; \
-      &quot;${svn_uri_base}/CalDAVTester/trunk&quot; HEAD;
-
-  local v=&quot;3.0.1&quot;;
-  local n=&quot;epydoc&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -o -m &quot;36407974bd5da2af00bf90ca27feeb44&quot; \
-    &quot;Epydoc&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;${pypi}/e/${n}/${p}.tar.gz&quot;;
-
-  local v=&quot;0.10.0&quot;;
-  local n=&quot;Nevow&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -o -m &quot;66dda2ad88f42dea05911add15f4d1b2&quot; \
-    &quot;${n}&quot; &quot;nevow&quot; &quot;${p}&quot; \
-    &quot;${pypi}/N/${n}/${p}.tar.gz&quot;;
-
-  local v=&quot;0.5b1&quot;;
-  local n=&quot;pydoctor&quot;;
-  local p=&quot;${n}-${v}&quot;;
-  py_dependency -o -m &quot;c4fb33672f37624116cc7a0606f74f28&quot; \
-    &quot;${n}&quot; &quot;${n}&quot; &quot;${p}&quot; \
-    &quot;{$pypi}/p/${n}/${p}.tar.gz&quot;;
-
-  if &quot;${do_setup}&quot;; then
-    cd &quot;${caldav}&quot;;
-    echo &quot;Building our own extension modules...&quot;;
-    &quot;${python}&quot; setup.py build_ext --inplace;
-  fi;
-}
-
-# Actually do the initialization, once all functions are defined.
-init_build;
</del></span></pre></div>
<a id="CalendarServertrunksupportpysh"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/support/py.sh (12987 => 12988)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/support/py.sh        2014-03-21 19:47:59 UTC (rev 12987)
+++ CalendarServer/trunk/support/py.sh        2014-03-21 19:51:51 UTC (rev 12988)
</span><span class="lines">@@ -1,205 +0,0 @@
</span><del>-# -*- sh-basic-offset: 2 -*-
-##
-# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##
-
-set -e
-set -u
-
-# Echo the major.minor version of the given Python interpreter.
-
-py_version () {
-  local python=&quot;$1&quot;; shift;
-  echo &quot;$(&quot;${python}&quot; -c &quot;from distutils.sysconfig import get_python_version; print get_python_version()&quot;)&quot;;
-}
-
-# Test if a particular python interpreter is available, given the full path to
-# that interpreter.
-
-try_python () {
-  local python=&quot;$1&quot;; shift;
-
-  if [ -z &quot;${python}&quot; ]; then
-    return 1;
-  fi;
-
-  if ! type &quot;${python}&quot; &gt; /dev/null 2&gt;&amp;1; then
-    return 1;
-  fi;
-
-  local py_version=&quot;$(py_version &quot;${python}&quot;)&quot;;
-  if [ &quot;${py_version/./}&quot; -lt &quot;25&quot; ]; then
-    return 1;
-  fi;
-  return 0;
-}
-
-
-# Detect which version of Python to use, then print out which one was detected.
-
-detect_python_version () {
-  local v;
-  local p;
-  for v in &quot;2.7&quot; &quot;2.6&quot; &quot;&quot;
-  do
-    for p in                                                            \
-      &quot;${PYTHON:=}&quot;                                                     \
-      &quot;python${v}&quot;                                                      \
-      &quot;/usr/local/bin/python${v}&quot;                                       \
-      &quot;/usr/local/python/bin/python${v}&quot;                                \
-      &quot;/usr/local/python${v}/bin/python${v}&quot;                            \
-      &quot;/opt/bin/python${v}&quot;                                             \
-      &quot;/opt/python/bin/python${v}&quot;                                      \
-      &quot;/opt/python${v}/bin/python${v}&quot;                                  \
-      &quot;/Library/Frameworks/Python.framework/Versions/${v}/bin/python&quot;   \
-      &quot;/opt/local/bin/python${v}&quot;                                       \
-      &quot;/sw/bin/python${v}&quot;                                              \
-      ;
-    do
-      if try_python &quot;${p}&quot;; then
-        echo &quot;${p}&quot;;
-        return 0;
-      fi;
-    done;
-  done;
-  return 1;
-}
-
-# Detect if the given Python module is installed in the system Python configuration.
-py_have_module () {
-  local version=&quot;&quot;; # Minimum version required
-
-  OPTIND=1;
-  while getopts &quot;v:&quot; option; do
-    case &quot;${option}&quot; in
-      'v') version=&quot;${OPTARG}&quot;; ;;
-    esac;
-  done;
-  shift $((${OPTIND} - 1));
-
-  local module=&quot;$1&quot;; shift;
-
-  if ! &quot;${python}&quot; -c &quot;import ${module}&quot; &gt; /dev/null 2&gt;&amp;1; then
-    return 1;
-  fi;
-
-  local result=0;
-
-  if [ -n &quot;${version}&quot; ]; then
-    local symbol;
-    for symbol in &quot;xxxx&quot; &quot;__version__&quot; &quot;version&quot;; do
-      if module_version=&quot;$(
-        &quot;${python}&quot; -c \
-        'print __import__(&quot;'&quot;${module}&quot;'&quot;).'&quot;$symbol&quot;';' \
-        2&gt;/dev/null
-      )&quot;; then
-        break;
-      fi;
-    done;
-
-    if [ -z &quot;${module_version}&quot; ]; then
-      module_version=$(&quot;${python}&quot; -c 'import pkg_resources; print pkg_resources.get_distribution(&quot;'&quot;${module}&quot;'&quot;).version;');
-    fi;
-    if [ -z &quot;${module_version}&quot; ]; then
-      if ! &quot;${print_path}&quot;; then
-        echo &quot;Unable to determine version for ${module}.&quot;;
-      fi;
-      result=1;
-    elif ! cmp_version &quot;${version}&quot; &quot;${module_version}&quot;; then
-      if ! &quot;${print_path}&quot;; then
-        echo &quot;A system version of ${module} exists, but version is ${module_version} (&lt; ${version}).&quot;;
-      fi;
-      result=1;
-    fi;
-  fi;
-
-  return ${result};
-}
-
-# Compare version numbers
-
-cmp_version () {
-  local  v=&quot;$1&quot;; shift;
-  local mv=&quot;$1&quot;; shift;
-
-  local result;
-
-  while true; do
-     vh=&quot;${v%%.*}&quot;; # Get highest-order segment
-    mvh=&quot;${mv%%.*}&quot;;
-
-    if [ &quot;${vh}&quot; -gt &quot;${mvh}&quot; ]; then
-      result=1;
-      break;
-    fi;
-
-    if [ &quot;${vh}&quot; -lt &quot;${mvh}&quot; ]; then
-      result=0;
-      break;
-    fi;
-
-    if [ &quot;${v}&quot; == &quot;${v#*.}&quot; ]; then
-      # No dots left, so we're ok
-      result=0;
-      break;
-    fi;
-
-    if [ &quot;${mv}&quot; == &quot;${mv#*.}&quot; ]; then
-      # No dots left, so we're not gonna match
-      result=1;
-      break;
-    fi;
-
-     v=&quot;${v#*.}&quot;;
-    mv=&quot;${mv#*.}&quot;;
-  done;
-
-  return ${result};
-}
-
-# Detect which python to use, and store it in the 'python' variable, as well as
-# setting up variables related to version and build configuration.
-
-init_py () {
-  # First, detect the appropriate version of Python to use, based on our version
-  # requirements and the environment.  Note that all invocations of python in
-  # our build scripts should therefore be '&quot;${python}&quot;', not 'python'; this is
-  # important on systems with older system pythons (2.4 or earlier) with an
-  # alternate install of Python, or alternate python installation mechanisms
-  # like virtualenv.
-  python=&quot;$(detect_python_version)&quot;;
-
-  # Set the $PYTHON environment variable to an absolute path pointing at the
-  # appropriate python executable, a standard-ish mechanism used by certain
-  # non-distutils things that need to find the &quot;right&quot; python.  For instance,
-  # the part of the PostgreSQL build process which builds pl_python.  Note that
-  # detect_python_version, above, already honors $PYTHON, so if this is already
-  # set it won't be stomped on, it will just be re-set to the same value.
-  export PYTHON=&quot;$(type -p ${python})&quot;;
-
-  if [ -z &quot;${python:-}&quot; ]; then
-    echo &quot;No suitable python found. Python 2.6 is required.&quot;;
-    exit 1;
-  fi
-
-          py_platform=&quot;$(&quot;${python}&quot; -c &quot;from distutils.util import get_platform; print get_platform()&quot;)&quot;;
-           py_version=&quot;$(py_version &quot;${python}&quot;)&quot;;
-   py_platform_libdir=&quot;lib.${py_platform}-${py_version}&quot;;
-  py_platform_scripts=&quot;scripts-${py_version}&quot;;
-            py_prefix=&quot;$(&quot;${python}&quot; -c &quot;import sys; print sys.prefix;&quot;)&quot;;
-            py_libdir=&quot;$(&quot;${python}&quot; -c &quot;from distutils.sysconfig import get_python_lib; print get_python_lib(1);&quot;)&quot;;
-}
-
-init_py;
</del></span></pre>
</div>
</div>

</body>
</html>