| 2 | |
| 3 | == Subversion the easy way == |
| 4 | |
| 5 | If you are using Python 2.5.x (from http://python.org/download/ or pre-installed on Leopard) and either use Apache 2.2.4 or don't need `mod_dav_svn`, your best bet is going to be get the [http://downloads.open.collab.net/binaries.html opencollab precompiled Subversion]. It has a nice installer and in my experience ''just works''. You will still need to install the other prereqs as detailed in the [#Otherprerequisites section after next]. |
| 6 | |
| 7 | Its Python modules seem to work with Python 2.3.5 on Tiger but emit several warnings about a C api mismatch on startup (they still pass the Trac tests though). If you want seamless integration with 2.3 or Apache 2.0, read on. |
| 8 | |
| 9 | == Subversion the slightly harder way == |
| 10 | |
| 11 | These instructions are written specifically for building Python 2.3 bindings when you have another Python (say 2.5) installed as default. Adjust the instances of python2.3 for another Python as appropriate (specify path if necessary). This will install under `/usr/local` which allows it to coexist with the opencollab bindings, above. |
| 12 | |
| 13 | Note 1: These steps require using the Terminal (`/Applications/Utilities/Terminal.app`). Some basic commands are left out, namely extracting (for `.tgz` or `.tar.gz`, `tar -xvzf FILENAME_HERE`; for `.tbz2` or `.tar.bz2`, `tar -xvjf FILENAME_HERE`) and directory changing. You also must be in the `admin` group, so you can run `sudo`. If you need help with these steps, just hop on our IrcChannel. |
| 14 | |
| 15 | Note 2: if you have a muscle memory to use `wget` to download things, you can either [http://www.statusq.org/archives/2005/02/22/610 install it] or set up a quick bash function that'll do the equivalent with curl: |
| 16 | |
| 17 | {{{ |
| 18 | $ alias wget="curl -O" |
| 19 | }}} |
| 20 | |
| 21 | Note 3: if you want to use Apache 2.0, [http://developer.apple.com/tools/subversionxcode.html go ahead and build it separately]. You will lose the ability to start/stop it in the Sharing pane though. Apache 2.2 comes with Leopard and `mod_dav_svn` can evidently be built against that without recompiling Apache. However the package above comes with a precompiled 2.2 module that may work. |
| 22 | |
| 23 | Let's begin. |
| 24 | |
| 25 | 1. If you're on Tiger, get the [https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=19681 XCode 2.4.1 dmg] (free ADC login required, check bugmenot) and install it. XCode 2.5 seems to have a [http://osflash.org/pipermail/swfmill_osflash.org/2008-January/001665.html broken/missing libtool on Tiger]. If on Leopard, use XCode 3.0, it should work correctly. ('''FIXME: Verify''') |
| 26 | |
| 27 | 2. [http://www.swig.org/download.html Download] and build SWIG. |
| 28 | |
| 29 | {{{ |
| 30 | $ ./configure --with-python=python2.3 |
| 31 | $ make |
| 32 | $ sudo make install |
| 33 | }}} |
| 34 | |
| 35 | With version 1.3.34, this took under 4 minutes on a lowly G4. |
| 36 | |
| 37 | 3. [http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&expandFolder=74 Download] and extract both `subversion` and `subversion-deps` from the same folder. They will end up overlaying. |
| 38 | |
| 39 | {{{ |
| 40 | $ ./configure --without-berkeley-db --with-ssl --with-zlib PYTHON=python2.3 |
| 41 | $ make |
| 42 | $ make swig-py |
| 43 | $ sudo make install install-swig-py |
| 44 | }}} |
| 45 | |
| 46 | The configure step is recursive and may look like it is looping. Just let it sit for a while and **be patient**. Expect a message at the end of configure about not being build with bdb support. That's fine, you don't want bdb anyway! |
| 47 | |
| 48 | If you want to build `mod_dav_svn`, you need to add some additional arguments here, check [http://developer.apple.com/tools/subversionxcode.html the Apple install doc] for examples as you will want to use the `apxs` and `apr` options from it.. |
| 49 | |
| 50 | With Subversion 1.4.6, the `make` steps took approximately 15 minutes each on a lowly G4. |
| 51 | |
| 52 | 4. Add the svn bindings to your `$PYTHONPATH`. The easiest way to do this is detailed in [http://svn.collab.net/repos/svn/trunk/subversion/bindings/swig/INSTALL the install doc] for Subversion: |
| 53 | |
| 54 | {{{ |
| 55 | $ echo /usr/local/lib/svn-python > /Library/Python/2.3/site-packages/svn-python.pth |
| 56 | }}} |
| 57 | |
| 58 | If you are not using the bundled 2.3, figure out where your site-packages directory lives: |
| 59 | |
| 60 | {{{ |
| 61 | $ python -c 'import site; print site.sitedirs[0]' |
| 62 | }}} |
| 63 | |
| 64 | 5. Enjoy! |
| 65 | |
| 66 | == Other prerequisites == |
| 67 | |
| 68 | 1. setuptools (required for 0.11, doesn't hurt for 0.10) |
| 69 | |
| 70 | {{{ |
| 71 | $ wget http://peak.telecommunity.com/dist/ez_setup.py |
| 72 | $ sudo python2.3 ez_setup.py |
| 73 | }}} |
| 74 | |
| 75 | Then add `/System/Library/Frameworks/Python.framework/Versions/2.3/bin` to '''the end''' of your path (presuming you want a coresident 2.5 to be primary, and will suffix all commands with the Python version). |
| 76 | |
| 77 | {{{ |
| 78 | echo 'PATH="${PATH}:/System/Library/Frameworks/Python.framework/Versions/2.3/bin"' >> ~/.bash_profile |
| 79 | echo 'export PATH' >> ~/.bash_profile |
| 80 | }}} |
| 81 | |
| 82 | '''Do not''' forget the doubled greater-than, otherwise you'll overwrite existing commands in your `.bash_profile`. Now type `source ~/.bash_profile` to make it take effect immediately. |
| 83 | |
| 84 | 2. pysqlite2 (both 0.10 and 0.11) can build against the bundled libsqlite3 on Tiger. [http://pysqlite.org Download the sources], extract, and |
| 85 | |
| 86 | {{{ |
| 87 | $ python2.3 setup.py build |
| 88 | $ sudo python2.3 setup.py install |
| 89 | }}} |
| 90 | |
| 91 | This just takes less than a minute with pysqlite 2.4.1 on a G4. |
| 92 | |
| 93 | 3. clearsilver (0.10) |
| 94 | |
| 95 | {{{ |
| 96 | $ ./configure --prefix=/usr/local --disable-ruby --with-python=`which python2.3` |
| 97 | $ make |
| 98 | $ sudo make install |
| 99 | }}} |
| 100 | |
| 101 | The make step took approximately a minute on my base G4. If you do not supply the full path to a python binary, it will fall back to a broken section of configure (at least using clearsilver 0.10.5) which will result in site-packages being in the install path twice. |
| 102 | |
| 103 | 4. Genshi (0.11) |
| 104 | |
| 105 | {{{ |
| 106 | $ sudo easy_install-2.3 Genshi |
| 107 | }}} |
| 108 | |
| 109 | 5. Pygments for syntax highlighting (0.10 with TH:TracPygments plugin, automatic on 0.11) |
| 110 | |
| 111 | {{{ |
| 112 | $ sudo easy_install-2.3 Pygments |
| 113 | }}} |
| 114 | |
| 115 | == Subversion the old way == |
| 116 | |
| 117 | '''These are advanced instructions.''' You should be familiar with the Terminal, the standard configure/make process, and be intimately aware of what python versions you have on your system and the order they are in your path. If you're using Tiger/Leopard and want a simpler solution, scroll back up. |
| 118 | |
| 119 | ---- |
| 120 | |