Initial import (rhbz#1202470).

This commit is contained in:
gil 2016-11-03 14:44:12 +01:00
commit bf87e9f4ab
4 changed files with 198 additions and 0 deletions

1
.gitignore vendored
View file

@ -0,0 +1 @@
/42d7aef60138.tar.gz

View file

@ -0,0 +1 @@
027cc3625cc202d3b07e97846ab58b8c 42d7aef60138.tar.gz

View file

@ -0,0 +1,65 @@
<!--
* Copyright (c) 2007-2012 Mozilla Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nu.validator.htmlparser</groupId>
<artifactId>translator</artifactId>
<packaging>bundle</packaging>
<version>@VERSION@</version>
<name>translator</name>
<url>http://about.validator.nu/htmlparser/</url>
<description>The Java-to-C++ translator.</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<sourceDirectory>.</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Main-Class>nu.validator.htmlparser.cpptranslate.Main</Main-Class>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>nu.validator.htmlparser</groupId>
<artifactId>htmlparser</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.javaparser</groupId>
<artifactId>javaparser</artifactId>
<version>1.0.8</version>
</dependency>
</dependencies>
</project>

131
validator-htmlparser.spec Normal file
View file

@ -0,0 +1,131 @@
# Test are disabled by default
# Not available test deps
# https://bugzilla.redhat.com/show_bug.cgi?id=1202504
%bcond_with tests
%global hghash 42d7aef60138
%global oname htmlparser
Name: validator-htmlparser
Version: 1.4
Release: 1%{?dist}
Summary: An implementation of the HTML5 parsing algorithm in Java
# LGPL (v3 or later): translator-src/nu/validator/htmlparser/cpptranslate/CppVisitor.java
# MIT/X11 (BSD like): translator-src/nu/validator/htmlparser/generator/ApplyHotSpotWorkaround.java
# translator-src/nu/validator/htmlparser/generator/GenerateNamedCharacters.java
# MPL (v1.1) GPL: translator-src/nu/validator/htmlparser/generator/GenerateNamedCharactersCpp.java
# translator-src/nu/validator/htmlparser/cpptranslate/*
# MIT/X11 (BSD like): src/nu/validator/htmlparser/*
# BSD (3 clause): src/nu/validator/htmlparser/rewindable/Rewindable.java
# src/nu/validator/htmlparser/rewindable/RewindableInputStream.java
# BSD MIT: pom.xml
License: BSD and GPLv2+ and LGPLv3 and MIT and MPLv1.1
URL: http://about.validator.nu/htmlparser/
Source0: https://hg.mozilla.org/projects/htmlparser/archive/%{hghash}.tar.gz
Source1: validator-htmlparser-translator-template-pom.xml
BuildRequires: maven-local
BuildRequires: mvn(com.google.code.javaparser:javaparser)
BuildRequires: mvn(com.ibm.icu:icu4j)
%if %{with test}
BuildRequires: mvn(com.sdicons.jsontools:jsontools-core)
%endif
BuildRequires: mvn(net.sourceforge.jchardet:jchardet)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
BuildRequires: mvn(xom:xom)
BuildArch: noarch
%description
The Validator.nu HTML Parser is an implementation of the
HTML5 parsing algorithm in Java for applications. The parser
is designed to work as a drop-in replacement for the
XML parser in applications that already support XHTML 1.x
content with an XML parser and use SAX, DOM or XOM to
interface with the parser.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n %{oname}-%{hghash}
%pom_remove_plugin org.codehaus.mojo:rpm-maven-plugin
%if %{without test}
%pom_remove_dep com.sdicons.jsontools:jsontools-core
rm -r test-src/*
%else
%pom_xpath_set "pom:skip" false
%endif
%pom_xpath_remove "pom:dependency[pom:artifactId= 'tools']/pom:scope"
%pom_xpath_remove "pom:dependency[pom:artifactId= 'tools']/pom:systemPath"
# Fix invailid chars using JVM tool
for file in src/nu/validator/htmlparser/impl/Tokenizer.java \
src/nu/validator/htmlparser/impl/TreeBuilder.java \
translator-src/nu/validator/htmlparser/cpptranslate/CppVisitor.java
do
native2ascii -encoding UTF8 ${file} ${file}
done
# Build fix for javaparser 1.0.11
sed -i "s|japa.parser.ast.BlockComment|japa.parser.ast.comments.BlockComment|" \
translator-src/nu/validator/htmlparser/cpptranslate/CppVisitor.java
sed -i "s|japa.parser.ast.LineComment|japa.parser.ast.comments.LineComment|" \
translator-src/nu/validator/htmlparser/cpptranslate/CppVisitor.java
sed -i "s|japa.parser.ast.body.JavadocComment|japa.parser.ast.comments.JavadocComment|" \
translator-src/nu/validator/htmlparser/cpptranslate/CppVisitor.java
cp -p %{SOURCE1} translator-src/pom.xml
sed -i "s|@VERSION@|%{version}|" translator-src/pom.xml
# This is a dummy POM added just to ease building in the RPM platforms
cat > %{oname}-pom.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>nu.validator.%{oname}</groupId>
<artifactId>%{oname}-project</artifactId>
<packaging>pom</packaging>
<version>%{version}</version>
<modules>
<module>.</module>
<module>translator-src</module>
</modules>
</project>
EOF
chmod 644 README.txt
%mvn_file nu.validator.%{oname}:htmlparser %{name}
%mvn_file nu.validator.%{oname}:translator %{name}-translator
%mvn_package :%{oname}-project __noinstall
%build
%if %{without test}
opts="-f"
%endif
%mvn_build $opts -- -f %{oname}-pom.xml
%install
%mvn_install
%files -f .mfiles
%doc README.txt
%license LICENSE.txt
%files javadoc -f .mfiles-javadoc
%license LICENSE.txt
%changelog
* Fri Oct 19 2012 gil cattaneo <puntogil@libero.it> 1.4-1
- initial rpm