diff --git a/0001-Port-build-script-to-Maven-3.patch b/0001-Port-build-script-to-Maven-3.patch new file mode 100644 index 0000000..f7c34c2 --- /dev/null +++ b/0001-Port-build-script-to-Maven-3.patch @@ -0,0 +1,89 @@ +From 40d80d630a54f263722d1f9ffd199530ce600159 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Tue, 14 Jun 2016 13:44:17 +0200 +Subject: [PATCH 1/3] Port build script to Maven 3 + +--- + project.xml | 49 +++++++++++++++++++++++++++++++------------------ + 1 file changed, 31 insertions(+), 18 deletions(-) + +diff --git a/project.xml b/project.xml +index 155b2b7..b32e4d1 100644 +--- a/project.xml ++++ b/project.xml +@@ -16,41 +16,54 @@ + limitations under the License. + --> + +- ${basedir}/../project-common.xml ++ 4.0.0 + + Avalon Logkit +- avalon-logkit ++ avalon-logkit ++ avalon-logkit ++ 2.1 + + 1997 +- Excalibur's Logkit package + + Log4j-like logging toolkit. + + + + +- log4j ++ log4j ++ log4j + 1.2.11 ++ true + + +- servletapi +- 2.3 ++ javax.servlet ++ servlet-api ++ 2.5 ++ true + + +- geronimo-spec +- geronimo-spec-javamail +- 1.3.1-rc3 +- +- true +- ++ javax.mail ++ mail ++ 1.4.3 ++ provided + + +- geronimo-spec +- geronimo-spec-jms +- 1.1-rc4 +- +- true +- ++ org.apache.geronimo.specs ++ geronimo-jms_1.1_spec ++ 1.1.1 ++ provided ++ ++ ++ ++ junit ++ junit ++ 4.12 ++ test + + ++ ++ ++ src/java ++ src/test ++ + +-- +2.5.5 + diff --git a/0002-Port-to-Java-7.patch b/0002-Port-to-Java-7.patch new file mode 100644 index 0000000..7f0bca9 --- /dev/null +++ b/0002-Port-to-Java-7.patch @@ -0,0 +1,29 @@ +From 02cbfaf4835946ce72b454da3696240313772a07 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Tue, 14 Jun 2016 13:49:00 +0200 +Subject: [PATCH 2/3] Port to Java 7 + +--- + src/java/org/apache/log/output/db/DefaultDataSource.java | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/java/org/apache/log/output/db/DefaultDataSource.java b/src/java/org/apache/log/output/db/DefaultDataSource.java +index c19b507..864c48a 100644 +--- a/src/java/org/apache/log/output/db/DefaultDataSource.java ++++ b/src/java/org/apache/log/output/db/DefaultDataSource.java +@@ -111,4 +111,12 @@ public class DefaultDataSource + { + m_logWriter = logWriter; + } ++ ++ public boolean isWrapperFor(Class iface) { ++ return false; ++ } ++ ++ public T unwrap(java.lang.Class iface) {return null;} ++ ++ public java.util.logging.Logger getParentLogger() {return null;} + } +-- +2.5.5 + diff --git a/0003-Fix-encoding.patch b/0003-Fix-encoding.patch new file mode 100644 index 0000000..52c11c5 --- /dev/null +++ b/0003-Fix-encoding.patch @@ -0,0 +1,41 @@ +From 8fd096a56d52beb49e37db17254b57bb3aef860f Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Tue, 14 Jun 2016 13:53:27 +0200 +Subject: [PATCH 3/3] Fix encoding + +--- + src/java/org/apache/log/ContextMap.java | 4 ++-- + src/java/org/apache/log/Logger.java | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/java/org/apache/log/ContextMap.java b/src/java/org/apache/log/ContextMap.java +index 046106b..2305955 100644 +--- a/src/java/org/apache/log/ContextMap.java ++++ b/src/java/org/apache/log/ContextMap.java +@@ -29,8 +29,8 @@ import java.util.Hashtable; + *
  • hostname ->helm.realityforge.org
  • + *
  • ipaddress ->1.2.3.4
  • + *
  • interface ->127.0.0.1
  • +- *
  • caller � �->com.biz.MyCaller.method(MyCaller.java:18)
  • +- *
  • source � �->1.6.3.2:33
  • ++ *
  • caller ->com.biz.MyCaller.method(MyCaller.java:18)
  • ++ *
  • source ->1.6.3.2:33
  • + * + * The context is bound to a thread (and inherited by sub-threads) but + * it can also be added to by LogTargets. +diff --git a/src/java/org/apache/log/Logger.java b/src/java/org/apache/log/Logger.java +index 43ce1b7..d1f7efd 100644 +--- a/src/java/org/apache/log/Logger.java ++++ b/src/java/org/apache/log/Logger.java +@@ -295,7 +295,7 @@ public class Logger + } + + /** +- * Determine if messages of priority �will be logged. ++ * Determine if messages of priority will be logged. + * @param priority the priority + * @return true if messages will be logged + */ +-- +2.5.5 + diff --git a/avalon-logkit-2.1.pom b/avalon-logkit-2.1.pom deleted file mode 100644 index 09cefd6..0000000 --- a/avalon-logkit-2.1.pom +++ /dev/null @@ -1,31 +0,0 @@ - - 4.0.0 - avalon-logkit - avalon-logkit - Avalon Logkit - 2.1 - Log4j-like logging toolkit. - 1997 - - - log4j - log4j - 1.2.11 - - - servletapi - servletapi - 2.3 - - - geronimo-spec - geronimo-spec-javamail - 1.3.1-rc3 - - - geronimo-spec - geronimo-spec-jms - 1.1-rc4 - - - \ No newline at end of file diff --git a/avalon-logkit-encoding.patch b/avalon-logkit-encoding.patch deleted file mode 100644 index 5e129f7..0000000 --- a/avalon-logkit-encoding.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/src/java/org/apache/log/ContextMap.java b/src/java/org/apache/log/ContextMap.java -index 046106b..2305955 100644 ---- a/src/java/org/apache/log/ContextMap.java -+++ b/src/java/org/apache/log/ContextMap.java -@@ -29,8 +29,8 @@ import java.util.Hashtable; - *
  • hostname ->helm.realityforge.org
  • - *
  • ipaddress ->1.2.3.4
  • - *
  • interface ->127.0.0.1
  • -- *
  • caller � �->com.biz.MyCaller.method(MyCaller.java:18)
  • -- *
  • source � �->1.6.3.2:33
  • -+ *
  • caller ->com.biz.MyCaller.method(MyCaller.java:18)
  • -+ *
  • source ->1.6.3.2:33
  • - * - * The context is bound to a thread (and inherited by sub-threads) but - * it can also be added to by LogTargets. -diff --git a/src/java/org/apache/log/Logger.java b/src/java/org/apache/log/Logger.java -index 43ce1b7..d1f7efd 100644 ---- a/src/java/org/apache/log/Logger.java -+++ b/src/java/org/apache/log/Logger.java -@@ -295,7 +295,7 @@ public class Logger - } - - /** -- * Determine if messages of priority �will be logged. -+ * Determine if messages of priority will be logged. - * @param priority the priority - * @return true if messages will be logged - */ diff --git a/avalon-logkit-pom-deps.patch b/avalon-logkit-pom-deps.patch deleted file mode 100644 index 1ad37de..0000000 --- a/avalon-logkit-pom-deps.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- pom.xml 2011-04-21 14:24:29.000000000 +0200 -+++ pom.xml.new 2011-05-05 14:37:27.016877493 +0200 -@@ -13,19 +13,19 @@ - 1.2.11 - - -- servletapi -- servletapi -- 2.3 -+ javax.servlet -+ servlet-api -+ 2.5 - - -- geronimo-spec -- geronimo-spec-javamail -- 1.3.1-rc3 -+ javax.mail -+ mail -+ 1.4.3 - - -- geronimo-spec -- geronimo-spec-jms -- 1.1-rc4 -+ javax.jms -+ jms -+ 1.1.1 - - -- -\ No newline at end of file -+ diff --git a/avalon-logkit.spec b/avalon-logkit.spec index 4fafc04..ef55b21 100644 --- a/avalon-logkit.spec +++ b/avalon-logkit.spec @@ -1,67 +1,25 @@ -# Copyright (c) 2000-2005, JPackage Project -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the -# distribution. -# 3. Neither the name of the JPackage Project nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -%global short_name logkit -%global camelcase_short_name LogKit - -Name: avalon-%{short_name} -Version: 2.1 -Release: 24%{?dist} -Epoch: 0 -Summary: Java logging toolkit -License: ASL 2.0 -Group: Development/Libraries -URL: http://avalon.apache.org/%{short_name}/ -Source0: http://archive.apache.org/dist/excalibur/%{name}/source/%{name}-%{version}-src.zip -Source1: http://repo1.maven.org/maven2/avalon-logkit/avalon-logkit/%{version}/%{name}-%{version}.pom -Patch0: fix-java6-compile.patch -Patch1: avalon-logkit-pom-deps.patch -Patch2: avalon-logkit-encoding.patch -Patch3: java7.patch -Requires: avalon-framework >= 0:4.1.4 -Requires: glassfish-servlet-api -Requires: geronimo-jms -Requires: javamail - -BuildRequires: javapackages-local -BuildRequires: ant -BuildRequires: javamail -BuildRequires: ant-junit -BuildRequires: log4j -BuildRequires: avalon-framework >= 0:4.1.4 -# Required for converting jars to OSGi bundles -BuildRequires: aqute-bnd -BuildRequires: glassfish-servlet-api -BuildRequires: geronimo-jms - -BuildArch: noarch +Name: avalon-logkit +Epoch: 0 +Version: 2.1 +Release: 25%{?dist} +Summary: Java logging toolkit +License: ASL 2.0 +URL: http://avalon.apache.org/ +BuildArch: noarch + +Source0: http://archive.apache.org/dist/excalibur/%{name}/source/%{name}-%{version}-src.zip + +Patch0001: 0001-Port-build-script-to-Maven-3.patch +Patch0002: 0002-Port-to-Java-7.patch +Patch0003: 0003-Fix-encoding.patch + +BuildRequires: maven-local +BuildRequires: mvn(javax.mail:mail) +BuildRequires: mvn(javax.servlet:servlet-api) +BuildRequires: mvn(junit:junit) +BuildRequires: mvn(log4j:log4j) +BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) +BuildRequires: mvn(org.apache.geronimo.specs:geronimo-jms_1.1_spec) %description @@ -71,54 +29,58 @@ that you read the whitepaper and browse the API docs. %package javadoc Summary: Javadoc for %{name} -Group: Documentation -Requires: jpackage-utils %description javadoc Javadoc for %{name}. %prep %setup -q -%patch0 - -cp %{SOURCE1} pom.xml -%patch1 +%patch1 -p1 %patch2 -p1 -%patch3 -# remove all binary libs -find . -name "*.jar" -exec rm -f {} \; +%patch3 -p1 +mv project.xml pom.xml # LogFactor5 is no longer distributed with log4j +%pom_remove_dep log4j:log4j rm -rf src/java/org/apache/log/output/lf5 +%mvn_file : %{name} + +# Add proper Apache Felix Bundle Plugin instructions +# so that we get a reasonable OSGi manifest. +%pom_xpath_inject pom:project "bundle" +%pom_xpath_inject pom:build " + + + org.apache.felix + maven-bundle-plugin + true + + + avalon-logkit-2.1 + <_nouses>true + + + + " + %build -export CLASSPATH=$(build-classpath log4j javamail/mailapi jms glassfish-servlet-api jdbc-stdext avalon-framework junit):$PWD/build/classes -ant -Dencoding=ISO-8859-1 -Dnoget=true clean jar javadoc -# Convert to OSGi bundle -bnd wrap target/%{name}-%{version}.jar +%mvn_build %install -# jars -install -d -m 755 $RPM_BUILD_ROOT%{_javadir} -install -d -m 755 $RPM_BUILD_ROOT/%{_mavenpomdir} - -install -m 644 %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar - -install -pm 644 pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP-%{name}.pom -%add_maven_depmap JPP-%{name}.pom %{name}.jar -a "%{short_name}:%{short_name},org.apache.avalon.logkit:%{name}" - -# javadoc -install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name} -cp -pr dist/docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} +%mvn_install %files -f .mfiles -%doc LICENSE.txt NOTICE.txt +%license LICENSE.txt NOTICE.txt -%files javadoc -%doc LICENSE.txt NOTICE.txt -%{_javadocdir}/%{name} +%files javadoc -f .mfiles-javadoc +%license LICENSE.txt NOTICE.txt %changelog +* Tue Jun 14 2016 Mikolaj Izdebski - 0:2.1-25 +- Cleanup package +- Build with Maven + * Wed Feb 03 2016 Fedora Release Engineering - 0:2.1-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/fix-java6-compile.patch b/fix-java6-compile.patch deleted file mode 100644 index 87bd582..0000000 --- a/fix-java6-compile.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- src/java/org/apache/log/output/db/DefaultDataSource.java.sav 2005-08-29 21:03:50.000000000 +0300 -+++ src/java/org/apache/log/output/db/DefaultDataSource.java 2010-11-09 21:05:58.775055594 +0200 -@@ -111,4 +111,10 @@ public class DefaultDataSource - { - m_logWriter = logWriter; - } -+ -+ public boolean isWrapperFor(Class iface) { -+ return false; -+ } -+ -+ public T unwrap(java.lang.Class iface) {return null;} - } diff --git a/java7.patch b/java7.patch deleted file mode 100644 index 0f28673..0000000 --- a/java7.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- src/java/org/apache/log/output/db/DefaultDataSource.java.sav 2012-04-18 00:41:59.000000000 +0300 -+++ src/java/org/apache/log/output/db/DefaultDataSource.java 2012-04-18 00:46:17.454272754 +0300 -@@ -117,4 +117,6 @@ public class DefaultDataSource - } - - public T unwrap(java.lang.Class iface) {return null;} -+ -+ public java.util.logging.Logger getParentLogger() {return null;} - }