Thursday Feb 09, 2012

OpenGrok 0.11 setup on Solaris 11

OpenGrok 0.11 has been just released (see Lubos' post with release notes). This is nice version number coincidence to try it on Solaris 11. In case you are wondering what is OpenGrok, it is blindigly fast source code search and cross reference engine accessible over web. It is written in Java. It is also behind the source code browser on src.opensolaris.org, albeit running older version. For more information about the project take a look at its project page.

Now, how to get OpenGrok running for your source code base on Solaris 11. I will illustrate this on source code coming from three different Source Code Management systems (for complete support see the full list). The complete setup on freshly installed Solaris 11 has 6 main steps:

  1. Install pre-requisities first:
    1. install couple of Source Code Management systems (depends on your needs):
      • install Mercurial:
            pkg install developer/versioning/mercurial
        
      • install CVS
            pkg install developer/versioning/cvs
        
      • git
            pkg install developer/versioning/git
        
    2. download, compile and install exuberant ctags:
      pkg install developer/gcc-45
      pkg install system/header
      wget http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz
      tar xfz ctags-5.8.tar.gz
      cd ctags-5.8
      ./configure && make && make install
      
    3. install Tomcat6:
        pkg install web/java-servlet/tomcat
      
  2. Now download and install OpenGrok package:
    location=http://hub.opensolaris.org/bin/download/Project+opengrok/files/
    pkgadd -d $location/OSOLopengrok-0.11.pkg OSOLopengrok
    
  3. Mirror some source code as webservd user (note that OpenGrok by itself does not synchronize or mirror source code, this has to be done separately):
    cd /var/opengrok/src/
    cvs -d anonymous@cvs.openssl.org:/openssl-cvs co -rOpenSSL_1_0_0-stable openssl
    hg clone ssh://anon@hg.opensolaris.org/hg/opengrok/trunk opengrok-dev
    git clone http://git.samba.org/samba.git
    
      Run the following first (as root) to make sure history indexing does not prompt to confirm the identify when consulting with remote repositories (CVS):
      
      # store the pubkeys
      ssh-keyscan -t rsa,dsa cvs.openssl.org >> /etc/ssh/known_hosts
      ssh-keyscan -t rsa,dsa hg.opensolaris.org >> /etc/ssh/known_hosts
      
  4. Deploy and start the web application (as root):
    EXUBERANT_CTAGS=/usr/local/bin/ctags \
        /usr/opengrok/bin/OpenGrok deploy && \
        svcadm enable tomcat6
    
  5. Index the source code and send the configuration to the running instance (as webservd user):
    EXUBERANT_CTAGS=/usr/local/bin/ctags \
       /usr/opengrok/bin/OpenGrok index
    
  6. enable the service (as root):
    svcadm enable opengrok
    

OpenGrok is now accessible at http://SERVER_HOSTNAME:8080/source/ (where SERVER_HOSTNAME is the hostname of the server on which the above setup was done).

Except for the part with ctags it is pretty streamlined and no brainer process. Hopefully the exuberant-ctags package will be available again from the standard Oracle pkg repositories.

And here is the result:

About

blog about security and various tools in Solaris

Search

Categories
Archives
« February 2012
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
   
       
Today