SHA256
1
0
forked from pool/bcel

Accepting request 1108225 from Java:packages

6.7.0

OBS-URL: https://build.opensuse.org/request/show/1108225
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/bcel?expand=0&rev=32
This commit is contained in:
Ana Guerrero 2023-09-01 12:18:48 +00:00 committed by Git OBS Bridge
commit ad4d4b512b
10 changed files with 241 additions and 282 deletions

View File

@ -1,11 +0,0 @@
--- bcel-5.2/build.xml 2017-09-27 18:59:57.110434113 +0200
+++ bcel-5.2/build.xml 2017-09-27 19:00:39.286692143 +0200
@@ -39,7 +39,7 @@
<target name="compile" description="o Compile the code" depends="get-deps">
<mkdir dir="${classesdir}">
</mkdir>
- <javac destdir="${classesdir}" deprecation="true" debug="true" optimize="false" excludes="**/package.html">
+ <javac destdir="${classesdir}" deprecation="true" debug="true" optimize="false" encoding="ISO-8859-1" excludes="**/package.html">
<src>
<pathelement location="src/java">
</pathelement>

View File

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

View File

@ -1,7 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQBEhYtsBGM6V3wgCUERApQvAKCS9aZhwXPt08teiwlBFuDFs7Rq3ACfSQDg
4lsgidm/aPrmx48f7SseOoE=
=SPdZ
-----END PGP SIGNATURE-----

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>org.apache.bcel</groupId>
<artifactId>bcel</artifactId>
<packaging>jar</packaging>
<version>5.2</version>
<dependencies>
<dependency>
<groupId>jakarta-regexp</groupId>
<artifactId>jakarta-regexp</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
</project>

3
bcel-6.7.0-src.tar.gz Normal file
View File

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

View File

@ -1,166 +0,0 @@
From f3267cbcc900f80851d561bdd16b239d936947f5 Mon Sep 17 00:00:00 2001
From: Richard Atkins <rjatkins359@gmail.com>
Date: Wed, 21 Sep 2022 23:18:58 +1000
Subject: [PATCH] BCEL-363 Enforce MAX_CP_ENTRIES in ConstantPoolGen and
ConstantPool.dump (#147)
* BCEL-363 Enforce MAX_CP_ENTRIES in ConstantPoolGen and ConstantPool.dump
* BCEL-363 Add test coverage for enforced size limit
* BCEL-363 Throw IllegalStateException instead of RuntimeException
* BCEL-363 Use final
---
.../org/apache/bcel/classfile/ConstantPool.java | 11 +++++++++--
.../org/apache/bcel/generic/ConstantPoolGen.java | 11 ++++++++++-
.../bcel/classfile/ConstantPoolTestCase.java | 15 +++++++++++++++
3 files changed, 34 insertions(+), 3 deletions(-)
Index: bcel/src/java/org/apache/bcel/classfile/ConstantPool.java
===================================================================
--- bcel.orig/src/java/org/apache/bcel/classfile/ConstantPool.java
+++ bcel/src/java/org/apache/bcel/classfile/ConstantPool.java
@@ -198,10 +198,17 @@ public class ConstantPool implements Clo
* @throws IOException
*/
public void dump( DataOutputStream file ) throws IOException {
- file.writeShort(constant_pool_count);
- for (int i = 1; i < constant_pool_count; i++) {
- if (constant_pool[i] != null) {
- constant_pool[i].dump(file);
+ /*
+ * Constants over the size of the constant pool shall not be written out.
+ * This is a redundant measure as the ConstantPoolGen should have already
+ * reported an error back in the situation.
+ */
+ final int size = Math.min(constant_pool.length, Constants.MAX_CP_ENTRIES);
+
+ file.writeShort(size);
+ for (int i = 1; i < size; i++) {
+ if (constant_pool[i] != null) {
+ constant_pool[i].dump(file);
}
}
}
Index: bcel/src/java/org/apache/bcel/generic/ConstantPoolGen.java
===================================================================
--- bcel.orig/src/java/org/apache/bcel/generic/ConstantPoolGen.java
+++ bcel/src/java/org/apache/bcel/generic/ConstantPoolGen.java
@@ -50,14 +50,16 @@ import org.apache.bcel.classfile.Constan
*/
public class ConstantPoolGen implements java.io.Serializable {
- protected int size = 1024; // Inital size, sufficient in most cases
- protected Constant[] constants = new Constant[size];
- protected int index = 1; // First entry (0) used by JVM
+ private static final int DEFAULT_BUFFER_SIZE = 256;
private static final String METHODREF_DELIM = ":";
private static final String IMETHODREF_DELIM = "#";
private static final String FIELDREF_DELIM = "&";
private static final String NAT_DELIM = "%";
+ protected int size = DEFAULT_BUFFER_SIZE;
+ protected Constant[] constants = new Constant[size];
+ protected int index = 1; // First entry (0) used by JVM
+
private static class Index implements java.io.Serializable {
int index;
@@ -75,6 +76,8 @@ public class ConstantPoolGen implements
* @param cs array of given constants, new ones will be appended
*/
public ConstantPoolGen(Constant[] cs) {
+
+ size = Math.min(Math.max(DEFAULT_BUFFER_SIZE, cs.length + 64), Constants.MAX_CP_ENTRIES + 1);
if (cs.length > size) {
size = cs.length;
constants = new Constant[size];
@@ -156,9 +159,18 @@ public class ConstantPoolGen implements
/** Resize internal array of constants.
*/
protected void adjustSize() {
+ // 3 extra spaces are needed as some entries may take 3 slots
+ if (index + 3 >= Constants.MAX_CP_ENTRIES + 1) {
+ throw new IllegalStateException("The number of constants " + (index + 3)
+ + " is over the size of the constant pool: "
+ + Constants.MAX_CP_ENTRIES);
+ }
+
if (index + 3 >= size) {
Constant[] cs = constants;
size *= 2;
+ // the constant array shall not exceed the size of the constant pool
+ size = Math.min(size, Constants.MAX_CP_ENTRIES + 1);
constants = new Constant[size];
System.arraycopy(cs, 0, constants, 0, index);
}
Index: bcel/src/test/java/org/apache/bcel/ConstantPoolTestCase.java
===================================================================
--- /dev/null
+++ bcel/src/test/java/org/apache/bcel/ConstantPoolTestCase.java
@@ -0,0 +1,64 @@
+/*
+ * 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.bcel.classfile;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+import org.apache.bcel.AbstractTestCase;
+import org.apache.bcel.Const;
+import org.apache.bcel.generic.ConstantPoolGen;
+import org.apache.bcel.generic.InstructionHandle;
+import org.apache.bcel.generic.InstructionList;
+import org.apache.bcel.generic.MethodGen;
+import org.junit.jupiter.api.Test;
+public class ConstantPoolTestCase extends AbstractTestCase {
+ private InstructionHandle[] getInstructionHandles(final JavaClass clazz, final ConstantPoolGen cp, final Method method) {
+ final MethodGen methodGen = new MethodGen(method, clazz.getClassName(), cp);
+ final InstructionList instructionList = methodGen.getInstructionList();
+ return instructionList.getInstructionHandles();
+ }
+ @Test
+ public void testConstantToString() throws ClassNotFoundException {
+ final JavaClass clazz = getTestClass(PACKAGE_BASE_NAME + ".data.SimpleClassWithDefaultConstructor");
+ final ConstantPoolGen cp = new ConstantPoolGen(clazz.getConstantPool());
+ final Method[] methods = clazz.getMethods();
+ for (final Method method : methods) {
+ if (method.getName().equals("<init>")) {
+ for (final InstructionHandle instructionHandle : getInstructionHandles(clazz, cp, method)) {
+ final String string = instructionHandle.getInstruction().toString(cp.getConstantPool());
+ assertNotNull(string);
+ // TODO Need real assertions.
+ // System.out.println(string);
+ }
+ }
+ }
+ }
+
+ @Test
+ public void testTooManyConstants() throws ClassNotFoundException {
+ final JavaClass clazz = getTestClass(PACKAGE_BASE_NAME + ".data.SimpleClassWithDefaultConstructor");
+ final ConstantPoolGen cp = new ConstantPoolGen(clazz.getConstantPool());
+
+ int i = cp.getSize();
+ while (i < Constants.MAX_CP_ENTRIES - 1) {
+ cp.addLong(i);
+ i = cp.getSize(); // i += 2
+ }
+ assertThrows(IllegalStateException.class, () -> cp.addLong(0));
+ }
+}

146
bcel-build.xml Normal file
View File

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="bcel" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property file="build.properties"/>
<property name="project.groupId" value="org.apache.bcel"/>
<property name="project.artifactId" value="bcel"/>
<property name="project.version" value="6.7.0"/>
<property name="spec.version" value="6.7"/>
<property name="compiler.source" value="1.8"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName" value="${project.artifactId}-${project.version}"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir" value="src/main/java"/>
<property name="build.resourceDir" value="."/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<!-- ====================================================================== -->
<!-- Defining classpaths -->
<!-- ====================================================================== -->
<path id="build.classpath">
<fileset dir="lib">
<include name="**/*"/>
</fileset>
</path>
<!-- ====================================================================== -->
<!-- Cleaning up target -->
<!-- ====================================================================== -->
<target name="clean" description="Clean the output directory">
<delete dir="${build.dir}"/>
</target>
<!-- ====================================================================== -->
<!-- Compilation target -->
<!-- ====================================================================== -->
<target name="compile" description="Compile the code">
<mkdir dir="${build.outputDir}"/>
<javac destdir="${build.outputDir}"
encoding="iso-8859-1"
nowarn="false"
debug="true"
optimize="false"
deprecation="true"
target="${compiler.target}"
verbose="false"
fork="false"
source="${compiler.source}">
<src>
<pathelement location="${build.srcDir}"/>
</src>
<classpath refid="build.classpath"/>
</javac>
<mkdir dir="${build.outputDir}/META-INF"/>
<copy todir="${build.outputDir}/META-INF">
<fileset dir="${build.resourceDir}">
<include name="NOTICE.txt"/>
<include name="LICENSE.txt"/>
<include name="NOTICE"/>
<include name="LICENSE"/>
</fileset>
</copy>
</target>
<!-- ====================================================================== -->
<!-- Javadoc target -->
<!-- ====================================================================== -->
<target name="javadoc" description="Generates the Javadoc of the application">
<javadoc sourcepath="${build.srcDir}"
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
verbose="false"
encoding="iso-8859-1"
version="true"
use="true"
author="true"
splitindex="false"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
docencoding="iso-8859-1"
source="${compiler.source}"
linksource="true"
breakiterator="false">
<classpath refid="build.classpath"/>
</javadoc>
</target>
<!-- ====================================================================== -->
<!-- Package target -->
<!-- ====================================================================== -->
<target name="package" depends="compile" description="Package the application">
<jar jarfile="${build.dir}/${build.finalName}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
excludes="**/package.html">
<manifest>
<attribute name="Automatic-Module-Name" value="org.apache.bcel"/>
<attribute name="Bundle-Description" value="Apache Commons Bytecode Engineering Library"/>
<attribute name="Bundle-DocURL" value="https://commons.apache.org/proper/commons-bcel"/>
<attribute name="Bundle-License" value="https://www.apache.org/licenses/LICENSE-2.0.txt"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="Apache Commons BCEL"/>
<attribute name="Bundle-SymbolicName" value="org.apache.bcel"/>
<attribute name="Bundle-Vendor" value="The Apache Software Foundation"/>
<attribute name="Bundle-Version" value="${project.version}"/>
<attribute name="Export-Package" value="org.apache.bcel.classfile;version=&quot;${project.version}&quot;,org.apache.bcel.generic;version=&quot;${project.version}&quot;,org.apache.bcel.util;version=&quot;${project.version}&quot;,org.apache.bcel.verifier.exc;version=&quot;${project.version}&quot;,org.apache.bcel.verifier.statics;version=&quot;${project.version}&quot;,org.apache.bcel.verifier.structurals;version=&quot;${project.version}&quot;,org.apache.bcel.verifier;version=&quot;${project.version}&quot;,org.apache.bcel;version=&quot;${project.version}&quot;"/>
<attribute name="Implementation-Title" value="Apache Commons BCEL"/>
<attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Version" value="${project.version}"/>
<attribute name="Import-Package" value="javax.swing,javax.swing.border,javax.swing.event,org.apache.commons.lang3"/>
<attribute name="Include-Resource" value="META-INF/NOTICE.txt=NOTICE.txt,META-INF/LICENSE.txt=LICENSE.txt"/>
<attribute name="Require-Capability" value="osgi.ee;filter:=&quot;(&amp;(osgi.ee=JavaSE)(version=${compiler.target}))&quot;"/>
<attribute name="Specification-Title" value="Apache Commons BCEL"/>
<attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<attribute name="Specification-Version" value="${spec.version}"/>
</manifest>
</jar>
</target>
<!-- ====================================================================== -->
<!-- A dummy target for the package named after the type it creates -->
<!-- ====================================================================== -->
<target name="jar" depends="package" description="Builds the jar for the application"/>
</project>

View File

@ -1,3 +1,63 @@
-------------------------------------------------------------------
Thu Aug 31 08:38:22 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Update to version 6.7.0
* 6.7.0 (2022-11-28) Maintenance and bug fix release.
* 6.6.1 (2022-10-29) Maintenance and bug fix release.
* 6.6.0 (2022-10-08) Minor feature and bug fix release.
* 6.5.0 (2020-06-05) Minor feature and bug fix release.
* 6.4.1 (2019-09-26) Bug fix release.
* 6.4.0 (2019-09-20) Feature and bug fix release.
* 6.3.1 (2019-03-20) Bug fix release
* 6.3 (2019-01-23) Experimental Java 9, 10, 11, 12-EA, and 13-EA
Support
* 6.2 (2017-12-08) Experimental Java 9 Support
* 6.1 (2017-09-14) Experimental Java 9 Support
* 6.0 (2016-07-10) Apache Commons BCEL 6.0 is a major release
supporting the new features introduced in Java 6, 7 and 8. It
requires Java 7 or higher to run.
COMPATIBILITY with 5.2
+ Binary compatible
- not strictly compatible
- The constant interface org.apache.bcel.Constants has been
deprecated. Classes which implemented this interface in 5.2
now use the constants defined in the org.apache.bcel.Const
class.
- The constant interface
org.apache.bcel.generic.InstructionConstants has been
deprecated. Classes which implemented this interface in 5.2
now use the constants defined in the
org.apache.bcel.generic.InstructionConsts class.
- Return type of method 'public java.lang.Object
getElementAt(int)' in org.apache.bcel.verifier
.VerifierFactoryListModel has been changed to
java.lang.String.
- The BCEL classes do no longer implement java.io.Serializable.
+ Source compatible
- Yes, sort of;
- The org.apache.bcel.classfile.Visitor interface has been
enhanced with additional methods. If you implemented it
directly instead of extending the EmptyVisitor class you'll
have to implement the new methods.
- The org.apache.bcel.generic.Visitor interface has been
enhanced with an additional method. If you implemented it
directly instead of extending the EmptyVisitor class you'll
have to implement the new methods.
+ Semantic compatible
- Yes, except:
- BCEL 6.0 handles new attributes such as code annotations
that could only be processed by implementing a custom
AttributeReader in the previous versions. Code relying on
this behavior will have to be adjusted since the
AttributeReader will no longer be called in these cases.
+ For full information about API changes please see the extended
Clirr report: https://commons.apache.org/bcel/clirr-report.html
- Removed patches:
* bcel-5.2-encoding.patch
+ part of our own build.xml file generated to build with ant
* bcel-CVE-2022-42920.patch
+ integrated upstrea
-------------------------------------------------------------------
Thu Nov 10 11:02:08 UTC 2022 - Pedro Monreal <pmonreal@suse.com>

View File

@ -1,40 +0,0 @@
pub 1024D/7C200941 2004-04-24
uid Torsten Curdt <tcurdt@apache.org>
uid [ revoked] Torsten Curdt <tcurdt@web.de>
uid Torsten Curdt <tcurdt@vafer.org>
uid [ revoked] Torsten Curdt <tcurdt@managesoft.com>
sub 1024g/87C5307C 2004-04-24
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.19 (GNU/Linux)
mQGiBECJuNYRBADaat2HMyxurx2WP1A30fBMrQSR+oUkmgb3bxcNthX5Ak/l88Ue
r5t/fXzBCMT8FOakMYotcDF05SYW6eB4fUk6IgGRr0qNdoPOnggYpJlFt0jogS9I
ZSuWi1wg0Ky8wXxSwXbza88k2zymeaJDAw6MkGZU6OJIfLqqMZxAINqJowCgmlg8
MlrLmLoZe8mM3VWYNjOvne8D/iovOI/CNNoIcUBBK5zjnKjUow0J53r47CzlCq7Y
UWwgbkia547s5C1OD77vuhcL2yhSe+boamslGuUiFEjZlazsrdnFmveNt15QHS6F
enDnoAYvBEybiwgISfWslaMIXB8VzKjd2CxzOjqW+U4Zb8Eju7zHaS0T/W158dEg
xrsTA/9uI2BJsESYeDiTyEdKrkVbbp4r6INBaT2oUjV3O1l1KBwa1G24RaBV/TgW
7cUzTSNtwcPiOcqMK23JwjRIA4LNGTtXY2hALmVADFlxHVUasKBgUQyepnl1z0ow
uGOxV9CENgtv8nE8ToXnfUcNfrclFO+ryGwYPhC9yp9CgRxvQLQdVG9yc3RlbiBD
dXJkdCA8dGN1cmR0QHdlYi5kZT6IZQQwEQIAJQUCRIBI8x4dIG5vIGxvbmdlciB1
c2luZyB0aGlzIGFkZHJlc3MACgkQBGM6V3wgCUGbXQCaAoHIhXbIn/Ra0SmZUHr5
JG50El4AnR8lppNTVKEG40KfdNgo/Nl4uJ2EtCBUb3JzdGVuIEN1cmR0IDx0Y3Vy
ZHRAdmFmZXIub3JnPohmBBMRAgAeAhsDBgsJCAcDAgMVAgMDFgIBAh4BAheABQJB
Vcx+ABIJEARjOld8IAlBB2VHUEcAAQH1xACeJueowZiDbDHEG3TRIZeLpS73sswA
n0UnmGsNVLEYJ5FpMZZnsw4KtQr7tCFUb3JzdGVuIEN1cmR0IDx0Y3VyZHRAYXBh
Y2hlLm9yZz6IZgQTEQIAHgYLCQgHAwIDFQIDAxYCAQIeAQIXgAUCQVXMowIZAQAS
CRAEYzpXfCAJQQdlR1BHAAEB8bgAmwUYhsKJUJrhk1HqK5DAyO7/fXrRAJwK3lFg
gk80PzHFjxJIklZ54zvcULQlVG9yc3RlbiBDdXJkdCA8dGN1cmR0QG1hbmFnZXNv
ZnQuY29tPohJBDARAgAJBQJFeJgIAh0gAAoJEARjOld8IAlBO+sAoI4W2UE506cy
Z7HROWvfOajpWKURAJwL3+dX2GGiIPBPGU/hPlNlcMexKrkBDQRAibjYEAQAty+5
SuEpdl51FhbDt3BPGTUO8lNLY55IXY/D6XeCxczVplKCRCXZqYEUeRbe02yjliDa
2VHJnirEdW2H24+g5SmIcUzhAHAEXm/zwfjE6wHQlv57Po+n2fV+BeoTszbZverK
jJxLfmq3Wf4vvRh4MCSfViefRw4YthOXAF/4xacAAwUD/jZZN52zLBp9liZfHpJ9
AEQBMZWhxwrdY6ixugkUZTC0yp/2EB4sUxUYVMjnZXWaBcGWtEHmyWqXL7oEOyL1
z7yaTYrt9F7CtYWRwyp5L5xHObxxES93o7uhXxm/bXFujP1SCE6XET4QU4N7zHEs
NpO0JUYx+msDVHqJmBnxZcGuiE4EGBECAAYFAkCJuNgAEgkQBGM6V3wgCUEHZUdQ
RwABAYEHAJwP4Up+XMkConqbrWLNDfQ2Gf8PuACeO2umjbwjOn2S67ze9UXBAEmi
D4Q=
=+1C3
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -1,7 +1,7 @@
#
# spec file for package bcel
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,25 +17,20 @@
Name: bcel
Version: 5.2
Version: 6.7.0
Release: 0
Summary: Byte Code Engineering Library
License: Apache-2.0
Group: Development/Libraries/Java
URL: http://commons.apache.org/proper/commons-bcel/
Source0: http://archive.apache.org/dist/commons/bcel/source/%{name}-%{version}-src.tar.gz
Source1: http://archive.apache.org/dist/commons/bcel/source/%{name}-%{version}-src.tar.gz.asc
Source2: http://repo.maven.apache.org/maven2/org/apache/%{name}/%{name}/%{version}/%{name}-%{version}.pom
Source3: bcel.keyring
Patch0: bcel-5.2-encoding.patch
#PATCH-FIX-UPSTREAM bsc#1205125 CVE-2022-42920 Out-of-bounds writing issue
Patch1: bcel-CVE-2022-42920.patch
URL: https://commons.apache.org/proper/commons-bcel/
Source0: https://archive.apache.org/dist/commons/bcel/source/%{name}-%{version}-src.tar.gz
Source1: %{name}-build.xml
BuildRequires: ant
BuildRequires: apache-commons-lang3
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
BuildRequires: regexp
BuildRequires: javapackages-local >= 6
#!BuildIgnore: xalan-j2 xerces-j2 xml-apis xml-resolver
Requires: regexp
BuildArch: noarch
%description
@ -60,36 +55,39 @@ It contains a byte code verifier named JustIce, which usually gives you
much better information about what is wrong with your code than the
standard JVM message.
%prep
%autosetup -p1
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation/HTML
# remove all binary libs
find . -name "*.jar" -exec rm -f {} \;
# very broken build
perl -p -i -e 's| depends=\"examples\"||g;' build.xml
touch manifest.txt
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n %{name}-%{version}-src
cp %{SOURCE1} build.xml
%build
export CLASSPATH=%(build-classpath regexp)
export OPT_JAR_LIST="ant/ant-nodeps"
ant \
-Dant.build.javac.target=8 -Dant.build.javac.source=8 \
-Dbuild.dest=./build -Dbuild.dir=./build -Dname=%{name} \
compile jar
mkdir -p lib
build-jar-repository -s lib apache-commons-lang3
%ant jar javadoc
%install
# jars
# jar
mkdir -p %{buildroot}%{_javadir}
install -m 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -s ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
install -m 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
# pom
mkdir -p %{buildroot}%{_mavenpomdir}
install -m 644 %{SOURCE2} %{buildroot}%{_mavenpomdir}/%{name}-%{version}.pom
%add_maven_depmap %{name}-%{version}.pom %{name}-%{version}.jar -a "bcel:bcel"
%mvn_install_pom pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
%add_maven_depmap %{name}.pom %{name}.jar -a "bcel:bcel"
# javadoc
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -a target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
%files -f .mfiles
%license LICENSE.txt
%{_javadir}/*
%files javadoc
%{_javadocdir}/%{name}
%changelog