diff --git a/README.md b/README.md index 333de8a..a4afdf4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # java-jfree-libformula LibFormula provides Excel-Style-Expressions. The implementation provided here is very generic and can be used in any application that needs to compute formulas. - The syntax is based on the OpenFormula-specifications, but with carefully pruning away all the spreadsheet specific parts (like references to cell-ranges). diff --git a/java-jfree-libformula-1.1.3-build_properties.patch b/java-jfree-libformula-1.1.3-build.patch similarity index 65% rename from java-jfree-libformula-1.1.3-build_properties.patch rename to java-jfree-libformula-1.1.3-build.patch index 73cc666..a6bb952 100644 --- a/java-jfree-libformula-1.1.3-build_properties.patch +++ b/java-jfree-libformula-1.1.3-build.patch @@ -1,5 +1,5 @@ ---- build.properties 2009-11-17 14:01:00.000000000 +0100 -+++ build.properties-gil 2011-01-22 15:54:30.000000000 +0100 +--- libformula-1.1.3/build.properties 2009-11-17 16:11:48.000000000 +0000 ++++ libformula-1.1.3/build.properties 2009-11-17 16:12:05.000000000 +0000 @@ -1,8 +1,10 @@ -project.revision=TRUNK-SNAPSHOT +project.revision=1.1.3 @@ -10,8 +10,7 @@ src.dir=${basedir}/source dependency.libbase.revision=1.1.3 -testsrc.dir=${basedir}/test -\ Manca newline alla fine del file +\ No newline at end of file +testsrc.dir=${basedir}/test +antcontrib.available=true +build.cache.dir=lib -\ Manca newline alla fine del file diff --git a/java-jfree-libformula-1.1.3-java11.patch b/java-jfree-libformula-1.1.3-java11.patch new file mode 100644 index 0000000..a978c2d --- /dev/null +++ b/java-jfree-libformula-1.1.3-java11.patch @@ -0,0 +1,13 @@ +--- libformula-1.1.3/common_build.xml 2020-05-05 19:51:29.901832133 +0100 ++++ libformula-1.1.3/common_build.xml 2020-05-05 19:51:35.875883155 +0100 +@@ -136,8 +136,8 @@ + +- +- ++ ++ + + + +- + +@@ -326,68 +323,6 @@ + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + ++ depends="svnant.download-check"> + + + +@@ -492,57 +427,12 @@ + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + ++ depends="ivy.download-check"> + + + +@@ -602,7 +492,7 @@ + Verifies that there are no SNAPSHOT dependencies defined in the ivy xml. + If there are SNAPSHOTS, fail the release build. + ====================================================================--> +- ++ + + + +@@ -769,7 +659,7 @@ + Publishes the jar file for this project to a Maven2 repository. + ====================================================================--> + ++ depends="create-pom,ivy.deliver"> + + + +@@ -1082,26 +972,10 @@ + duplicate copying of resources from src tree (handled by compile.src_copy + if jar.include.source is set. + ====================================================================--> +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ++ ++ ++ ++ + + + +@@ -1151,7 +1025,7 @@ + + Creates a jar file from the bin directory + ====================================================================--> +- ++ + + + +@@ -1164,7 +1038,7 @@ + Creates a new manifest file if one is not specified, or updates + an existing manifest file if one is specified. + ====================================================================--> +- ++ + + + +@@ -1648,4 +1522,4 @@ + + + +- +\ No newline at end of file ++ diff --git a/java-jfree-libformula-1.1.3-remove-commons-logging.patch b/java-jfree-libformula-1.1.3-remove-commons-logging.patch new file mode 100644 index 0000000..687b041 --- /dev/null +++ b/java-jfree-libformula-1.1.3-remove-commons-logging.patch @@ -0,0 +1,236 @@ +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/Formula.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/Formula.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/Formula.java 2021-02-23 14:41:06.962127389 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/Formula.java 2021-02-23 14:48:18.016328356 +0000 +@@ -19,8 +19,7 @@ + + import java.io.Serializable; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.formula.lvalues.LValue; + import org.pentaho.reporting.libraries.formula.lvalues.TypeValuePair; + import org.pentaho.reporting.libraries.formula.parser.FormulaParseException; +@@ -40,7 +39,7 @@ + */ + public class Formula implements Serializable, Cloneable + { +- private static final Log logger = LogFactory.getLog(Formula.class); ++ private static final Logger logger = Logger.getLogger(Formula.class.getName()); + private LValue rootReference; + private static final long serialVersionUID = -1176925812499923546L; + +@@ -105,7 +104,7 @@ + final Type type = typeValuePair.getType(); + if (type.isFlagSet(Type.ERROR_TYPE)) + { +- logger.debug("Error: " + typeValuePair.getValue()); ++ logger.config("Error: " + typeValuePair.getValue()); + } + else if (type.isFlagSet(Type.ARRAY_TYPE)) + { +@@ -131,7 +130,7 @@ + } + catch (Exception e) + { +- logger.warn("Evaluation failed unexpectedly: ", e); ++ logger.warning("Evaluation failed unexpectedly: " + e); + return new TypeValuePair(ErrorType.TYPE, LibFormulaErrorValue.ERROR_UNEXPECTED_VALUE); + } + } +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java 2021-02-23 14:41:06.980127564 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/DefaultFunctionRegistry.java 2021-02-23 14:48:29.995445103 +0000 +@@ -25,9 +25,7 @@ + import org.pentaho.reporting.libraries.base.util.HashNMap; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; + import org.pentaho.reporting.libraries.base.config.Configuration; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; +- ++import java.util.logging.Logger; + + /** + * Creation-Date: 02.11.2006, 12:48:32 +@@ -36,7 +34,7 @@ + */ + public class DefaultFunctionRegistry implements FunctionRegistry + { +- private static final Log logger = LogFactory.getLog(DefaultFunctionRegistry.class); ++ private static final Logger logger = Logger.getLogger(DefaultFunctionRegistry.class.getName()); + + private static final String FUNCTIONS_PREFIX = "org.pentaho.reporting.libraries.formula.functions."; + private static final String[] EMPTY_ARRAY = new String[0]; +@@ -72,7 +70,7 @@ + final Function function = createFunction(aName); + if (function == null) + { +- logger.debug ("There is no such function: " + aName); ++ logger.config ("There is no such function: " + aName); + } + else + { +@@ -132,7 +130,7 @@ + (functionClass, DefaultFunctionRegistry.class, Function.class); + if (function == null) + { +- logger.debug ("There is no such function: " + name); ++ logger.config ("There is no such function: " + name); + } + else + { +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java 2021-02-23 14:41:06.983127594 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsErrFunction.java 2021-02-23 14:48:54.904687864 +0000 +@@ -27,8 +27,7 @@ + import org.pentaho.reporting.libraries.formula.typing.Type; + import org.pentaho.reporting.libraries.formula.typing.coretypes.ErrorType; + import org.pentaho.reporting.libraries.formula.typing.coretypes.LogicalType; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * This function returns true if the parameter is of error and not of error type NA. +@@ -37,7 +36,7 @@ + */ + public class IsErrFunction implements Function + { +- private static final Log logger = LogFactory.getLog(IsErrFunction.class); ++ private static final Logger logger = Logger.getLogger(IsErrFunction.class.getName()); + private static final TypeValuePair RETURN_TRUE = new TypeValuePair(LogicalType.TYPE, Boolean.TRUE); + private static final TypeValuePair RETURN_FALSE = new TypeValuePair(LogicalType.TYPE, Boolean.FALSE); + private static final long serialVersionUID = 6749192734608313367L; +@@ -61,7 +60,7 @@ + + if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue) + { +- logger.warn ("Passing errors around is deprecated. Throw exceptions instead."); ++ logger.warning("Passing errors around is deprecated. Throw exceptions instead."); + final ErrorValue na = (ErrorValue) value; + if (na.getErrorCode() == LibFormulaErrorValue.ERROR_NA) + { +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java 2021-02-23 14:41:06.984127603 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/function/information/IsNaFunction.java 2021-02-23 14:49:05.917795194 +0000 +@@ -27,8 +27,7 @@ + import org.pentaho.reporting.libraries.formula.typing.Type; + import org.pentaho.reporting.libraries.formula.typing.coretypes.ErrorType; + import org.pentaho.reporting.libraries.formula.typing.coretypes.LogicalType; +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + + /** + * This function returns true if the parameter is of error type NA. +@@ -39,7 +38,7 @@ + { + private static final TypeValuePair RETURN_FALSE = new TypeValuePair(LogicalType.TYPE, Boolean.FALSE); + private static final TypeValuePair RETURN_TRUE = new TypeValuePair(LogicalType.TYPE, Boolean.TRUE); +- private static final Log logger = LogFactory.getLog(IsNaFunction.class); ++ private static final Logger logger = Logger.getLogger(IsNaFunction.class.getName()); + private static final long serialVersionUID = 1205462839536368718L; + + public IsNaFunction() +@@ -61,7 +60,7 @@ + + if (ErrorType.TYPE.equals(type) && value instanceof ErrorValue) + { +- logger.warn ("Passing errors around is deprecated. Throw exceptions instead."); ++ logger.warning("Passing errors around is deprecated. Throw exceptions instead."); + final ErrorValue na = (ErrorValue) value; + if (na.getErrorCode() == LibFormulaErrorValue.ERROR_NA) + { +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java 2021-02-23 14:41:06.988127642 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/lvalues/FormulaFunction.java 2021-02-23 14:50:26.354579111 +0000 +@@ -17,8 +17,8 @@ + + package org.pentaho.reporting.libraries.formula.lvalues; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Level; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.formula.EvaluationException; + import org.pentaho.reporting.libraries.formula.FormulaContext; + import org.pentaho.reporting.libraries.formula.LibFormulaErrorValue; +@@ -44,7 +44,7 @@ + */ + public class FormulaFunction extends AbstractLValue + { +- private static final Log logger = LogFactory.getLog(FormulaFunction.class); ++ private static final Logger logger = Logger.getLogger(FormulaFunction.class.getName()); + + private static class FormulaParameterCallback implements ParameterCallback + { +@@ -74,9 +74,9 @@ + final TypeValuePair converted = typeRegistry.convertTo(paramType, result); + if (converted == null) + { +- if (logger.isDebugEnabled()) ++ if (logger.isLoggable(Level.CONFIG)) + { +- logger.debug("Failed to evaluate parameter " + pos + " on function " + function); ++ logger.config("Failed to evaluate parameter " + pos + " on function " + function); + } + throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_AUTO_ARGUMENT_VALUE); + } +@@ -228,7 +228,7 @@ + } + catch (Exception e) + { +- logger.error("Unexpected exception while evaluating", e); ++ logger.severe("Unexpected exception while evaluating: " + e); + throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_UNEXPECTED_VALUE); + } + } +diff -ru libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java +--- libformula-1.1.3.orig/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java 2021-02-23 14:41:06.961127380 +0000 ++++ libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/typing/DefaultTypeRegistry.java 2021-02-23 14:47:11.376678905 +0000 +@@ -35,8 +35,7 @@ + import java.util.Locale; + import java.util.Collection; + +-import org.apache.commons.logging.Log; +-import org.apache.commons.logging.LogFactory; ++import java.util.logging.Logger; + import org.pentaho.reporting.libraries.base.config.Configuration; + import org.pentaho.reporting.libraries.base.util.ObjectUtilities; + import org.pentaho.reporting.libraries.formula.EvaluationException; +@@ -66,7 +65,7 @@ + */ + public class DefaultTypeRegistry implements TypeRegistry + { +- private static final Log logger = LogFactory.getLog(DefaultTypeRegistry.class); ++ private static final Logger logger = Logger.getLogger(DefaultTypeRegistry.class.getName()); + + private static class ArrayConverterCallback implements ArrayCallback + { +@@ -599,7 +598,7 @@ + } + else + { +- logger.warn("Assertation failure: Type declared to be a sequence, but no sequence found inside."); ++ logger.warning("Assertation failure: Type declared to be a sequence, but no sequence found inside."); + throw TypeConversionException.getInstance(); + } + } +@@ -612,7 +611,7 @@ + } + else + { +- logger.warn("Assertation failure: Type declared to be array, but no array callback found inside."); ++ logger.warning("Assertation failure: Type declared to be array, but no array callback found inside."); + throw TypeConversionException.getInstance(); + } + } +@@ -651,7 +650,7 @@ + } + else + { +- logger.warn("Assertation failure: Type declared to be array, but no array callback found inside."); ++ logger.warning("Assertation failure: Type declared to be array, but no array callback found inside."); + throw TypeConversionException.getInstance(); + } + } diff --git a/java-jfree-libformula.spec b/java-jfree-libformula.spec index 2492369..199d226 100644 --- a/java-jfree-libformula.spec +++ b/java-jfree-libformula.spec @@ -1,58 +1,30 @@ -%define with_gcj 1 -%define with_test 0 - -%define javahome %{_jvmdir}/jdk - Name: java-jfree-libformula Version: 1.1.3 -Release: 1mamba +Release: 2mamba Summary: Formula Parser Group: Development/Libraries/Java Vendor: openmamba Distribution: openmamba Packager: Silvan Calarco -URL: http://reporting.pentaho.org/ -Source: http://sourceforge.net/projects/jfreereport/files/02.%20Libraries/1.1.3-stable/libformula-1.1.3.zip -Patch0: java-jfree-libformula-1.1.3-build_properties.patch +URL: https://community.hitachivantara.com/home +Source: https://sourceforge.net/projects/jfreereport/files/02.%20Libraries/%{version}-stable/libformula-%{version}.zip +Patch0: java-jfree-libformula-1.1.3-build.patch +Patch1: java-jfree-libformula-1.1.3-java11.patch +Patch2: java-jfree-libformula-1.1.3-remove-ant-contrib-support.patch +Patch3: java-jfree-libformula-1.1.3-remove-commons-logging.patch License: LGPL ## AUTOBUILDREQ-BEGIN -BuildRequires: glibc-devel -BuildRequires: java-gcj-compat -BuildRequires: libgcc -BuildRequires: libgcj4-devel -BuildRequires: libz-devel ## AUTOBUILDREQ-END -BuildRequires: ant-contribb3 +BuildRequires: javapackages BuildRequires: apache-ant -BuildRequires: jakarta-commons-logging -%if %with_test -BuildRequires: jakarta-poi -%endif BuildRequires: java-jfree-libbase -BuildRequires: java-junit3 -BuildRequires: jpackage-utils -Requires: jakarta-commons-logging Requires: java-jfree-libbase -Requires: jpackage-utils -BuildRoot: %{_tmppath}/%{name}-%{version}-root +Requires: javapackages %description LibFormula provides Excel-Style-Expressions. The implementation provided here is very generic and can be used in any application that needs to compute formulas. - The syntax is based on the OpenFormula-specifications, but with carefully pruning away all the spreadsheet specific parts (like references to cell-ranges). -%if %with_gcj -%package gcj -Group: System/Libraries/Java -Summary: GCJ support for %{name} -Requires: java-gcj-compat - -%description gcj -JFree Java General Serialization Framework Library. - -This package contains GCJ support for %{name}. -%endif - %package javadoc Group: Documentation Summary: Javadoc for %{name} @@ -63,44 +35,23 @@ JFree Base Services. This package contains documentation for %{name}. %prep +%setup -q -c +%patch0 -p1 -b .build +%patch1 -p1 -b .java11 +%patch2 -p1 -b .remove-ant-contrib-support +%patch3 -p1 -b .remove-commons-logging -%setup -q -c %{name}-%{version} -%patch0 -for j in $(find . -name "*.jar"); do - rm -rf $j -done - -for txt in ChangeLog.txt licence-LGPL.txt README.txt; do - %{__perl} -pi -e 's/\r$//g' $txt -done - -mkdir -p lib/ant-contrib -ln -sf $(build-classpath commons-logging-api) lib/commons-logging-api-1.0.4.jar -ln -sf $(build-classpath libbase) lib/libbase-%{version}.jar -ln -sf $(build-classpath junit-3.8.2) test-lib/junit-3.8.1.jar -%if %with_test -ln -sf $(build-classpath poi) test-lib/poi-3.0.1-jdk122-final-20071014.jar -%endif -ln -s %{_javadir}/ant/* lib/ant-contrib +find . -name "*.jar" -exec rm -f {} \; +mkdir -p lib +build-jar-repository -s -p lib libbase %build -export CLASSPATH="" -CLASSPATH=$CLASSPATH:$(build-classpath ant-contribb3 junit-3.8.2 libbase commons-logging commons-logging-api) -%if %with_test -CLASSPATH=$CLASSPATH:$(build-classpath poi) -%endif -ant \ - jar \ -%if %with_test - test \ -%endif - javadoc +ant jar javadoc %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" mkdir -p %{buildroot}%{_javadir} - install -pm 644 dist/libformula-%{version}.jar %{buildroot}%{_javadir}/libformula-%{version}.jar ( @@ -113,10 +64,6 @@ install -pm 644 dist/libformula-%{version}.jar %{buildroot}%{_javadir}/libformul mkdir -p %{buildroot}%{_javadocdir}/libformula cp -pr bin/javadoc/docs/api/* %{buildroot}%{_javadocdir}/libformula -%if %with_gcj -%{_bindir}/aot-compile-rpm -%endif - %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" @@ -124,30 +71,16 @@ cp -pr bin/javadoc/docs/api/* %{buildroot}%{_javadocdir}/libformula %defattr(-,root,root) %{_javadir}/libformula-%{version}.jar %{_javadir}/libformula.jar -%doc ChangeLog.txt licence-LGPL.txt README.txt - -%if %with_gcj -%post gcj -if [ -x %{_bindir}/rebuild-gcj-db ] ; then - %{_bindir}/rebuild-gcj-db -fi - -%postun gcj -if [ -x %{_bindir}/rebuild-gcj-db ] ; then - %{_bindir}/rebuild-gcj-db -fi - -%files gcj -%defattr(-,root,root) -%{_libdir}/gcj/java-jfree-libformula/libformula-%{version}.jar.db -%{_libdir}/gcj/java-jfree-libformula/libformula-%{version}.jar.so -%endif +%doc licence-LGPL.txt %files javadoc %defattr(-,root,root) %{_javadocdir}/libformula %changelog +* Fri Dec 10 2021 Silvan Calarco 1.1.3-2mamba +- rebuilt without gcj and with java11 + * Sat Jan 22 2011 gil 1.1.3-1mamba - update to 1.1.3