ViewVC for Subversion in an OpenSolaris Zone
fmw | November 28, 2009I can’t imagine using Subversion without ViewVC anymore. There’s no package, but it isn’t too hard to get it working on OpenSolaris.
Present before we start, in the zone
- python (reporting itself as 2.4.4)
- gcc (pkg install gcc-dev)
- svn 1.4.3 (well, that’s what the client reports itself as)
- pkg install SUNWwget
Then we wget from
http://viewvc.tigris.org/files/documents/3330/46489/viewvc-1.1.2.tar.gz
According to the instructions, we can just try it
If you just want to see what your repository looks like when seen through ViewVC, type:
$ bin/standalone.py -r /PATH/TO/REPOSITORY
This will start a tiny ViewVC server at http://localhost:49152/viewvc/, to which you can connect with your browser.
bin/standalone.py -r /export/svn/miles -h svn.park.house
No joy.
INSTALL talks about checking that there are local python bindings available for svn:
Python 2.4.4 (#1, Mar 10 2009, 09:35:36) [C] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> from svn.core import * Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named svn.core
Ok, so apparently not.
Well waddaya know, there’s a pkg SUNWsvn-python. So we pkg install it and now when we run the svn.core import test, it’s silent.
bin/standalone.py -r /export/svn/miles -h svn.park.house
woohoo! we’re working.
However, when asking for a diff, we get
ViewVC depends on rcsdiff and GNU diff to create this page. ViewVC cannot find GNU diff. Even if you have GNU diff installed, the rcsdiff program must be configured and compiled with the GNU diff location.
Ok, let’s start with the GNUDiff thing,
http://ftp.gnu.org/pub/gnu/diffutils/diffutils-2.8.1.tar.gz
Running ./configure was ok, but
make
failed with things like
sh: line 1: ar: not found
*** Error code 127
This is installed (part of binutils) but isn’t on the path.
ln -s /usr/gnu/bin/ar /usr/bin/ar
That’s more better!
And now we have gnu diff available as
/usr/local/bin/diff
(the original diff is in /usr/bin/diff, so we need to be careful of that)
Now we need rcs
(The official rcs homepage is at http://www.cs.purdue.edu/homes/trinkle/RCS)
Initially, running ./configure listed values which suggested it was going to pick up the wrong diff.
rm config.cache
env DIFF=/usr/local/bin/diff DIFF3=/usr/local/bin/diff3 ./configure
Then we try to run make but it barfs because we’re currently root. grr.
<does the make as "miles" and the make install as root>
/usr/local/bin/rcsdiff now exists!
the standalone viewvc server still isn’t playing, but maybe if we run the full configure …
./viewvc-install
ViewVC file installation complete.
Consult the INSTALL document for detailed information on completing the
installation and configuration of ViewVC on your system. Here's a brief
overview of the remaining steps:
1) Edit the /usr/local/viewvc-1.1.2/viewvc.conf file.
2) Either configure an existing web server to run
/usr/local/viewvc-1.1.2/bin/cgi/viewvc.cgi.
Or, copy /usr/local/viewvc-1.1.2/bin/cgi/viewvc.cgi to an
already-configured cgi-bin directory.
Or, use the standalone server provided by this distribution at
/usr/local/viewvc-1.1.2/bin/standalone.py
So, I edited the viewvc.conf file
svn_roots = miles: /export/svn/miles
rcs_dir = /usr/local/bin
diff = /usr/local/bin/diff
Woohooo!!! It works
Now we have a choice as to running it standalone or via apache.
Standalone. And via a svc, naturally, because it avoids installing all of apache.
<?xml version="1.0"?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <!-- SMF manifest for viewvc. --> <service_bundle type='manifest' name='viewvc'> <service name='site/viewvc' type='service' version='1'> <create_default_instance enabled='false' /> <single_instance /> <dependency name='network' grouping='require_all' restart_on='error' type='service'> <service_fmri value='svc:/milestone/network:default'/> </dependency> <dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/system/filesystem/local:default'/> </dependency> <dependency name='repository' grouping='require_all' restart_on='restart' type='path'> <service_fmri value='file://localhost/export/svn/miles' /> </dependency> <exec_method type='method' name='start' exec='/usr/bin/python /usr/local/viewvc-1.1.2/bin/standalone.py -d -h svn.park.house -p 80 -c /usr/local/viewvc-1.1.2/viewvc.conf 2>/dev/null' timeout_seconds='60' /> <exec_method type='method' name='stop' exec=':kill' timeout_seconds='60' /> <stability value='Evolving' /> <template> <common_name> <loctext xml:lang='C'> viewvc </loctext> </common_name> <documentation> <doc_link name='From Manchester Way' uri='http://frommanchesterway.com/' /> </documentation> </template> </service> </service_bundle>
we put the above into
/var/svc/manifest/site/viewvc.xml
cd /var/svc/manifest/site/
svccfg import viewvc.xml
svcs viewvc
svcadm enable viewvc
svcs viewvc
svcs -pv viewvc
And that’s basically it. It works. If you point a browser at your zone, you can view the repository.

