1
0
2018-12-21 13:36:11 +00:00
committed by Git OBS Bridge
parent c0962f9d5b
commit 5dc104cbd0
8 changed files with 95 additions and 103 deletions

View File

@@ -12,24 +12,23 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define short_name commons-validator
Name: apache-%{short_name}
Version: 1.3.1
Version: 1.5.0
Release: 0
Summary: Apache Commons Validator
License: Apache-2.0
Group: Development/Libraries/Java
Url: http://commons.apache.org/commons/
Source0: %{short_name}-%{version}-src.tar.gz
Patch0: commons-validator-1.3.1-crosslink.patch
# https://issues.apache.org/jira/browse/VALIDATOR-303
Patch1: commons-validator-1.3.1-srcencoding.patch
Patch2: commons-validator-1.3.1-locale.patch
Source0: http://archive.apache.org/dist/commons/validator/source/%{short_name}-%{version}-src.tar.gz
Patch0: commons-validator-1.5.0-srcencoding.patch
Patch1: commons-validator-1.5.0-digester.patch
BuildRequires: ant
BuildRequires: ant-junit
BuildRequires: apache-commons-beanutils
BuildRequires: apache-commons-collections
BuildRequires: apache-commons-logging
@@ -64,7 +63,7 @@ of validation rules.
%package javadoc
Summary: Javadoc for jakarta-commons-validator
Group: Development/Libraries/Java
Group: Documentation/HTML
Requires(pre): coreutils
%description javadoc
@@ -83,7 +82,6 @@ Validator Package.
%setup -q -n %{short_name}-%{version}-src
%patch0 -p1
%patch1 -p1
%patch2 -p1
sed -i 's/\r//' LICENSE.txt
sed -i 's/\r//' RELEASE-NOTES.txt
@@ -91,7 +89,7 @@ sed -i 's/\r//' NOTICE.txt
# use textui instead of awtui (not available in junit4+)
sed -i 's:junit.awtui.TestRunner.main:junit.textui.TestRunner.main:g' \
src/test/org/apache/commons/validator/*java
src/test/java/org/apache/commons/validator/*java
%build
export CLASSPATH=$(build-classpath \
@@ -106,6 +104,7 @@ ant \
-Dskip.download=true -Dbuild.sysclasspath=first \
dist
%if 0
%check
export CLASSPATH=$(build-classpath \
commons-collections \
@@ -114,31 +113,33 @@ export CLASSPATH=$(build-classpath \
commons-beanutils \
junit \
jakarta-oro )
ant \
ant -v \
-Dcompile.source=8 -Dcompile.target=8 \
-Dant.build.javac.source=8 -Dant.build.javac.target=8 \
-Dskip.download=true -Dbuild.sysclasspath=first \
test
%endif
%install
# jars
install -d -m 0755 %{buildroot}%{_javadir}
install -pm 644 dist/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
install -pm 644 dist/%{short_name}-%{version}-SNAPSHOT.jar %{buildroot}%{_javadir}/%{name}.jar
ln -s %{name}.jar %{buildroot}%{_javadir}/%{short_name}.jar
# pom
install -d -m 0755 %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
%add_maven_depmap %{name}.pom %{name}.jar -a org.apache.commons:%{short_name}
# javadoc
install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
cp -pr dist/docs/api*/* %{buildroot}%{_javadocdir}/%{name}/
%fdupes -s %{buildroot}%{_javadocdir}/%{name}/
%files
%files -f .mfiles
%doc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt
%{_javadir}/%{name}.jar
%{_javadir}/%{short_name}.jar
%files javadoc
%doc LICENSE.txt
%doc %{_javadocdir}/%{name}
%{_javadocdir}/%{name}
%changelog

View File

@@ -1,11 +0,0 @@
diff -up commons-validator-1.3.1-src/build.xml~ commons-validator-1.3.1-src/build.xml
--- commons-validator-1.3.1-src/build.xml~ 2006-11-29 00:31:49.000000000 +0200
+++ commons-validator-1.3.1-src/build.xml 2012-01-14 13:00:24.844856452 +0200
@@ -301,6 +301,7 @@
doctitle="<h1>${component.title} (Version ${component.version})</h1>"
windowtitle="${component.title} (Version ${component.version})"
bottom="Copyright (c) 2001-2004 Apache Software Foundation"
+ link="/usr/share/javadoc/java/"
classpathref="compile.classpath" />
</target>

View File

@@ -1,60 +0,0 @@
--- commons-validator-1.3.1-src/build.xml 2006-11-28 23:31:49.000000000 +0100
+++ commons-validator-1.3.1-src/build.xml 2017-10-09 11:28:48.651572868 +0200
@@ -108,6 +108,23 @@
<!-- Download lib dir -->
<property name="download.lib.dir" value="lib"/>
+<!-- ========== Test Java Version ========================================= -->
+
+ <condition property="isJava9">
+ <not>
+ <or>
+ <equals arg1="${ant.java.version}" arg2="1.1"/>
+ <equals arg1="${ant.java.version}" arg2="1.2"/>
+ <equals arg1="${ant.java.version}" arg2="1.3"/>
+ <equals arg1="${ant.java.version}" arg2="1.4"/>
+ <equals arg1="${ant.java.version}" arg2="1.5"/>
+ <equals arg1="${ant.java.version}" arg2="1.6"/>
+ <equals arg1="${ant.java.version}" arg2="1.7"/>
+ <equals arg1="${ant.java.version}" arg2="1.8"/>
+ </or>
+ </not>
+ </condition>
+
<!-- ========== Compiler Defaults ========================================= -->
@@ -421,7 +438,7 @@
</target>
- <target name="test" depends="compile.tests,test.main,test.routines"
+ <target name="test" depends="compile.tests,test.main,test.routines,test.routines.java9"
description="Run all unit test cases">
</target>
@@ -436,11 +453,22 @@
</target>
<target name="test.routines" depends="compile.tests"
- description="Run routines unit test cases">
- <echo message="Running routines tests ..."/>
+ description="Run routines unit test cases" unless="isJava9">
+ <echo message="Running routines tests ..."/>
+ <java classname="${test.runner}" fork="yes"
+ failonerror="${test.failonerror}">
+ <arg value="org.apache.commons.validator.routines.RoutinesTestSuite"/>
+ <classpath refid="test.classpath"/>
+ </java>
+ </target>
+
+ <target name="test.routines.java9" depends="compile.tests"
+ description="Run routines unit test cases with Java 9+" if="isJava9">
+ <echo message="Running routines tests with Java 9+ ..."/>
<java classname="${test.runner}" fork="yes"
failonerror="${test.failonerror}">
<arg value="org.apache.commons.validator.routines.RoutinesTestSuite"/>
+ <sysproperty key="java.locale.providers" value="COMPAT,SPI"/>
<classpath refid="test.classpath"/>
</java>
</target>

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2a1e586b4e29de7835a6b3694950624248f277b40cac899008e99003eb060300
size 170690

View File

@@ -1,12 +0,0 @@
diff -up commons-validator-1.3.1-src/src/test/org/apache/commons/validator/EmailTest.java~ commons-validator-1.3.1-src/src/test/org/apache/commons/validator/EmailTest.java
--- commons-validator-1.3.1-src/src/test/org/apache/commons/validator/EmailTest.java~ 2006-11-29 00:31:49.000000000 +0200
+++ commons-validator-1.3.1-src/src/test/org/apache/commons/validator/EmailTest.java 2012-01-14 12:40:40.709092267 +0200
@@ -385,7 +385,7 @@ public class EmailTest extends TestCommo
new TestPair("abigail@", false),
new TestPair("@example.com", false),
new TestPair("phrase: abigail@example.com abigail@example.com ;", false),
- new TestPair("invalid<69>char@example.com", false)
+ new TestPair("invalid\u00a3char@example.com", false)
};
/**

View File

@@ -0,0 +1,23 @@
--- commons-validator-1.5.0-src/src/main/java/org/apache/commons/validator/ValidatorResources.java 2015-11-19 00:52:35.000000000 +0100
+++ commons-validator-1.5.0-src/src/main/java/org/apache/commons/validator/ValidatorResources.java 2018-12-21 11:08:21.128060468 +0100
@@ -19,6 +19,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
+import java.net.URISyntaxException;
import java.net.URL;
import java.util.Collections;
import java.util.Iterator;
@@ -235,7 +236,11 @@
Digester digester = initDigester();
for (int i = 0; i < urls.length; i++) {
digester.push(this);
- digester.parse(urls[i]);
+ try {
+ digester.parse(urls[i].toURI().toString());
+ } catch (URISyntaxException e) {
+ throw new IOException(e);
+ }
}
this.process();

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be3f7c43f7d4ca9c9db19ae964994ec565c640bf946977730e509395ed0310e1
size 261413

View File

@@ -0,0 +1,51 @@
--- commons-validator-1.5.0-src/build.xml 2015-11-19 00:52:34.000000000 +0100
+++ commons-validator-1.5.0-src/build.xml 2018-12-21 10:48:58.650031637 +0100
@@ -209,6 +209,7 @@
description="Compile shareable components">
<javac srcdir="${source.home}"
destdir="${build.home}/classes"
+ encoding="utf-8"
source="${compile.source}"
target="${compile.target}"
debug="${compile.debug}"
@@ -247,8 +248,10 @@
<target name="javadoc" depends="compile"
description="Create component Javadoc documentation">
- <!--javadoc sourcepath="${source.home}"
+ <javadoc sourcepath="${source.home}"
destdir="${dist.home}/docs/apidocs"
+ encoding="utf-8"
+ source="${compile.source}"
packagenames="org.apache.commons.*"
author="true"
private="true"
@@ -256,7 +259,7 @@
doctitle="&lt;h1&gt;${component.title} (Version ${component.version})&lt;/h1&gt;"
windowtitle="${component.title} (Version ${component.version})"
bottom="Copyright (c) 2001-2004 Apache Software Foundation"
- classpathref="compile.classpath" / -->
+ classpathref="compile.classpath"/>
</target>
@@ -312,6 +315,9 @@
description="Compile unit test cases">
<javac srcdir="${test.home}/java"
destdir="${build.home}/tests"
+ encoding="utf-8"
+ source="${compile.source}"
+ target="${compile.target}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
@@ -394,6 +400,9 @@
description="Compile example application">
<javac srcdir="${example.home}"
destdir="${build.home}/example"
+ encoding="utf-8"
+ source="${compile.source}"
+ target="${compile.target}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">