<!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>[13339] 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/13339">13339</a></dd>
<dt>Author</dt> <dd>wsanchez@apple.com</dd>
<dt>Date</dt> <dd>2014-04-19 12:25:10 -0700 (Sat, 19 Apr 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Work on internal build thingos</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunksupportApplemake">CalendarServer/trunk/support/Apple.make</a></li>
<li><a href="#CalendarServertrunksupport_cache_deps">CalendarServer/trunk/support/_cache_deps</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#CalendarServertrunkrequirementsappletxt">CalendarServer/trunk/requirements-apple.txt</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkrequirementsappletxt"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/requirements-apple.txt (0 => 13339)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/requirements-apple.txt         (rev 0)
+++ CalendarServer/trunk/requirements-apple.txt        2014-04-19 19:25:10 UTC (rev 13339)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+-e svn+https://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk@13325#egg=CalendarServer-6.0b.trunk_r13316_13321-py2.7-dev_r13325
+PyGreSQL==4.1.1
+Twisted==13.2.0
+cffi==0.8.2
+funcparserlib==0.3.6
+-e svn+http://svn.calendarserver.org/repository/calendarserver/PyKerberos/trunk@13311#egg=kerberos-1.1.1-py2.7-dev_r13311
+psutil==2.1.0
+pyasn1==0.1.7
+pycparser==2.10
+pycrypto==2.6.1
+python-ldap==2.4.15
+setproctitle==1.1.8
+sqlparse==0.1.2
+-e svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk@13311#egg=twextpy-0.1b.trunk_r13311-py2.7-dev_r13311
+wheel==0.23.0
+--editable svn+http://svn.calendarserver.org/repository/calendarserver/PyCalendar/trunk@13311#egg=pycalendar
</ins><span class="cx">Property changes on: CalendarServer/trunk/requirements-apple.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="CalendarServertrunksupportApplemake"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/support/Apple.make (13338 => 13339)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/support/Apple.make        2014-04-19 16:02:21 UTC (rev 13338)
+++ CalendarServer/trunk/support/Apple.make        2014-04-19 19:25:10 UTC (rev 13339)
</span><span class="lines">@@ -43,9 +43,11 @@
</span><span class="cx"> CALDAVDSUBDIR = /caldavd
</span><span class="cx">
</span><span class="cx"> PYTHON = $(USRBINDIR)/python2.7
</span><del>-CS_SHAREDIR = $(SHAREDIR)$(CALDAVDSUBDIR)
-CS_PY_LIBS = $(CS_SHAREDIR)/lib/python
-CS_LIBEXEC = $(SIPP)$(LIBEXECDIR)$(CALDAVDSUBDIR)
</del><ins>+CS_VIRTUALENV = $(SIPP)$(NSLOCALDIR)$(NSLIBRARYSUBDIR)/CalendarServer
+
+# CS_SHAREDIR = $(SHAREDIR)$(CALDAVDSUBDIR)
+# CS_PY_LIBS = $(CS_SHAREDIR)/lib/python
+# CS_LIBEXEC = $(SIPP)$(LIBEXECDIR)$(CALDAVDSUBDIR)
</ins><span class="cx"> # PY_INSTALL_FLAGS = --root="$(DSTROOT)" --prefix="$(SIPP)" --install-lib="$(CS_PY_LIBS)" --install-scripts="$(CS_LIBEXEC)"
</span><span class="cx"> # CS_INSTALL_FLAGS = --install-scripts="$(SIPP)$(USRSBINDIR)" --install-data="$(SIPP)$(ETCDIR)"
</span><span class="cx"> # CS_BUILD_EXT_FLAGS = --include-dirs="$(SIPP)/usr/include" --library-dirs="$(SIPP)/usr/lib"
</span><span class="lines">@@ -60,33 +62,71 @@
</span><span class="cx"> .phony: build install install_source install-ossfiles cache_deps buildit
</span><span class="cx">
</span><span class="cx"> build:: $(BuildDirectory)/$(Project)
</span><del>-        # @echo "Building $(Project)...";
-        # $(_v) cd $(BuildDirectory)/$(Project) && $(Environment) $(PYTHON) setup.py build
</del><span class="cx">
</span><del>-install:: build
-        # $(_v) cd $(BuildDirectory)/$(Project) && \
-        #         $(Environment) $(PYTHON) setup.py \
-        #         build_ext $(CS_BUILD_EXT_FLAGS) \
-        #         install $(PY_INSTALL_FLAGS) $(CS_INSTALL_FLAGS) \
-        #        
</del><ins>+build-no::
+        @echo "Building $(Project)...";
+        $(_v) cd $(BuildDirectory)/$(Project) && $(Environment) $(PYTHON) setup.py build
+
+install:: install-python
+install-python:: build
+        @#
+        @# Set up a virtual environment in Server.app; we'll install into that.
+        @# Use --system-site-packages so that we use the packages provided by the OS.
+        @#
+        @echo "Creating virtual environment...";
+        $(_v) $(RMDIR) "$(DSTROOT)$(CS_VIRTUALENV)";
+        $(_v) $(PYTHON) -m virtualenv --system-site-packages "$(DSTROOT)$(CS_VIRTUALENV)";
+        @#
+        @# Use the pip in the virtual environment to install.
+        @# It knows about where things go in the virtual environment.
+        @#
</ins><span class="cx">         @echo "Installing Python packages...";
</span><del>-        $(_v) $(PYTHON) -m pip install \
-          --pre --allow-all-external --no-index \
- --find-links "$(Sources)/.develop/pip_downloads" \
-         --editable "$(BuildDirectory)/$(Project)[OpenDirectory,Postgres]" \
-                --install-option --root="$(DSTROOT)" \
-                --install-option --prefix="$(SIPP)" \
-                --install-option --install-lib="$(CS_PY_LIBS)" \
-                --install-option --install-scripts="$(CS_LIBEXEC)" \
-               
-        @echo "Cleaning up...";
-        $(_v) for so in $$(find "$(DSTROOT)$(CS_SHAREDIR)/lib" -type f -name '*.so'); do $(STRIP) -Sx "$${so}"; done;
-        $(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(SIPP)$(ETCDIR)$(CALDAVDSUBDIR)";
-        $(_v) $(INSTALL_FILE) "$(Sources)/conf/caldavd-apple.plist" "$(DSTROOT)$(SIPP)$(ETCDIR)$(CALDAVDSUBDIR)/caldavd-apple.plist";
-        $(_v) chmod -R ugo+r "$(DSTROOT)$(CS_SHAREDIR)";
-        $(_v) for f in $$(find "$(DSTROOT)$(SIPP)$(ETCDIR)" -type f ! -name '*.default'); do cp "$${f}" "$${f}.default"; done;
</del><ins>+        $(_v) "$(DSTROOT)$(CS_VIRTUALENV)/bin/pip" install \
+ --pre --allow-all-external --no-index \
+ --find-links="$(Sources)/.develop/pip_downloads" \
+         --requirement="$(BuildDirectory)/$(Project)/requirements-apple.txt" \
+         ;
+        @#
+        @# Make the virtualenv relocatable
+        @#
+        @echo "Making virtual environment relocatable...";
+        $(PYTHON) -m virtualenv --relocatable "$(DSTROOT)$(CS_VIRTUALENV)";
+        @#
+        @# Clean up
+        @#
+        @echo "Cleaning up virtual environment...";
+        $(_v) $(FIND) "$(DSTROOT)$(CS_VIRTUALENV)" -type d -name .svn -print0 | xargs -0 rm -rf;
+        $(_v) $(FIND) "$(DSTROOT)$(CS_VIRTUALENV)" -type f -name '*.so' -print0 | xargs -0 $(STRIP) -Sx;
+        $(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(CS_VIRTUALENV)/etc";
+        $(_v) $(INSTALL_FILE) "$(Sources)/conf/caldavd-apple.plist" "$(DSTROOT)$(CS_VIRTUALENV)/etc/caldavd.plist";
</ins><span class="cx">
</span><del>-install::
</del><ins>+
+# install-oldish::
+#         @echo "Installing Python packages...";
+#         $(_v) $(PYTHON) -m pip install \
+# --pre --allow-all-external --no-index \
+# --find-links "$(Sources)/.develop/pip_downloads" \
+#          --editable "$(BuildDirectory)/$(Project)[OpenDirectory,Postgres]" \
+#                 --install-option --root="$(DSTROOT)" \
+#                 --install-option --prefix="$(SIPP)" \
+#                 --install-option --install-lib="$(CS_PY_LIBS)" \
+#                 --install-option --install-scripts="$(CS_LIBEXEC)" \
+#                 --ignore-installed                                                                                                        \
+#                
+#         $(_v) cd $(BuildDirectory)/$(Project) && \
+#                 $(Environment) $(PYTHON) setup.py \
+#                 build_ext $(CS_BUILD_EXT_FLAGS) \
+#                 install $(PY_INSTALL_FLAGS) $(CS_INSTALL_FLAGS) \
+#                
+#         @echo "Cleaning up...";
+#         $(_v) for so in $$(find "$(DSTROOT)$(CS_SHAREDIR)/lib" -type f -name '*.so'); do $(STRIP) -Sx "$${so}"; done;
+#         $(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(SIPP)$(ETCDIR)$(CALDAVDSUBDIR)";
+#         $(_v) $(INSTALL_FILE) "$(Sources)/conf/caldavd-apple.plist" "$(DSTROOT)$(SIPP)$(ETCDIR)$(CALDAVDSUBDIR)/caldavd-apple.plist";
+#         $(_v) chmod -R ugo+r "$(DSTROOT)$(CS_SHAREDIR)";
+#         $(_v) for f in $$(find "$(DSTROOT)$(SIPP)$(ETCDIR)" -type f ! -name '*.default'); do cp "$${f}" "$${f}.default"; done;
+
+# install:: install-man
+install-man::
</ins><span class="cx">         @echo "Installing manual pages...";
</span><span class="cx">         $(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(SIPP)$(MANDIR)/man8";
</span><span class="cx">         $(_v) $(INSTALL_FILE) "$(Sources)/doc/caldavd.8" "$(DSTROOT)$(SIPP)$(MANDIR)/man8";
</span><span class="lines">@@ -100,20 +140,23 @@
</span><span class="cx">         $(_v) $(INSTALL_FILE) "$(Sources)/doc/calendarserver_manage_timezones.8" "$(DSTROOT)$(SIPP)$(MANDIR)/man8";
</span><span class="cx">         $(_v) gzip -9 -f "$(DSTROOT)$(SIPP)$(MANDIR)/man8/"*.[0-9];
</span><span class="cx">
</span><del>-install::
</del><ins>+# install:: install-launchd
+install-launchd::
</ins><span class="cx">         @echo "Installing launchd config...";
</span><span class="cx">         $(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(NSLOCALDIR)/$(NSLIBRARYSUBDIR)/Server/Calendar and Contacts";
</span><span class="cx">         $(_v) $(INSTALL_DIRECTORY) -o "$(CS_USER)" -g "$(CS_GROUP)" -m 0755 "$(DSTROOT)$(VARDIR)/log$(CALDAVDSUBDIR)";
</span><span class="cx">         $(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(SIPP)$(NSLIBRARYDIR)/LaunchDaemons";
</span><span class="cx">         $(_v) $(INSTALL_FILE) "$(Sources)/contrib/launchd/calendarserver.plist" "$(DSTROOT)$(SIPP)$(NSLIBRARYDIR)/LaunchDaemons/org.calendarserver.calendarserver.plist";
</span><span class="cx">
</span><del>-install::
</del><ins>+# install:: install-changeip
+install-changeip::
</ins><span class="cx">         @echo "Installing changeip script...";
</span><span class="cx">         $(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)$(SIPP)$(LIBEXECDIR)/changeip";
</span><span class="cx">         $(_v) $(INSTALL_FILE) "$(Sources)/calendarserver/tools/changeip_calendar.py" "$(DSTROOT)$(SIPP)$(LIBEXECDIR)/changeip/changeip_calendar.py";
</span><span class="cx">         $(_v) chmod ugo+x "$(DSTROOT)$(SIPP)$(LIBEXECDIR)/changeip/changeip_calendar.py";
</span><span class="cx">
</span><del>-install::
</del><ins>+# install:: install-caldavtester
+install-caldavtester::
</ins><span class="cx">         @echo "Installing CalDAVTester package...";
</span><span class="cx">         $(_v) $(INSTALL_DIRECTORY) "$(DSTROOT)/AppleInternal/ServerTools";
</span><span class="cx">         $(_v) cd "$(DSTROOT)/AppleInternal/ServerTools" && unzip "$(BuildDirectory)/$(Project)/requirements/cache/CalDAVTester-*.zip";
</span></span></pre></div>
<a id="CalendarServertrunksupport_cache_deps"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/support/_cache_deps (13338 => 13339)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/support/_cache_deps        2014-04-19 16:02:21 UTC (rev 13338)
+++ CalendarServer/trunk/support/_cache_deps        2014-04-19 19:25:10 UTC (rev 13339)
</span><span class="lines">@@ -42,17 +42,13 @@
</span><span class="cx"> init_build;
</span><span class="cx"> c_dependencies;
</span><span class="cx">
</span><del>-requirements="${wd}/requirements.txt";
</del><ins>+requirements="${wd}/requirements-apple.txt";
</ins><span class="cx"> #extra_features="$("${python}" -c 'import setup; print ",".join(sorted(setup.extras_requirements.keys()))' | sed 's|Oracle,||')";
</span><span class="cx"> extra_features="OpenDirectory,Postgres";
</span><del>-cs_repos="svn+http://svn.calendarserver.org/repository/calendarserver";
</del><span class="cx">
</span><span class="cx"> ruler "Downloading Python requirements for .[${extra_features}]";
</span><span class="cx"> echo "";
</span><span class="cx"> pip_download \
</span><span class="cx"> --allow-unverified cx-Oracle \
</span><del>- --editable="${cs_repos}/twext/trunk#egg=twextpy" \
- --editable="${cs_repos}/PyKerberos/trunk#egg=kerberos" \
- --editable="${cs_repos}/PyCalendar/trunk#egg=pycalendar" \
- --editable=".[${extra_features}]" \
</del><ins>+ --requirement="${requirements}" \
</ins><span class="cx"> ;
</span></span></pre>
</div>
</div>
</body>
</html>