rpms/opengrok/devel README.Fedora, NONE, 1.1 configuration.xml, NONE, 1.1 opengrok, NONE, 1.1 opengrok-0.5-jrcs-import.patch, NONE, 1.1 opengrok-0.5-manifest-classpath.patch, NONE, 1.1 opengrok-0.5-nocplib.patch, NONE, 1.1 opengrok-0.6-hg275.patch, NONE, 1.1 opengrok-0.6-nochangeset.patch, NONE, 1.1 opengrok-0.6-nooverview.patch, NONE, 1.1 opengrok.desktop, NONE, 1.1 opengrok.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Lubomir Kundrak (lkundrak) fedora-extras-commits at redhat.com
Fri Apr 18 19:12:37 UTC 2008


Author: lkundrak

Update of /cvs/pkgs/rpms/opengrok/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3793/devel

Modified Files:
	.cvsignore sources 
Added Files:
	README.Fedora configuration.xml opengrok 
	opengrok-0.5-jrcs-import.patch 
	opengrok-0.5-manifest-classpath.patch 
	opengrok-0.5-nocplib.patch opengrok-0.6-hg275.patch 
	opengrok-0.6-nochangeset.patch opengrok-0.6-nooverview.patch 
	opengrok.desktop opengrok.spec 
Log Message:
Initial import


--- NEW FILE README.Fedora ---
Setting up an OpenGrok server on Fedora
---------------------------------------

$Id$

See README.txt for general information on setting up OpenGrok.
Some of the notes below are more or less specific to Fedora:


Notes
-----

1.) The sub-package opengrok-tomcat5 contains servlet installed to run with
tomcat5. Feel free to touch the configuration files to suit your needs:

/var/lib/tomcat5/webapps/source/index_body.html
/var/lib/tomcat5/webapps/source/WEB-INF/web.xml

Other files will be overwritten on update.  Want to customize you OpenGrok
with a cool theme?  Submit it to OpenGrok so it can be included with the
package!

There's no war package.  Create one yourself by zipping the files.
You won't be able to benefit from the updates.  Remember that wars suck.
Both conflicts and web archives.


4.) OpenGrok package doesn't depend on mercurial on subversion.  If you
intend to use mercurial backend install mercurial package.  For
subversion, you need the subversion-javahl package.

2.) Configuration file is /etc/opengrok/configuration.xml.  It sets the
Source and Data roots to point to subdirectories of /var/lib/opengrok.

5.) Report bugs at http://bugzilla.redhat.com/.  Have fun!


Step-by-step configuration
--------------------------

This is what would you do to populate your OpenGrok with files and
customize it in Fedora:

1.) Install openrok-tomcat5 package, start up tomcat5.

2.) Populate /var/lib/opengrok/data your source files.  If you have
multiple projects, place each in a separate directory.

3.) Generate the index and make configuration changes:

# opengrok -R /etc/opengrok/configuration.xml

Remember to always specify the configuration file, so OpenGrok knows
where to look for files.  Though you can specify the directories on a
command line, having setting stored in a file makes it possible for the
web application read the same configuration upon its startup.

If you have multiple projects in separate directories, do not forget to
specify the -P parameter:

# opengrok -P -U localhost:2424         \
     -R /etc/opengrok/configuration.xml \
     -W /etc/opengrok/configuration.xml

Also, when you modify anything in configuration (other than regenerating
the index), save the modified configuration into the file (-W) so that it
can be used by the webapp upon startup.

Opengrok by default listens on port 2424 bind to loopback interface for
configuration updates.  Specify the -U parameter, so that you don't have
to restart your webapp when you do a configuration change.

4.) Other changes are done in a similar fashion.  When you don't update
the index, specify -n.

# opengrok -n -U localhost:2424         \
     -R /etc/opengrok/configuration.xml \
     -W /etc/opengrok/configuration.xml \
     -L polished

This switches the visual skin to "polished".

---------------------------------------------------------------------------
This text was written by Lubomir Kundrak <lkundrak at redhat.com>
Should you find a problem in it, report at https://bugzilla.redhat.com/


--- NEW FILE configuration.xml ---
<?xml version="1.0" encoding="UTF-8"?>

<!--
  $Id$

  Fedora OpenGrok Configuration file
  See @DOCDIR@/@NAME at -@VERSION@/README.Fedora
-->

<java class="java.beans.XMLDecoder">
 <object class="org.opensolaris.opengrok.configuration.Configuration">
  <void property="dataRoot">
   <string>@LOCALSTATEDIR@/lib/@NAME@/data</string>
  </void>
  <void property="sourceRoot">
   <string>@LOCALSTATEDIR@/lib/@NAME@/src</string>
  </void>
 </object>
</java>


--- NEW FILE opengrok ---
#!/bin/sh
# 
# OpenGrok script
# Lubomir Kundrak <lkundrak at redhat.com>
# $Id$

# Source functions library
if [ -f /usr/share/java-utils/java-functions ] ; then 
  . /usr/share/java-utils/java-functions
else
  echo "Can't find functions library, aborting"
  exit 1
fi

# Load system-wide configuration
if [ -f /etc/opengrok.conf ]; then
  . /etc/opengrok.conf
fi

# Load user configuration
if [ -f "$HOME/.opengrokrc" ]; then
  . "$HOME/.opengrokrc"
fi

# Rest of the configuration
MAIN_CLASS=org.opensolaris.opengrok.index.Indexer

# Attempt to load Subversion support only if it's available
build-classpath svn-javahl >/dev/null 2>&1 &&
	BASE_JARS="$BASE_JARS svn-javahl.jar"

BASE_JARS="$BASE_JARS lucene.jar"
BASE_JARS="$BASE_JARS lucene-contrib/lucene-spellchecker.jar"
BASE_JARS="$BASE_JARS jakarta-oro.jar"
BASE_JARS="$BASE_JARS opengrok-jrcs/org.apache.commons.jrcs.rcs.jar"
BASE_JARS="$BASE_JARS opengrok-jrcs/org.apache.commons.jrcs.diff.jar"
BASE_JARS="$BASE_JARS bcel.jar"
BASE_JARS="$BASE_JARS servletapi5.jar"
BASE_JARS="$BASE_JARS ant.jar"
BASE_JARS="$BASE_JARS swing-layout.jar"
BASE_JARS="$BASE_JARS opengrok.jar"

# Set parameters
set_jvm
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS $OPENGROK_OPTS

# Let's start
run "$@"

opengrok-0.5-jrcs-import.patch:

--- NEW FILE opengrok-0.5-jrcs-import.patch ---
Fixes JRCS build.
Lubomir Kundrak <lkundrak at redhat.com>

diff -urp opengrok-0.5-c4dea0135445.orig/jrcs/src/java/org/apache/commons/jrcs/rcs/Archive.java opengrok-0.5-c4dea0135445/jrcs/src/java/org/apache/commons/jrcs/rcs/Archive.java
--- opengrok-0.5-c4dea0135445.orig/jrcs/src/java/org/apache/commons/jrcs/rcs/Archive.java	2006-03-21 18:47:56.000000000 +0100
+++ opengrok-0.5-c4dea0135445/jrcs/src/java/org/apache/commons/jrcs/rcs/Archive.java	2008-02-18 21:33:10.000000000 +0100
@@ -59,6 +59,7 @@ package org.apache.commons.jrcs.rcs;
 
 import java.io.*;
 import java.util.*;
+import java.text.*;
 
 import org.apache.commons.jrcs.diff.Diff;
 import org.apache.commons.jrcs.diff.DiffException;

opengrok-0.5-manifest-classpath.patch:

--- NEW FILE opengrok-0.5-manifest-classpath.patch ---
Disables inclusion of hardcoded classpath in manifest
Lubomir Kundrak <lkundrak at redhat.com>

diff -utp opengrok-0.5-e3806d642190.orig/build.xml opengrok-0.5-e3806d642190/build.xml
--- opengrok-0.5-e3806d642190.orig/build.xml	2008-02-21 18:22:27.000000000 +0100
+++ opengrok-0.5-e3806d642190/build.xml	2008-02-21 18:27:29.000000000 +0100
@@ -177,13 +177,15 @@ Use is subject to license terms.
     </target>
 
     <!-- Update the manifest file with a classpath attribute -->
+    <!--
     <target name="-update-manifest-classpath">
       <manifest file="${manifest.file}" mode="update">
         <attribute name="Class-Path" value="${opengrok.lib.files}"/>
       </manifest>
     </target>
+    -->
 
-    <target name="-pre-jar" depends="-update-manifest-classpath,-update-build-info"/>
+    <target name="-pre-jar" depends="-update-build-info"/>
 
     <!--
         Copy the jars from lib to dist/lib manually if we don't have

opengrok-0.5-nocplib.patch:

--- NEW FILE opengrok-0.5-nocplib.patch ---
During our build we remove everything from lib,
so don't attempt to copy it.

Lubomir Kundrak <lkundrak at redhat.com>

diff -urp opengrok-0.5-c4dea0135445.orig/build.xml opengrok-0.5-c4dea0135445/build.xml
--- opengrok-0.5-c4dea0135445.orig/build.xml	2008-02-18 12:57:38.000000000 +0100
+++ opengrok-0.5-c4dea0135445/build.xml	2008-02-20 00:42:29.000000000 +0100
@@ -201,7 +201,7 @@ Use is subject to license terms.
             <fileset dir="web"/>
             <fileset dir="conf" excludes="web.xml"/>
             <lib dir="${dist.dir}" includes="opengrok.jar"/>
-            <lib dir="${dist.dir}/lib" includes="*.jar" excludes="servlet-api.jar,svn-javahl.jar"/>
+            <!-- <lib dir="${dist.dir}/lib" includes="*.jar" excludes="servlet-api.jar,svn-javahl.jar"/> -->
         </war>
     </target>
 

opengrok-0.6-hg275.patch:

--- NEW FILE opengrok-0.6-hg275.patch ---
diff -r bb6b60f39f1f build.xml
--- a/build.xml	Wed Mar 12 09:27:38 2008 +0100
+++ b/build.xml	Wed Apr 09 13:55:21 2008 +0200
@@ -208,6 +208,14 @@ Use is subject to license terms.
             <lib dir="${dist.dir}" includes="opengrok.jar"/>
             <lib dir="${dist.dir}/lib" includes="*.jar" excludes="servlet-api.jar,svn-javahl.jar"/>
         </war>
+        <echo message="Generating man page.."/>
+        <java classname="org.opensolaris.opengrok.index.CommandLineOptions" 
+              output="${dist.dir}/opengrok.1" failonerror="true" fork="true">
+            <classpath>
+                <pathelement location="dist/opengrok.jar"/>
+                <pathelement path="${java.class.path}"/>
+            </classpath>
+        </java>
     </target>
 
     <target name="package" depends="jar">
diff -r bb6b60f39f1f pkgdef/prototype
--- a/pkgdef/prototype	Wed Mar 12 09:27:38 2008 +0100
+++ b/pkgdef/prototype	Wed Apr 09 13:55:21 2008 +0200
@@ -32,6 +32,8 @@ d none opt ? ? ?
 d none opt ? ? ?
 d none opt/OSOLopengrok 0755 bin bin
 d none opt/OSOLopengrok/lib 0755 bin bin
+d none opt/OSOLopengrok/man 0755 bin bin
+d none opt/OSOLopengrok/man/sman1 0755 bin bin
 f none opt/OSOLopengrok/lib/ant.jar=dist/lib/ant.jar
 f none opt/OSOLopengrok/lib/bcel-5.1.jar=lib/bcel-5.1.jar
 f none opt/OSOLopengrok/lib/jakarta-oro-2.0.8.jar=lib/jakarta-oro-2.0.8.jar
@@ -43,4 +45,5 @@ f none opt/OSOLopengrok/lib/swing-layout
 f none opt/OSOLopengrok/lib/swing-layout-0.9.jar=lib/swing-layout-0.9.jar
 f none opt/OSOLopengrok/opengrok.jar=dist/opengrok.jar 0555 bin bin
 f none opt/OSOLopengrok/source.war=dist/source.war
+f none opt/OSOLopengrok/man/sman1/opengrok.1=dist/opengrok.1
 s local usr/local/bin/opengrok=../../../opt/OSOLopengrok/opengrok.jar
diff -r bb6b60f39f1f src/org/opensolaris/opengrok/analysis/AnalyzerGuru.java
--- a/src/org/opensolaris/opengrok/analysis/AnalyzerGuru.java	Wed Mar 12 09:27:38 2008 +0100
+++ b/src/org/opensolaris/opengrok/analysis/AnalyzerGuru.java	Wed Apr 09 13:55:21 2008 +0200
@@ -116,12 +116,12 @@ public class AnalyzerGuru {
             new ELFAnalyzerFactory(),
             new JavaClassAnalyzerFactory(),
             new ImageAnalyzerFactory(),
-            new JarAnalyzerFactory(),
-            new ZipAnalyzerFactory(),
+            JarAnalyzerFactory.DEFAULT_INSTANCE,
+            ZipAnalyzerFactory.DEFAULT_INSTANCE,
             new TarAnalyzerFactory(),
             new CAnalyzerFactory(),
             new ShAnalyzerFactory(),
-            new PlainAnalyzerFactory(),
+            PlainAnalyzerFactory.DEFAULT_INSTANCE,
             new GZIPAnalyzerFactory(),
             new JavaAnalyzerFactory(),
             new LispAnalyzerFactory(),
@@ -144,7 +144,9 @@ public class AnalyzerGuru {
             "suffix '" + suffix + "' used in multiple analyzers";
         }
         for (String magic : factory.getMagicStrings()) {
-            magics.put(magic, factory);
+            FileAnalyzerFactory old = magics.put(magic, factory);
+            assert old == null :
+                "magic '" + magic + "' used in multiple analyzers";
         }
         matchers.addAll(factory.getMatchers());
         factories.add(factory);
@@ -273,14 +275,15 @@ public class AnalyzerGuru {
      * @param in The input stream containing the data
      * @param out Where to write the result
      * @param annotation Annotation information for the file
+     * @param project Project the file belongs to
      * @throws java.io.IOException If an error occurs while creating the
      *                             output
      */
     public static void writeXref(FileAnalyzerFactory factory, InputStream in,
-                                 Writer out, Annotation annotation)
+                                 Writer out, Annotation annotation, Project project)
         throws IOException
     {
-        factory.writeXref(in, out, annotation);
+        factory.writeXref(in, out, annotation, project);
     }
 
     /**
@@ -434,7 +437,7 @@ public class AnalyzerGuru {
         }
 
         for (FileAnalyzerFactory.Matcher matcher : matchers) {
-            FileAnalyzerFactory fac = matcher.isMagic(content);
+            FileAnalyzerFactory fac = matcher.isMagic(content, in);
             if (fac != null) {
                 return fac;
             }
diff -r bb6b60f39f1f src/org/opensolaris/opengrok/analysis/FileAnalyzer.java
--- a/src/org/opensolaris/opengrok/analysis/FileAnalyzer.java	Wed Mar 12 09:27:38 2008 +0100
+++ b/src/org/opensolaris/opengrok/analysis/FileAnalyzer.java	Wed Apr 09 13:55:21 2008 +0200
@@ -30,6 +30,7 @@ import java.io.*;
 import java.io.*;
 import org.apache.lucene.document.*;
 import org.apache.lucene.analysis.*;
+import org.opensolaris.opengrok.configuration.Project;
 import org.opensolaris.opengrok.configuration.RuntimeEnvironment;
 import org.opensolaris.opengrok.history.*;
 
@@ -51,7 +52,8 @@ import org.opensolaris.opengrok.history.
  */
 
 public class FileAnalyzer extends Analyzer {
-
+    protected Project project;
+    
     private final FileAnalyzerFactory factory;
 
     /**
@@ -103,29 +105,24 @@ public class FileAnalyzer extends Analyz
     /**
      * Write a cross referenced HTML file.
      * @param out to writer HTML cross-reference
+     * @throws java.io.IOException if an error occurs
      */
     public void writeXref(Writer out) throws IOException {
 	out.write("Error General File X-Ref writer!");
     }
     
-    /**
-     * Write a cross referenced HTML file.
-     * @param xrefdir path of file root xref directory
-     * @param path path from xrefdir
-     */
-    public void writeXref(String xrefdir, String path) throws IOException {
-	//  System.err.println("parent " + xrefdir + " child " + path);
-	Writer out = new BufferedWriter(new FileWriter(new File(xrefdir+ File.separatorChar +path)));
-	writeXref(out);
-	out.close();
-    }
-
     public void writeXref(File xrefDir, String path) throws IOException {
+        if (RuntimeEnvironment.getInstance().hasProjects()) {
+            project = Project.getProject(path);
+        } else {
+            project = null;
+        }
 	Writer out = new BufferedWriter(new FileWriter(new File(xrefDir, path)));
 	writeXref(out);
 	out.close();
     }
     
+    /*
     public static char[] readContent(char[] content, InputStream in, Integer length) throws IOException {
 	InputStreamReader inReader = new InputStreamReader(in);
 	int len = 0;
@@ -145,4 +142,5 @@ public class FileAnalyzer extends Analyz
 	length = len;
 	return content;
     }
+     */
 }
diff -r bb6b60f39f1f src/org/opensolaris/opengrok/analysis/FileAnalyzerFactory.java
--- a/src/org/opensolaris/opengrok/analysis/FileAnalyzerFactory.java	Wed Mar 12 09:27:38 2008 +0100
+++ b/src/org/opensolaris/opengrok/analysis/FileAnalyzerFactory.java	Wed Apr 09 13:55:21 2008 +0200
@@ -21,7 +21,6 @@
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
-
 package org.opensolaris.opengrok.analysis;
 
 import java.io.InputStream;
@@ -31,6 +30,7 @@ import java.util.Collections;
 import java.util.Collections;
 import java.util.List;
 import org.opensolaris.opengrok.analysis.FileAnalyzer.Genre;
+import org.opensolaris.opengrok.configuration.Project;
 import org.opensolaris.opengrok.history.Annotation;
 
 /**
@@ -38,25 +38,21 @@ import org.opensolaris.opengrok.history.
  * provides information about this type of analyzers.
  */
 public class FileAnalyzerFactory {
+
     /** Cached analyzer object for the current thread (analyzer objects can be
      * expensive to allocate). */
     private final ThreadLocal<FileAnalyzer> cachedAnalyzer;
-
     /** List of file extensions on which this kind of analyzer should be
      * used. */
     private final List<String> suffixes;
-
     /** List of magic strings used to recognize files on which this kind of
      * analyzer should be used. */
     private final List<String> magics;
-
     /** List of matchers which delegate files to different types of
      * analyzers. */
     private final List<Matcher> matchers;
-
     /** The content type for the files recognized by this kind of analyzer. */
     private final String contentType;
[...3748 lines suppressed...]
+E 12
+E 11
+E 10
+E 9
+E 8
+E 7
+E 6
+E 5
+E 4
+E 3
+E 2
+E 1
diff -r bb6b60f39f1f test/org/opensolaris/opengrok/history/sccs-revisions.zip
Binary file test/org/opensolaris/opengrok/history/sccs-revisions.zip has changed
diff -r bb6b60f39f1f web/history.jsp
--- a/web/history.jsp	Wed Mar 12 09:27:38 2008 +0100
+++ b/web/history.jsp	Wed Apr 09 13:55:22 2008 +0200
@@ -45,6 +45,10 @@ if (path.length() > 0 && valid) {
     Format df = new SimpleDateFormat("dd-MMM-yyyy");
     Date tstart = new Date();
     File f = new File(rawSource + path);
+    if (!HistoryGuru.getInstance().hasHistory(f)) {
+        response.sendError(404, "No history");
+        return;        
+    }
     HistoryReader hr = HistoryGuru.getInstance().getHistoryReader(f);
 
     if (hr == null) {
diff -r bb6b60f39f1f web/list.jsp
--- a/web/list.jsp	Wed Mar 12 09:27:38 2008 +0100
+++ b/web/list.jsp	Wed Apr 09 13:55:22 2008 +0200
@@ -18,9 +18,6 @@ CDDL HEADER END
 
 Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 Use is subject to license terms.
-
-ident	"%Z%%M% %I%     %E% SMI"
-
 --%><%@ page import = "javax.servlet.*,
 java.lang.*,
 javax.servlet.http.*,
@@ -140,7 +137,7 @@ if (g == Genre.PLAIN) {
 if (g == Genre.PLAIN) {
     Annotation annotation = annotate ?
         HistoryGuru.getInstance().annotate(resourceFile, rev) : null;
-    AnalyzerGuru.writeXref(a, in, out, annotation);
+    AnalyzerGuru.writeXref(a, in, out, annotation, Project.getProject(resourceFile));
 } else if (g == Genre.IMAGE) {
 			%><img src="<%=context%>/raw<%=path%>?r=<%=rev%>"/><%
 } else if (g == Genre.HTML) {
@@ -210,7 +207,7 @@ if (g == Genre.PLAIN) {
             %><div id="src"><pre><%
             Annotation annotation = annotate ?
                 HistoryGuru.getInstance().annotate(resourceFile, rev) : null;
-            AnalyzerGuru.writeXref(a, bin, out, annotation);
+            AnalyzerGuru.writeXref(a, bin, out, annotation, Project.getProject(resourceFile));
             %></pre></div><%
             } else {
 	    %> Click <a href="<%=context%>/raw<%=path%>">download <%=basename%></a><%
diff -r bb6b60f39f1f web/mast.jsp
--- a/web/mast.jsp	Wed Mar 12 09:27:38 2008 +0100
+++ b/web/mast.jsp	Wed Apr 09 13:55:22 2008 +0200
@@ -18,15 +18,11 @@ CDDL HEADER END
 
 Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 Use is subject to license terms.
-
-ident	"%Z%%M% %I%     %E% SMI"
-
 --%><%@ page import = "javax.servlet.*,
 java.lang.*,
 javax.servlet.http.*,
 java.util.*,
 java.io.*,
-java.net.URLDecoder,
 org.opensolaris.opengrok.index.*,
 org.opensolaris.opengrok.configuration.*
 "
@@ -36,12 +32,6 @@ String reqURI = request.getRequestURI();
 String reqURI = request.getRequestURI();
 String path = request.getPathInfo();
 if (path == null) path = "";
-else {
-     try {
-       path = URLDecoder.decode(path, "ISO-8859-1");
-     } catch (UnsupportedEncodingException e) {
-     }
-}
 RuntimeEnvironment environment = RuntimeEnvironment.getInstance();
 environment.setUrlPrefix(context + "/s?");
 environment.register();
@@ -114,7 +104,7 @@ if(resourcePath.length() < rawSource.len
             parent = (lastSlash != -1) ? path.substring(0, lastSlash) : "";
             int pLastSlash = parent.lastIndexOf('/');
             parentBasename = pLastSlash != -1 ? parent.substring(pLastSlash+1) : parent;
-            noHistory = !(isDir || HistoryGuru.getInstance().hasHistory(rawSource + "/" + parent));
+            noHistory = !HistoryGuru.getInstance().hasHistory(resourceFile);
             noAnnotation = isDir ||
                     !HistoryGuru.getInstance().hasAnnotation(resourceFile);
             annotate = !noAnnotation &&
@@ -148,13 +138,13 @@ if(resourcePath.length() < rawSource.len
 <div id="bar"><a href="<%=context%>" id="home">Home</a> | 
 <%
 
-if ((!isDir && noHistory) || servlet.startsWith("/hi")) {
-	%> <span class="c" id="history">History</span> |<%
+if (noHistory || servlet.startsWith("/hi")) {
+	%> <span class="c" id="history">History</span><%
 } else {
-	%><a id="history" href="<%=context%>/history<%=path%>">History</a> |<%
+	%><a id="history" href="<%=context%>/history<%=path%>">History</a><%
 }
 if (noAnnotation) {
-%> <span class="c" id="annotate">Annotate</span> |<%
+%> | <span class="c" id="annotate">Annotate</span><%
 } else {
    String rev = request.getParameter("r");
     if (rev == null) {
@@ -164,7 +154,7 @@ if (noAnnotation) {
     }
 
     if (Boolean.parseBoolean(request.getParameter("a"))) {
-     %> <span id="toggle-annotate-by-javascript" style="display: none">
+     %> | <span id="toggle-annotate-by-javascript" style="display: none">
 <a href="#" onClick="javascript:toggle_annotations(); return false;">Annotate</a>
 </span>
 <span id="toggle-annotate">
@@ -182,32 +172,35 @@ toggle_ss.style.display = 'none';
 // -->
 </script> <%
     } else {
-        %> <a href="<%=context%>/xref<%=path%>?a=true<%=rev%>">Annotate</a><%
+        %> | <a href="<%=context%>/xref<%=path%>?a=true<%=rev%>">Annotate</a><%
     }        
- %> | <%       
 }
         if (!isDir) {
            String rev = request.getParameter("r");
            if (rev == null || rev.equals("")) {
-%> <a id="download" href="<%=context%>/raw<%=path%>">Download</a> | <%
+%> | <a id="download" href="<%=context%>/raw<%=path%>">Download</a><%
            } else {
-%> <a id="download" href="<%=context%>/raw<%=path%>?r=<%=rev%>">Download</a> | <%
+%> | <a id="download" href="<%=context%>/raw<%=path%>?r=<%=rev%>">Download</a><%
            }
         }
 
-%> <input id="search" name="q" class="q"/>
-<input type="submit" value="Search" class="submit"/><%
-
-if(isDir) {
+        Project proj = Project.getProject(resourceFile);
+        if  (proj != null || !environment.hasProjects()) {
+%> | <input id="search" name="q" class="q"/>
+<input type="submit" value="Search" class="submit"/>
+<%
+        if (proj != null) {
+      %><input type="hidden" name="project" value="<%=proj.getId()%>"/><%
+        }
+        if(isDir) {
                 if(path.length() > 0) {
 	%><input type="checkbox" name="path" value="<%=path%>"/> only in <b><%=path%></b><%
-  }
-} else {
+                }
+        } else {
 	%><input type="checkbox" name="path" value="<%=parent%>"/> only in <b><%=parentBasename%></b><%
-}
-
+        }
 %></div></form><%
-
+        }
 } // date check
     } // not a directory redirect
 }
diff -r bb6b60f39f1f web/rss.jsp
--- a/web/rss.jsp	Wed Mar 12 09:27:38 2008 +0100
+++ b/web/rss.jsp	Wed Apr 09 13:55:22 2008 +0200
@@ -26,7 +26,6 @@ javax.servlet.http.*,
 javax.servlet.http.*,
 java.util.*,
 java.io.*,
-java.net.URLDecoder,
 org.opensolaris.opengrok.analysis.*,
 org.opensolaris.opengrok.web.*,
 org.opensolaris.opengrok.history.*,
@@ -44,12 +43,6 @@ String reqURI = request.getRequestURI();
 String reqURI = request.getRequestURI();
 String path = request.getPathInfo();
 if(path == null) path = "";
-else {
-     try {
-       path = URLDecoder.decode(path, "ISO-8859-1");
-     } catch (UnsupportedEncodingException e) {
-     }
-}
 RuntimeEnvironment env = RuntimeEnvironment.getInstance();
 env.setUrlPrefix(context + "/s?");
 env.register();

opengrok-0.6-nochangeset.patch:

--- NEW FILE opengrok-0.6-nochangeset.patch ---
Do not call home to get the changeset. It won't succeed anyways.

diff -urp opengrok-0.6-src.orig/build.xml opengrok-0.6-src/build.xml
--- opengrok-0.6-src.orig/build.xml	2008-04-16 00:15:23.000000000 +0200
+++ opengrok-0.6-src/build.xml	2008-04-16 00:20:52.000000000 +0200
@@ -118,6 +118,7 @@ Use is subject to license terms.
     </target>
     
     <property name="hg" value="hg"/>
+    <!--
     <target name="-hg-get-changeset">
         <exec executable="${hg}"
               failifexecutionfails="no"
@@ -137,8 +138,9 @@ Use is subject to license terms.
             </redirector>
         </exec>
     </target>
+    -->
 
-    <target name="-update-build-info" depends="-hg-get-changeset">
+    <target name="-update-build-info">
         <mkdir dir="${build.classes.dir}/org/opensolaris/opengrok"/>
         <propertyfile
             file="${build.classes.dir}/org/opensolaris/opengrok/info.properties">

opengrok-0.6-nooverview.patch:

--- NEW FILE opengrok-0.6-nooverview.patch ---
This fixes the warning about missing gile during build of javadoc for jrcs.

diff -urp opengrok-0.6-src.orig/jrcs/build.xml opengrok-0.6-src/jrcs/build.xml
--- opengrok-0.6-src.orig/jrcs/build.xml	2008-04-16 00:15:23.000000000 +0200
+++ opengrok-0.6-src/jrcs/build.xml	2008-04-16 00:16:36.000000000 +0200
@@ -274,7 +274,6 @@
 			author="true"
 			version="true" 
 			private="yes"
-			overview="${java.dir}/org/apache/commons/jrcs/overview.html"
 			windowtitle="${app.name} API"
 			doctitle="${app.name}"
 			bottom="Copyright 2002 the Apache Software Foundation<br>


--- NEW FILE opengrok.desktop ---
[Desktop Entry]
Name=OpenGrok
Comment=Source Code Browser
GenericName=Source Code Browser
Exec=opengrok
Icon=opengrok
Type=Application
Categories=Development;TextTools;


--- NEW FILE opengrok.spec ---
%define snapshot 275

Name:           opengrok
Version:        0.6
Release:        9.hg%{snapshot}%{?dist}
Summary:        Source browser and indexer

Group:          Development/Tools
License:        CDDL
URL:            http://www.opensolaris.org/os/project/opengrok/
Source0:        http://www.opensolaris.org/os/project/opengrok/files/%{name}-%{version}-src.tar.gz
Source1:        opengrok
Source2:        configuration.xml
Source3:        opengrok.desktop
Source4:        README.Fedora
Patch0:         opengrok-0.5-jrcs-import.patch
Patch1:         opengrok-0.5-nocplib.patch
Patch2:         opengrok-0.6-hg%{snapshot}.patch
Patch3:         opengrok-0.5-manifest-classpath.patch
Patch4:         opengrok-0.6-nooverview.patch
Patch5:         opengrok-0.6-nochangeset.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch

%define common_reqs jakarta-oro ant bcel servlet lucene > 2 lucene-contrib > 2 swing-layout jpackage-utils javacc
Requires:       %{common_reqs}
Requires:       ctags
Requires:       java
BuildRequires:  %{common_reqs}
BuildRequires:  jflex >= 1.4
BuildRequires:  ant-nodeps
# FIXME: As of 0.6-hg275 this should build with java-1.5 again.
# This is just to prevent GCJ from attempting to build this.
# ant scripts from both jrcs and opengrok need to be fixed somehow
BuildRequires:  java-devel >= 1.6
BuildRequires:  desktop-file-utils
BuildRequires:  subversion-javahl
BuildRequires:  unzip
BuildRequires:  junit4
BuildRequires:  ant-junit
BuildRequires:  ctags
BuildRequires:  docbook2X

%description
OpenGrok is a fast and usable source code search and cross reference
engine, written in Java. It helps you search, cross-reference and navigate
your source tree. It can understand various program file formats and
version control histories like SCCS, RCS, CVS, Subversion and Mercurial.


%package javadoc
Summary:        Javadoc for %{name}
Group:          Documentation
Requires:       jpackage-utils

%description javadoc
%{summary}.


%prep
%setup -q -n %{name}-%{version}-src
%{__unzip} -q ext/jrcs.zip
%patch0 -p1 -b .jrcs-import
%patch1 -p1 -b .nocplib
# Can't create backups
%patch2 -p1
%patch3 -p1 -b .manifest-classpath
%patch4 -p1 -b .nooverview
%patch5 -p1 -b .nochangeset

# This is not strictly needed, but to nuke prebuilt stuff
# makes us feel warmer while building
find -name '*.jar' -o -name '*.class' -o -name '*.war' -exec rm -f '{}' \;

# jrcs' javacc directory
sed '
        s,\(property name="javacc.lib.dir" value="\)[^"]*,\1%{_javadir},;
        s,\(javacchome="\)[^"]*,\1${javacc.lib.dir},;
' -i jrcs/build.xml

# Default war configuration
sed 's,/opengrok/configuration.xml,%{_sysconfdir}/%{name}/configuration.xml,' \
        -i conf/web.xml

# README.Fedora
cp %{SOURCE4} .


%build
pushd jrcs
CLASSPATH=$(build-classpath oro) %{ant} -v all

popd
CLASSPATH=$(build-classpath jflex) %{ant} -v jar javadoc                                           \
        -Dfile.reference.org.apache.commons.jrcs.diff.jar=jrcs/lib/org.apache.commons.jrcs.diff.jar \
        -Dfile.reference.org.apache.commons.jrcs.rcs.jar=jrcs/lib/org.apache.commons.jrcs.rcs.jar \
        -Dfile.reference.svn-javahl.jar=$(build-classpath svn-javahl.jar)                       \
        -Dfile.reference.lucene-core-2.2.0.jar=$(build-classpath lucene)                        \
        -Dfile.reference.lucene-spellchecker-2.2.0.jar=$(build-classpath lucene-contrib/lucene-spellchecker) \
        -Dfile.reference.ant.jar=$(build-classpath ant)                                         \
        -Dfile.reference.bcel-5.1.jar=$(build-classpath bcel)                                   \
        -Dfile.reference.jakarta-oro-2.0.8.jar=$(build-classpath jakarta-oro)                   \
        -Dfile.reference.servlet-api.jar=$(build-classpath servletapi5)                         \
        -Dfile.reference.swing-layout-0.9.jar=$(build-classpath swing-layout)

# SolBook is more-or-less DocBook subset, so this can be done safely
# FIXME: db2x_docbook2man output is not as nice as it should be
sed '
        s,^<!DOCTYPE.*,<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "docbookx.dtd">,
        s,^<?Pub Inc>,,
' dist/opengrok.1 |db2x_docbook2man -


%check
pushd jrcs
CLASSPATH=$(build-classpath junit4) %{ant} test

popd
CLASSPATH=$(build-classpath jflex junit4) %{ant} test


%install
rm -rf $RPM_BUILD_ROOT

# directories
install -d $RPM_BUILD_ROOT%{_javadir}
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}-jrcs
install -d $RPM_BUILD_ROOT%{_bindir}
install -d $RPM_BUILD_ROOT%{_mandir}/man1
install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/data
install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/src
install -d $RPM_BUILD_ROOT%{_datadir}/pixmaps

# jar
install -p -m 644 dist/opengrok.jar $RPM_BUILD_ROOT%{_javadir}/opengrok-%{version}.jar
ln -sf opengrok-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/opengrok.jar

# jrcs
install -d $RPM_BUILD_ROOT%{_javadir}/opengrok-jrcs

install -p -m 644 jrcs/lib/org.apache.commons.jrcs.rcs.jar \
        $RPM_BUILD_ROOT%{_javadir}/opengrok-jrcs/org.apache.commons.jrcs.rcs-%{version}.jar
ln -sf org.apache.commons.jrcs.rcs-%{version}.jar \
        $RPM_BUILD_ROOT%{_javadir}/opengrok-jrcs/org.apache.commons.jrcs.rcs.jar

install -p -m 644 jrcs/lib/org.apache.commons.jrcs.diff.jar \
        $RPM_BUILD_ROOT%{_javadir}/opengrok-jrcs/org.apache.commons.jrcs.diff-%{version}.jar
ln -sf org.apache.commons.jrcs.diff-%{version}.jar \
        $RPM_BUILD_ROOT%{_javadir}/opengrok-jrcs/org.apache.commons.jrcs.diff.jar

# bin
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}

# man
install -p -m 644 opengrok.1 $RPM_BUILD_ROOT%{_mandir}/man1

# javadoc
cp -pR dist/javadoc/. $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pR jrcs/doc/api/. $RPM_BUILD_ROOT%{_javadocdir}/%{name}-jrcs

# Configuration file
sed '
        s, at NAME@,%{name},;
        s, at VERSION@,%{version},;
        s, at RELEASE@,%{release},;
        s, at DOCDIR@,%{_docdir},;
        s, at LOCALSTATEDIR@,%{_localstatedir},;
' %{SOURCE2} >$RPM_BUILD_ROOT%{_sysconfdir}/%{name}/configuration.xml

# Menu entry
install conf/default/img/icon.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/opengrok.png
desktop-file-install --vendor=fedora                    \
        --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \
        %{SOURCE3}


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%{_javadir}/*
%{_bindir}/opengrok
%{_mandir}/man1/opengrok.1*
%{_localstatedir}/lib/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/opengrok.png
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/configuration.xml
%doc CHANGES.txt LICENSE.txt README.txt doc/EXAMPLE.txt README.Fedora


%files javadoc
%{_javadocdir}/*


%changelog
* Fri Apr 18 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.6-9.hg275
- Review from Deepak Bhole and Andrew Overholt: (#433312)
- Remove GCJ bits
- Preserve timestamps wherever it makes sense
- Fix dependencies of -javadoc subpackage
- Remove webapp subpackage for now
- Do not try to include nonexistent overview file in jrcs javadoc
- Do not call hg

* Wed Apr 09 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.6-8.hg275
- Fix the Junit tests

* Wed Apr 09 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.6-7.hg275
- Javadoc
- Return forgotten patch to nuke classpath from manifest

* Wed Apr 09 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.6-6.hg275
- Newer tip with bugfixes
- %%check with junit tests

* Thu Apr 03 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.6-5.hg260
- GCJ

* Thu Mar 27 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.6-4.hg260
- Convert the manpage to roff from SolBook

* Thu Mar 27 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.6-3.hg260
- Install manual
- Don't warn if subversion jar is not available
- Correct java options variable name

* Thu Mar 27 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.6-2.hg260
- Current tip

* Thu Mar 27 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.6-1
- New upstream release

* Tue Mar 18 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.5-9.hg206
- Patch from Trend Norbye to close file handles manually
- Possibly to work around the VM issue

* Thu Feb 21 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.5-8.hg206
- Go back to revision 206; where project used a shared lucene index
- Will be cherry-picking important commits until searching multiple project works again

* Thu Feb 21 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.5-7.e3806d642190
- Subversion finally fixed
- README.Fedora

* Wed Feb 20 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.5-6.e3806d642190
- trunk
- Webapp
- Desktop entry

* Tue Feb 19 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.5-5.c4dea0135445
- swing-layout from jpackage 1.6
- We don't actually need ant-tools

* Tue Feb 19 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.5-4.c4dea0135445
- Use our lucene, once we have version 2

* Mon Feb 18 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.5-3.c4dea0135445
- Fix the script
- Use Tomcat servlet api
- Use internal JRCS

* Mon Feb 18 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.5-2.c4dea0135445
- Use mercurial snapshot
- Attempt to use no prebuilt stuff

* Fri Jan 25 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.5-1
- Initial packaging attempt


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/opengrok/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	18 Apr 2008 16:26:48 -0000	1.1
+++ .cvsignore	18 Apr 2008 19:11:54 -0000	1.2
@@ -0,0 +1 @@
+opengrok-0.6-src.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/opengrok/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	18 Apr 2008 16:26:48 -0000	1.1
+++ sources	18 Apr 2008 19:11:54 -0000	1.2
@@ -0,0 +1 @@
+5599d757879b4a2ab5477190ffc74825  opengrok-0.6-src.tar.gz




More information about the fedora-extras-commits mailing list