diff --git a/h2.spec b/h2.spec index bbe38c5..c9c4a59 100644 --- a/h2.spec +++ b/h2.spec @@ -1,6 +1,6 @@ Name: h2 Version: 1.4.196 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Java SQL database # Most classes are dual licensed as EPL/MPL @@ -50,6 +50,12 @@ find -name '*.jar' -delete find -name '*.exe' -delete find -name '*.dll' -delete +%if 0%{?fedora} >= 29 +# Fix jts package name +sed -i -e 's/com\.vividsolutions\.jts/org.locationtech.jts/' $(find -name *.java) +sed -i -e 's/vividsolutions/vividsolutions locationtech/' src/tools/org/h2/build/doc/dictionary.txt +%endif + # Don't attempt to download from Internet sed -i -e '/downloadTest();/d' -e '/download();/d' \ src/tools/org/h2/build/Build.java @@ -88,6 +94,9 @@ sh build.sh jar docs testFast %license src/docsrc/html/license.html %changelog +* Fri Jun 08 2018 Mat Booth - 1.4.196-5 +- Fix build against newer lucenes + * Wed Feb 07 2018 Fedora Release Engineering - 1.4.196-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/port-to-lucene-6.patch b/port-to-lucene-6.patch index dcab8fe..19be17f 100644 --- a/port-to-lucene-6.patch +++ b/port-to-lucene-6.patch @@ -26,14 +26,14 @@ index 9f219d1..49dc47d 100644 - org.apache.lucene.search;version="[3.6.2,4.0.0)";resolution:=optional, - org.apache.lucene.store;version="[3.6.2,4.0.0)";resolution:=optional, - org.apache.lucene.util;version="[3.6.2,4.0.0)";resolution:=optional, -+ org.apache.lucene.analysis;version="[6.1.0,7.0.0)";resolution:=optional, -+ org.apache.lucene.analysis.standard;version="[6.1.0,7.0.0)";resolution:=optional, -+ org.apache.lucene.document;version="[6.1.0,7.0.0)";resolution:=optional, -+ org.apache.lucene.index;version="[6.1.0,7.0.0)";resolution:=optional, -+ org.apache.lucene.queryParser;version="[6.1.0,7.0.0)";resolution:=optional, -+ org.apache.lucene.search;version="[6.1.0,7.0.0)";resolution:=optional, -+ org.apache.lucene.store;version="[6.1.0,7.0.0)";resolution:=optional, -+ org.apache.lucene.util;version="[6.1.0,7.0.0)";resolution:=optional, ++ org.apache.lucene.analysis;version="[6.1.0,8.0.0)";resolution:=optional, ++ org.apache.lucene.analysis.standard;version="[6.1.0,8.0.0)";resolution:=optional, ++ org.apache.lucene.document;version="[6.1.0,8.0.0)";resolution:=optional, ++ org.apache.lucene.index;version="[6.1.0,8.0.0)";resolution:=optional, ++ org.apache.lucene.queryParser;version="[6.1.0,8.0.0)";resolution:=optional, ++ org.apache.lucene.search;version="[6.1.0,8.0.0)";resolution:=optional, ++ org.apache.lucene.store;version="[6.1.0,8.0.0)";resolution:=optional, ++ org.apache.lucene.util;version="[6.1.0,8.0.0)";resolution:=optional, com.vividsolutions.jts.geom;version="1.14.0";resolution:=optional, com.vividsolutions.jts.io;version="1.14.0";resolution:=optional, org.h2;version="[${version},1.5.0)", @@ -65,7 +65,7 @@ index f24bcab..d9c5b92 100644 - IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_30, analyzer); + new RAMDirectory() : FSDirectory.open(new File(path).toPath()); + Analyzer analyzer = new StandardAnalyzer(); -+ analyzer.setVersion(Version.LUCENE_5_4_1); ++ analyzer.setVersion(Version.LUCENE_6_1_0); + IndexWriterConfig conf = new IndexWriterConfig(analyzer); conf.setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND); IndexWriter writer = new IndexWriter(indexDir, conf); @@ -92,6 +92,19 @@ index f24bcab..d9c5b92 100644 LUCENE_FIELD_DATA, analyzer); Query query = parser.parse(text); // Lucene 3 insists on a hard limit and will not provide +@@ -440,10 +443,10 @@ + int maxResults = (limit == 0 ? 100 : limit) + offset; + TopDocs docs = searcher.search(query, maxResults); + if (limit == 0) { +- limit = docs.totalHits; ++ limit = (int)docs.totalHits; + } + for (int i = 0, len = docs.scoreDocs.length; +- i < limit && i + offset < docs.totalHits ++ i < limit && i + offset < (int)docs.totalHits + && i + offset < len; i++) { + ScoreDoc sd = docs.scoreDocs[i + offset]; + Document doc = searcher.doc(sd.doc); @@ -604,9 +607,8 @@ try { indexAccess.writer.commit();