[tika] 01/01: Imported Debian patch 1.5-3
Markus Koschany
apo-guest at moszumanska.debian.org
Sat Nov 21 13:42:51 UTC 2015
This is an automated email from the git hooks/post-receive script.
apo-guest pushed a commit to branch master
in repository tika.
commit 9bd77436bb5a2b3552752cbe69f40ebab65b1427
Author: Markus Koschany <apo at debian.org>
Date: Sat Nov 21 14:28:08 2015 +0100
Imported Debian patch 1.5-3
---
debian/changelog | 9 +-
debian/control | 5 +-
debian/maven.ignoreRules | 1 +
debian/maven.rules | 1 +
debian/patches/04-ignore-jhighlight.patch | 140 ++++++++++++++++++++++++++++++
debian/patches/series | 1 +
6 files changed, 151 insertions(+), 6 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 8421fd5..f186454 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,11 @@
-tika (1.5-3) UNRELEASED; urgency=medium
+tika (1.5-3) unstable; urgency=medium
- * Enabled the jhighlight support
+ * Team upload.
+ * Add a new maven rule for bnd >= 2.1.0.
+ * Tighten build dependency on bnd.
+ * Vcs-Browser: Use https.
- -- Emmanuel Bourg <ebourg at apache.org> Wed, 10 Jun 2015 00:32:29 -1200
+ -- Markus Koschany <apo at debian.org> Sat, 21 Nov 2015 14:28:08 +0100
tika (1.5-2) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index 99083c7..746d589 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
Uploaders: Emmanuel Bourg <ebourg at apache.org>
Build-Depends: cdbs, debhelper (>= 9), default-jdk, maven-debian-helper (>= 1.5)
-Build-Depends-Indep: bnd (>= 1.43.0),
+Build-Depends-Indep: bnd (>= 2.1.0),
libapache-mime4j-java (>= 0.7.2-3),
libapache-poi-java (>= 3.10),
libasm4-java,
@@ -12,7 +12,6 @@ Build-Depends-Indep: bnd (>= 1.43.0),
libboilerpipe-java,
libcommons-compress-java,
libjempbox-java,
- libjhighlight-java,
libjuniversalchardet-java,
libmaven-bundle-plugin-java,
libmetadata-extractor-java (>= 2.7.2-1~),
@@ -23,7 +22,7 @@ Build-Depends-Indep: bnd (>= 1.43.0),
libxmpcore-java
Standards-Version: 3.9.6
Vcs-Git: git://anonscm.debian.org/pkg-java/tika.git
-Vcs-Browser: http://anonscm.debian.org/cgit/pkg-java/tika.git
+Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/tika.git
Homepage: http://tika.apache.org
Package: libtika-java
diff --git a/debian/maven.ignoreRules b/debian/maven.ignoreRules
index 82c8f18..4eca5ed 100644
--- a/debian/maven.ignoreRules
+++ b/debian/maven.ignoreRules
@@ -1,5 +1,6 @@
com.googlecode.mp4parser isoparser * * * *
+com.uwyn jhighlight * * * *
edu.ucar netcdf * * * *
junit junit * * * *
org.apache.felix maven-scr-plugin * * * *
diff --git a/debian/maven.rules b/debian/maven.rules
index 0e2e357..83c279a 100644
--- a/debian/maven.rules
+++ b/debian/maven.rules
@@ -4,3 +4,4 @@ org.bouncycastle s/bcmail-jdk15on/bcmail/ * s/.*/debian/ * *
org.bouncycastle s/bcprov-jdk15/bcprov/ * s/.*/debian/ * *
org.bouncycastle s/bcprov-jdk15on/bcprov/ * s/.*/debian/ * *
org.ow2.asm * * s/.*/4.x/ * *
+s/biz.aQute/biz.aQute.bnd/ * * s/.*/debian/ * *
diff --git a/debian/patches/04-ignore-jhighlight.patch b/debian/patches/04-ignore-jhighlight.patch
new file mode 100644
index 0000000..cee0b85
--- /dev/null
+++ b/debian/patches/04-ignore-jhighlight.patch
@@ -0,0 +1,140 @@
+Description: Remove the classes using the jhighlight library which isn't in Debian yet
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
+
+--- a/tika-parsers/src/main/java/org/apache/tika/parser/code/SourceCodeParser.java
++++ /dev/null
+@@ -1,133 +0,0 @@
+-/*
+- * Licensed to the Apache Software Foundation (ASF) under one or more
+- * contributor license agreements. See the NOTICE file distributed with
+- * this work for additional information regarding copyright ownership.
+- * The ASF licenses this file to You under the Apache License, Version 2.0
+- * (the "License"); you may not use this file except in compliance with
+- * the License. You may obtain a copy of the License at
+- *
+- * http://www.apache.org/licenses/LICENSE-2.0
+- *
+- * Unless required by applicable law or agreed to in writing, software
+- * distributed under the License is distributed on an "AS IS" BASIS,
+- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+- * See the License for the specific language governing permissions and
+- * limitations under the License.
+- */
+-package org.apache.tika.parser.code;
+-
+-import static com.uwyn.jhighlight.renderer.XhtmlRendererFactory.CPP;
+-import static com.uwyn.jhighlight.renderer.XhtmlRendererFactory.GROOVY;
+-import static com.uwyn.jhighlight.renderer.XhtmlRendererFactory.JAVA;
+-
+-import java.io.IOException;
+-import java.io.InputStream;
+-import java.nio.charset.Charset;
+-import java.util.HashMap;
+-import java.util.Map;
+-import java.util.Set;
+-import java.util.regex.Matcher;
+-import java.util.regex.Pattern;
+-
+-import org.apache.tika.config.ServiceLoader;
+-import org.apache.tika.detect.AutoDetectReader;
+-import org.apache.tika.exception.TikaException;
+-import org.apache.tika.io.CloseShieldInputStream;
+-import org.apache.tika.metadata.Metadata;
+-import org.apache.tika.metadata.TikaCoreProperties;
+-import org.apache.tika.mime.MediaType;
+-import org.apache.tika.parser.ParseContext;
+-import org.apache.tika.parser.Parser;
+-import org.xml.sax.ContentHandler;
+-import org.xml.sax.SAXException;
+-
+-import com.uwyn.jhighlight.renderer.Renderer;
+-import com.uwyn.jhighlight.renderer.XhtmlRendererFactory;
+-/**
+- * Generic Source code parser for Java, Groovy, C++
+- *
+- * @author Hong-Thai.Nguyen
+- * @since 1.6
+- */
+-public class SourceCodeParser implements Parser {
+-
+- private static final long serialVersionUID = -4543476498190054160L;
+-
+- private static final Pattern authorPattern = Pattern.compile("(?im)@author (.*) *$");
+-
+- private static final Map<MediaType, String> TYPES_TO_RENDERER = new HashMap<MediaType, String>() {
+- private static final long serialVersionUID = -741976157563751152L;
+- {
+- put(MediaType.text("x-c++src"), CPP);
+- put(MediaType.text("x-java-source"), JAVA);
+- put(MediaType.text("x-groovy"), GROOVY);
+- }
+- };
+-
+- private static final ServiceLoader LOADER = new ServiceLoader(SourceCodeParser.class.getClassLoader());
+-
+- @Override
+- public Set<MediaType> getSupportedTypes(ParseContext context) {
+- return TYPES_TO_RENDERER.keySet();
+- }
+-
+- @Override
+- public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context)
+- throws IOException, SAXException, TikaException {
+-
+- AutoDetectReader reader = new AutoDetectReader(new CloseShieldInputStream(stream), metadata, context.get(ServiceLoader.class, LOADER));
+-
+- try {
+- Charset charset = reader.getCharset();
+- String mediaType = metadata.get(Metadata.CONTENT_TYPE);
+- String name = metadata.get(Metadata.RESOURCE_NAME_KEY);
+- if (mediaType != null && name != null) {
+- MediaType type = MediaType.parse(mediaType);
+- metadata.set(Metadata.CONTENT_TYPE, type.toString());
+- metadata.set(Metadata.CONTENT_ENCODING, charset.name());
+-
+- StringBuilder out = new StringBuilder();
+- String line;
+- int nbLines = 0;
+- while ((line = reader.readLine()) != null) {
+- out.append(line);
+- String author = parserAuthor(line);
+- if (author != null) {
+- metadata.add(TikaCoreProperties.CREATOR, author);
+- }
+- nbLines ++;
+- }
+- metadata.set("LoC", String.valueOf(nbLines));
+-
+- Renderer renderer = getRenderer(type.toString());
+- String codeAsHtml = renderer.highlight(name, out.toString(), charset.name(), false);
+- char[] charArray = codeAsHtml.toCharArray();
+- handler.startDocument();
+- handler.characters(charArray, 0, charArray.length);
+- handler.endDocument();
+- }
+- } finally {
+- reader.close();
+- }
+-
+- }
+-
+- private Renderer getRenderer(String mimeType) {
+- MediaType mt = MediaType.parse(mimeType);
+- String type = TYPES_TO_RENDERER.get(mt);
+- if (type == null) {
+- throw new RuntimeException("unparseable content type " + mimeType);
+- }
+- return XhtmlRendererFactory.getRenderer(type);
+- }
+-
+-
+- private String parserAuthor(String line) {
+- Matcher m = authorPattern.matcher(line);
+- if (m.find()) {
+- return m.group(1).trim();
+- }
+-
+- return null;
+- }
+-}
diff --git a/debian/patches/series b/debian/patches/series
index 9c6136e..be6ada8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,6 +1,7 @@
01-jar-packaging.patch
02-ignore-mp4parser.patch
03-ignore-netcdf.patch
+04-ignore-jhighlight.patch
05-osgi-compatibility.patch
06-optional-parser-dependencies.patch
07-metadata-extractor-2.7-compatibility.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/tika.git
More information about the pkg-java-commits
mailing list