Like most things setting up an SVN server on Mac OS X is not hard if you know how to do it. I spent the better part of two days trying various howtos before I got just the right combination. Please understand that 2 months ago was the first time I’ve used a Mac since my Mac 128 is the 80’s.
There are several choices for setting up an SVN server. First, if your client has access to the file system containing the repository you don’t even need a server. For me the file server is remote so this was not an option. Second, you can install the svn apache module. I’m sure this can be done, but I did not choose to go down this road because I had such a hard time getting another module to work on the Mac. Third, you can use the standalone SVN server. This seemed to be the most straight forward way to me.
First either install or update SVN on your server. SVN was already installed on my server but it was old. I used MacPorts to install the new version.
port install subversion
This failed because db46, a dependency, would not compile. I updated MacPorts and all MacPorts installed packages.
Updated MacPorts
port selfupdate
port upgrade outdated
At some point a non-MacPorts install put some db source files in /usr/local. I didn’t know what was using these files so I renamed /usr/local temporarily and then MacPorts was able to install SVN.
Wrote a .plist file and placed it in /Library/LaunchDaemons/. This starts the svn server at boot.
<xmp>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Debug</key>
<false/>
<key>GroupName</key>
<string>daemon</string>
<key>Label</key>
<string>org.tigris.subversion.svnserve</string>
<key>OnDemand</key>
<true/>
<key>Program</key>
<string>/opt/local/bin/svnserve</string>
<key>ProgramArguments</key>
<array>
<string>svnserve</string>
<string>--inetd</string>
<string>--root=/Volumes/TeledrillRaid/SVNRepo</string>
</array>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<array>
<dict>
<key>SockFamily</key>
<string>IPv4</string>
<key>SockServiceName</key>
<string>svn</string>
<key>SockType</key>
<string>stream</string>
</dict>
<dict>
<key>SockFamily</key>
<string>IPv6</string>
<key>SockServiceName</key>
<string>svn</string>
<key>SockType</key>
<string>stream</string>
</dict>
</array>
</dict>
<key>Umask</key>
<integer>2</integer>
<key>UserName</key>
<string>daemon</string>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
</dict>
</plist>
</xmp>
I used the user/group “daemon”. It would probably be best to create an svn account and use that, but I did not do this. You need to make sure the path to svnserve is correct and set the path to where you want your repository.
Load the .plist file
sudo launchctl load /Library/LaunchDaemons/org.tigris.subversion.plist
Check that is it running
sudo lsof -i | grep svn
Note: svnserve can be stopped with
sudo launchctl unload /Library/LaunchDaemons/org.tigris.subversion.plist
Created a repository.
svnadmin create /path/to/svnrepo
By default your repository will not allow remote anonymous access. You will need to edit yoursvnrepo/conf/svn.conf to either allow anonymous access or setup a password file. See the svn manual.
Edited /Volumes/TeleDrillRaid/TeleDrillSVN/svn.conf to allow anonimous access.
I’ve tried several svn clients on the Mac.
scplugin This is an open-source finder plugin much like TortiosSVN on Windows but the icon tagging does not work very well.
svnX This open-source client works but only has basic features and is a little hard to use.
Syncro SVN, $59 per seat, is the most full featured client I’ve seen for the Mac, but could be hard to use.
Versions is about $50 per seat and is clean, easy to use.