Index: /trunk/dports/java/apache-solr/Portfile
===================================================================
--- /trunk/dports/java/apache-solr/Portfile	(revision 98745)
+++ /trunk/dports/java/apache-solr/Portfile	(revision 98746)
@@ -4,101 +4,9 @@
 PortSystem          1.0
 
+replaced_by         apache-solr3
+PortGroup           obsolete 1.0
+
 name                apache-solr
 version             3.6.1
+revision            1
 categories          java textproc
-maintainers         gmail.com:haya10.ito hum openmaintainer
-
-description         An open source enterprise search platform.
-long_description    Solr is the popular, blazing fast open source enterprise \
-                    search platform from the Apache Lucene project.
-
-homepage            http://lucene.apache.org/solr/
-platforms           darwin
-supported_archs     noarch
-license             Apache-2
-
-extract.suffix      .tgz
-
-# install jquery file.
-set jquery_file     jquery-1.7.2.min.js
-
-distfiles-append    ${jquery_file}:js
-
-master_sites        apache:lucene/solr/${version}/ \
-                    http://code.jquery.com/:js
-checksums           ${distname}${extract.suffix} \
-                    rmd160  7e21a5e9bcfbd931457780ce64e681eec1c36e17 \
-                    sha256  1b4552ba95c8456d4fbd596e82028eaa0619b6942786e98e1c4c31258543c708 \
-                    ${jquery_file} \
-                    rmd160  225961b3a1283b366b41e1c20a00708c01cdc1b1 \
-                    sha256  47b68dce8cb6805ad5b3ea4d27af92a241f4e29a5c12a274c852e4346a0500b4
-
-extract.only-delete ${jquery_file}
-
-# set the destination paths.
-set java_basepath   ${prefix}/share/java
-set solr_destpath   ${java_basepath}/${distname}
-set solr_path       ${solr_destpath}/example
-set solr_home       ${solr_path}/solr
-
-patchfiles          patch-head.vm.diff
-
-post-patch {
-    # copy jquery file.
-    copy ${distpath}/${jquery_file} ${worksrcpath}/example/solr/conf/velocity/
-    # expand relative pathes into abusolute ones.
-    reinplace "s|\"\\.\\./\\.\\./|\"${solr_destpath}/|g" \
-        ${worksrcpath}/example/solr/conf/solrconfig.xml
-}
-
-use_configure       no
-
-build {}
-
-destroot {
-    # copy the distribution.
-    xinstall -d         ${destroot}${java_basepath}
-    copy ${worksrcpath} ${destroot}${java_basepath}
-    # install the solr script.
-    xinstall -m 755 ${filespath}/solr.in     ${destroot}${prefix}/bin/solr
-    reinplace "s|@solr_path@|${solr_path}|g" ${destroot}${prefix}/bin/solr
-    reinplace "s|@solr_home@|${solr_home}|g" ${destroot}${prefix}/bin/solr
-}
-
-notes "
-To try apache-solr, run 'sudo solr' and open http://localhost:8983/solr/browse.
-To store sample documents, run 'cd ${solr_path}/exampledocs && ./post.sh *.xml'."
-
-# solr home for Japanese configurations.
-set solr_home_ja    ${solr_home}-ja
-
-variant ja description {Add Japanese settings} {
-    # create Japanese solr home 'solr-ja'.
-    post-extract {
-        copy ${worksrcpath}/example/solr ${worksrcpath}/example/solr-ja
-    }
-    patchfiles-append   patch-solr-ja.diff
-    post-patch {
-        # expand relative pathes into abusolute ones.
-        reinplace "s|\"\\.\\./\\.\\./|\"${solr_destpath}/|g" \
-            ${worksrcpath}/example/solr-ja/conf/solrconfig.xml
-    }
-    post-destroot {
-        # install a property file for UTF-8 encoding.
-        copy ${filespath}/velocity.properties ${destroot}${solr_home_ja}/conf
-        # copy a sample Japanese doc for testing.
-        copy ${filespath}/solr-ja.xml ${destroot}${solr_path}/exampledocs
-        # install the solr-ja script.
-        xinstall -m 755 ${filespath}/solr.in        ${destroot}${prefix}/bin/solr-ja
-        reinplace "s|@solr_path@|${solr_path}|g"    ${destroot}${prefix}/bin/solr-ja
-        reinplace "s|@solr_home@|${solr_home_ja}|g" ${destroot}${prefix}/bin/solr-ja
-    }
-    notes-append "
-
-For Japanese texts, please run 'sudo solr-ja' instead of 'sudo solr'.
-See ${solr_home_ja}."
-}
-
-livecheck.type      regex
-livecheck.url       http://www.apache.org/dist/lucene/solr/
-livecheck.regex     (\[0-9.\]+)\/
Index: /trunk/dports/java/apache-solr3/Portfile
===================================================================
--- /trunk/dports/java/apache-solr3/Portfile	(revision 98746)
+++ /trunk/dports/java/apache-solr3/Portfile	(revision 98746)
@@ -0,0 +1,107 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem          1.0
+
+name                apache-solr3
+version             3.6.1
+categories          java textproc
+maintainers         hum gmail.com:haya10.ito openmaintainer
+
+description         An open source enterprise search platform.
+
+long_description    Solr is the popular, blazing fast open source enterprise \
+                    search platform from the Apache Lucene project.
+
+homepage            http://lucene.apache.org/solr/
+platforms           darwin
+supported_archs     noarch
+license             Apache-2
+
+dist_subdir         apache-solr
+distname            apache-solr-${version}
+extract.suffix      .tgz
+
+# install jquery file.
+set jquery_file     jquery-1.7.2.min.js
+
+distfiles-append    ${jquery_file}:js
+
+master_sites        apache:lucene/solr/${version}/ \
+                    http://code.jquery.com/:js
+checksums           ${distname}${extract.suffix} \
+                    rmd160  7e21a5e9bcfbd931457780ce64e681eec1c36e17 \
+                    sha256  1b4552ba95c8456d4fbd596e82028eaa0619b6942786e98e1c4c31258543c708 \
+                    ${jquery_file} \
+                    rmd160  225961b3a1283b366b41e1c20a00708c01cdc1b1 \
+                    sha256  47b68dce8cb6805ad5b3ea4d27af92a241f4e29a5c12a274c852e4346a0500b4
+
+extract.only-delete ${jquery_file}
+
+# set the destination paths.
+set java_basepath   ${prefix}/share/java
+set solr_destpath   ${java_basepath}/${distname}
+set solr_path       ${solr_destpath}/example
+set solr_home       ${solr_path}/solr
+
+patchfiles          patch-head.vm.diff
+
+post-patch {
+    # copy jquery file.
+    copy ${distpath}/${jquery_file} ${worksrcpath}/example/solr/conf/velocity/
+    # expand relative pathes into abusolute ones.
+    reinplace "s|\"\\.\\./\\.\\./|\"${solr_destpath}/|g" \
+        ${worksrcpath}/example/solr/conf/solrconfig.xml
+}
+
+use_configure       no
+
+build {}
+
+destroot {
+    # copy the distribution.
+    xinstall -d         ${destroot}${java_basepath}
+    copy ${worksrcpath} ${destroot}${java_basepath}
+    # install the solr script.
+    xinstall -m 755 ${filespath}/solr.in     ${destroot}${prefix}/bin/solr3
+    reinplace "s|@solr_path@|${solr_path}|g" ${destroot}${prefix}/bin/solr3
+    reinplace "s|@solr_home@|${solr_home}|g" ${destroot}${prefix}/bin/solr3
+}
+
+notes "
+To try apache-solr3, run 'sudo solr3' and open http://localhost:8983/solr/browse.
+To store sample documents, run 'cd ${solr_path}/exampledocs && ./post.sh *.xml'."
+
+# solr home for Japanese configurations.
+set solr_home_ja    ${solr_home}-ja
+
+variant ja description {Add Japanese settings} {
+    # create Japanese solr home 'solr-ja'.
+    post-extract {
+        copy ${worksrcpath}/example/solr ${worksrcpath}/example/solr-ja
+    }
+    patchfiles-append   patch-solr-ja.diff
+    post-patch {
+        # expand relative pathes into abusolute ones.
+        reinplace "s|\"\\.\\./\\.\\./|\"${solr_destpath}/|g" \
+            ${worksrcpath}/example/solr-ja/conf/solrconfig.xml
+    }
+    post-destroot {
+        # install a property file for UTF-8 encoding.
+        copy ${filespath}/velocity.properties ${destroot}${solr_home_ja}/conf
+        # copy a sample Japanese doc for testing.
+        copy ${filespath}/solr-ja.xml ${destroot}${solr_path}/exampledocs
+        # install the solr-ja script.
+        xinstall -m 755 ${filespath}/solr.in        ${destroot}${prefix}/bin/solr3-ja
+        reinplace "s|@solr_path@|${solr_path}|g"    ${destroot}${prefix}/bin/solr3-ja
+        reinplace "s|@solr_home@|${solr_home_ja}|g" ${destroot}${prefix}/bin/solr3-ja
+    }
+    notes-append "
+
+For Japanese texts, please run 'sudo solr3-ja' instead of 'sudo solr3'.
+See ${solr_home_ja}."
+}
+
+livecheck.type      regex
+livecheck.url       http://www.apache.org/dist/lucene/solr/
+livecheck.regex     (3.\[0-9.\]+)\/
Index: /trunk/dports/java/apache-solr3/files/patch-head.vm.diff
===================================================================
--- /trunk/dports/java/apache-solr3/files/patch-head.vm.diff	(revision 98746)
+++ /trunk/dports/java/apache-solr3/files/patch-head.vm.diff	(revision 98746)
@@ -0,0 +1,11 @@
+--- example/solr/conf/velocity/head.vm.orig	2012-07-17 18:39:39.000000000 +0900
++++ example/solr/conf/velocity/head.vm	2012-08-02 13:50:10.000000000 +0900
+@@ -20,7 +20,7 @@
+ <title>#param('title')</title>
+     <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+ 
+-<script type="text/javascript" src="#{url_for_solr}/admin/jquery-1.4.3.min.js"></script>
++<script type="text/javascript" src="#{url_for_solr}/admin/file?file=/velocity/jquery-1.7.2.min.js&contentType=text/javascript"></script>
+   <link rel="stylesheet" type="text/css" href="#{url_for_solr}/admin/file?file=/velocity/main.css&contentType=text/css"/>
+   <link rel="stylesheet" href="#{url_for_solr}/admin/file?file=/velocity/jquery.autocomplete.css&contentType=text/css" type="text/css" />
+   <script type="text/javascript" src="#{url_for_solr}/admin/file?file=/velocity/jquery.autocomplete.js&contentType=text/javascript"></script>
Index: /trunk/dports/java/apache-solr3/files/patch-solr-ja.diff
===================================================================
--- /trunk/dports/java/apache-solr3/files/patch-solr-ja.diff	(revision 98746)
+++ /trunk/dports/java/apache-solr3/files/patch-solr-ja.diff	(revision 98746)
@@ -0,0 +1,40 @@
+--- example/solr-ja/conf/schema.xml.orig	2012-03-31 01:07:12.000000000 +0900
++++ example/solr-ja/conf/schema.xml	2012-04-13 00:51:09.000000000 +0900
+@@ -931,7 +931,7 @@
+ 
+    <!-- catchall field, containing all other searchable text fields (implemented
+         via copyField further on in this schema  -->
+-   <field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>
++   <field name="text" type="text_ja" indexed="true" stored="false" multiValued="true"/>
+ 
+    <!-- catchall text field that indexes tokens both normally and in reverse for efficient
+         leading wildcard queries. -->
+--- example/solr-ja/conf/solrconfig.xml.orig	2012-03-31 01:07:12.000000000 +0900
++++ example/solr-ja/conf/solrconfig.xml	2012-04-13 00:51:09.000000000 +0900
+@@ -798,6 +798,7 @@
+        <str name="wt">velocity</str>
+ 
+        <str name="v.template">browse</str>
++       <str name="v.properties">velocity.properties</str>
+        <str name="v.layout">layout</str>
+        <str name="title">Solritas</str>
+ 
+--- example/solr-ja/conf/velocity/head.vm.orig	2011-09-03 23:57:07.000000000 +0900
++++ example/solr-ja/conf/velocity/head.vm	2011-09-05 23:56:41.000000000 +0900
+@@ -32,7 +32,7 @@
+            extraParams:{
+              'terms.prefix': function() { return $("\#q").val();},
+              'terms.sort': 'count',
+-             'terms.fl': 'name',
++             'terms.fl': 'text',
+              'wt': 'velocity',
+              'v.template': 'suggest'
+            }
+--- example/solr-ja/conf/velocity/suggest.vm.orig	2011-09-03 23:57:07.000000000 +0900
++++ example/solr-ja/conf/velocity/suggest.vm	2011-09-05 23:57:16.000000000 +0900
+@@ -1,3 +1,3 @@
+-#foreach($t in $response.response.terms.name)
++#foreach($t in $response.response.terms.text)
+ $t.key
+ #end
+\ No newline at end of file
Index: /trunk/dports/java/apache-solr3/files/solr-ja.xml
===================================================================
--- /trunk/dports/java/apache-solr3/files/solr-ja.xml	(revision 98746)
+++ /trunk/dports/java/apache-solr3/files/solr-ja.xml	(revision 98746)
@@ -0,0 +1,14 @@
+<add>
+<doc>
+  <field name="id">SOLR2000</field>
+  <field name="name">Solr(ソーラ), オープンソースの全文検索システム</field>
+  <field name="manu">Apacheソフトウェア財団</field>
+  <field name="cat">ソフトウェア</field>
+  <field name="cat">検索</field>
+  <field name="features">Luceneを使った先進的な全文検索機能</field>
+  <field name="price">0</field>
+  <field name="popularity">10</field>
+  <field name="inStock">true</field>
+  <field name="incubationdate_dt">2006-01-17T00:00:00.000Z</field>
+</doc>
+</add>
Index: /trunk/dports/java/apache-solr3/files/solr.in
===================================================================
--- /trunk/dports/java/apache-solr3/files/solr.in	(revision 98746)
+++ /trunk/dports/java/apache-solr3/files/solr.in	(revision 98746)
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+CMDNAME=`basename "$0"`
+
+usage() {
+    echo "Usage: ${CMDNAME} [-h|--help] [-d data_dir] [solr_home]" 1>&2
+    exit 1
+}
+
+SOLR_PATH=@solr_path@
+SOLR_HOME=@solr_home@
+SOLR_DATA=${SOLR_HOME}/data
+
+while test -n "$1"; do
+    case "$1" in
+        -h|--help) usage ;;
+        -d|--datadir) shift 
+                   SOLR_DATA=$1;;
+        *)         SOLR_HOME="$1";;
+    esac
+    shift
+done
+
+java -Dsolr.clustering.enabled=true \
+     -Dsolr.solr.home="${SOLR_HOME}" \
+     -Dsolr.data.dir="${SOLR_DATA}" \
+     -Djetty.home="${SOLR_PATH}" \
+     -jar ${SOLR_PATH}/start.jar
Index: /trunk/dports/java/apache-solr3/files/velocity.properties
===================================================================
--- /trunk/dports/java/apache-solr3/files/velocity.properties	(revision 98746)
+++ /trunk/dports/java/apache-solr3/files/velocity.properties	(revision 98746)
@@ -0,0 +1,2 @@
+input.encoding=UTF-8
+output.encoding=UTF-8
