Complete rebase of log4j to version 1.2.16 with cleanups, change to

maven build system, dropping gcj and more
This commit is contained in:
Stanislav Ochotnicky 2010-05-18 13:53:07 +00:00
parent 1b76f7e670
commit fd387fc61e
19 changed files with 555 additions and 279 deletions

View File

@ -1 +1 @@
logging-log4j-1.2.14.tar.gz
apache-log4j-1.2.16.tar.gz

View File

@ -0,0 +1,56 @@
From bf8f55bbc9baddcb67d0b89edd859f93ce3c949f Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Mon, 17 May 2010 12:57:36 +0200
Subject: [PATCH 01/10] logfactor5 changed userdir
---
.../lf5/viewer/configure/ConfigurationManager.java | 2 +-
.../log4j/lf5/viewer/configure/MRUFileManager.java | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/log4j/lf5/viewer/configure/ConfigurationManager.java b/src/main/java/org/apache/log4j/lf5/viewer/configure/ConfigurationManager.java
index a94ffab..81191f2 100644
--- a/src/main/java/org/apache/log4j/lf5/viewer/configure/ConfigurationManager.java
+++ b/src/main/java/org/apache/log4j/lf5/viewer/configure/ConfigurationManager.java
@@ -344,7 +344,7 @@ public class ConfigurationManager extends Object {
String home = System.getProperty("user.home");
String sep = System.getProperty("file.separator");
- return home + sep + "lf5" + sep + CONFIG_FILE_NAME;
+ return home + sep + ".logfactor5" + sep + CONFIG_FILE_NAME;
}
//--------------------------------------------------------------------------
diff --git a/src/main/java/org/apache/log4j/lf5/viewer/configure/MRUFileManager.java b/src/main/java/org/apache/log4j/lf5/viewer/configure/MRUFileManager.java
index 6ff275d..ca40d5a 100644
--- a/src/main/java/org/apache/log4j/lf5/viewer/configure/MRUFileManager.java
+++ b/src/main/java/org/apache/log4j/lf5/viewer/configure/MRUFileManager.java
@@ -175,14 +175,14 @@ public class MRUFileManager {
/**
* Creates the directory where the MRU file list will be written.
- * The "lf5" directory is created in the Documents and Settings
+ * The ".logfactor5" directory is created in the Documents and Settings
* directory on Windows 2000 machines and where ever the user.home
* variable points on all other platforms.
*/
public static void createConfigurationDirectory() {
String home = System.getProperty("user.home");
String sep = System.getProperty("file.separator");
- File f = new File(home + sep + "lf5");
+ File f = new File(home + sep + ".logfactor5");
if (!f.exists()) {
try {
f.mkdir();
@@ -268,7 +268,7 @@ public class MRUFileManager {
String home = System.getProperty("user.home");
String sep = System.getProperty("file.separator");
- return home + sep + "lf5" + sep + CONFIG_FILE_NAME;
+ return home + sep + ".logfactor5" + sep + CONFIG_FILE_NAME;
}
/**
--
1.6.6.1

View File

@ -0,0 +1,41 @@
From 9f84b1a71df2f7ba035db8f5af109a1d4120fa58 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Mon, 17 May 2010 13:48:31 +0200
Subject: [PATCH 02/10] Remove version dependencies
this is to remove (unneeded) versioned dependencies until we upgrade maven
---
pom.xml | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index 977ca83..ae0d95e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -95,7 +95,6 @@ target platform and specify -Dntdll_target=msbuild on the mvn command line.
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.5</version>
<configuration>
<workingDirectory>tests</workingDirectory>
<reportFormat>plain</reportFormat>
@@ -149,7 +148,6 @@ target platform and specify -Dntdll_target=msbuild on the mvn command line.
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
- <version>2.1</version>
<configuration>
<source>1.3</source>
<target>1.1</target>
@@ -332,7 +330,6 @@ target platform and specify -Dntdll_target=msbuild on the mvn command line.
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.6.1</version>
<configuration>
<docfilessubdirs>true</docfilessubdirs>
<encoding>UTF-8</encoding>
--
1.6.6.1

View File

@ -0,0 +1,95 @@
From 1b2981ccd96ed575bab75a61bce5c01900916ee7 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Mon, 17 May 2010 13:49:49 +0200
Subject: [PATCH 03/10] Removed example in wrong place
this caused velocity to fail
---
.../log4j/xml/examples/doc-files/XMLSample.java | 75 --------------------
1 files changed, 0 insertions(+), 75 deletions(-)
delete mode 100644 src/main/javadoc/org/apache/log4j/xml/examples/doc-files/XMLSample.java
diff --git a/src/main/javadoc/org/apache/log4j/xml/examples/doc-files/XMLSample.java b/src/main/javadoc/org/apache/log4j/xml/examples/doc-files/XMLSample.java
deleted file mode 100644
index 8ea09f2..0000000
--- a/src/main/javadoc/org/apache/log4j/xml/examples/doc-files/XMLSample.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.log4j.xml.examples;
-
-import org.apache.log4j.xml.DOMConfigurator;
-import org.apache.log4j.Logger;
-
-/**
-
- This <a href="XMLSample.java">example code</a> shows how to
- read an XML based configuration file using a DOM parser.
-
- <p>Sample XML files <a href="sample1.xml">sample1.xml</a>
- and <a href="sample2.xml">sample2.xml</a> are provided.
-
-
- <p>Note that the log4j.dtd is not in the local directory.
- It is found by the class loader.
-
- @author Ceki G&uuml;lc&uuml;
-
-*/
-public class XMLSample {
-
- static Logger cat = Logger.getLogger(XMLSample.class);
-
- public
- static
- void main(String argv[]) {
-
- if(argv.length == 1)
- init(argv[0]);
- else
- Usage("Wrong number of arguments.");
- sample();
- }
-
- static
- void Usage(String msg) {
- System.err.println(msg);
- System.err.println( "Usage: java " + XMLSample.class.getName() +
- "configFile");
- System.exit(1);
- }
-
- static
- void init(String configFile) {
- DOMConfigurator.configure(configFile);
- }
-
- static
- void sample() {
- int i = -1;
- cat.debug("Message " + ++i);
- cat.warn ("Message " + ++i);
- cat.error("Message " + ++i);
- Exception e = new Exception("Just testing");
- cat.debug("Message " + ++i, e);
- }
-}
--
1.6.6.1

View File

@ -0,0 +1,36 @@
From a725a6c0a74429c490affd351189673646d7ffec Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Mon, 17 May 2010 13:53:18 +0200
Subject: [PATCH 04/10] Remove mvn-release-plugin
for now this is included in current mvn in Fedora. Remove once
release-plugin is separate
---
pom.xml | 11 -----------
1 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/pom.xml b/pom.xml
index ae0d95e..f98a700 100644
--- a/pom.xml
+++ b/pom.xml
@@ -351,17 +351,6 @@ target platform and specify -Dntdll_target=msbuild on the mvn command line.
</executions>
</plugin>
<plugin>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.0-beta-9</version>
- <!--
- Bug MRELEASE-273 has been throwing NPE during release:perform,
- typically after deploy so this places it last.
- -->
- <configuration>
- <goals>package site-deploy assembly:attached deploy</goals>
- </configuration>
- </plugin>
- <plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.1</version>
<executions>
--
1.6.6.1

View File

@ -0,0 +1,36 @@
From ef230e88b5381bb2cb2ef257846412b610b4e111 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Mon, 17 May 2010 13:55:19 +0200
Subject: [PATCH 05/10] Remove mvn-source-plugin
for now this is included in current mvn in Fedora. Remove once
source-plugin is separate
---
pom.xml | 11 -----------
1 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/pom.xml b/pom.xml
index f98a700..c273581 100644
--- a/pom.xml
+++ b/pom.xml
@@ -350,17 +350,6 @@ target platform and specify -Dntdll_target=msbuild on the mvn command line.
</execution>
</executions>
</plugin>
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.1</version>
- <executions>
- <execution>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
<!--
clirr:check will fail with NullPointerException
due to missing javax.jms.MessageListener,
--
1.6.6.1

View File

@ -0,0 +1,40 @@
From 324dcac505e1c2c3f313392769713cff2aec2d59 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Mon, 17 May 2010 13:59:46 +0200
Subject: [PATCH 06/10] Remove mvn-clirr-plugin
for now this is included in current mvn in Fedora. Remove once
clirr-plugin is separate
---
pom.xml | 15 ---------------
1 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/pom.xml b/pom.xml
index c273581..6e32bb7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -350,21 +350,6 @@ target platform and specify -Dntdll_target=msbuild on the mvn command line.
</execution>
</executions>
</plugin>
- <!--
- clirr:check will fail with NullPointerException
- due to missing javax.jms.MessageListener,
- however it will trigger download of supporting components
- which can allow "ant clirr" to succeed.
- Could possibly run on a JavaEE platform.
- -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>clirr-maven-plugin</artifactId>
- <version>2.2.2</version>
- <configuration>
- <comparisonVersion>1.2.15</comparisonVersion>
- </configuration>
- </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rat-maven-plugin</artifactId>
--
1.6.6.1

View File

@ -0,0 +1,35 @@
From 16fb799c20651dfbaf2bdbc7e6e55f598e44b27c Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Mon, 17 May 2010 14:03:31 +0200
Subject: [PATCH 07/10] Remove mvn-rat-plugin
for now this is included in current mvn in Fedora. Remove once
rat-plugin is separate
---
pom.xml | 10 ----------
1 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/pom.xml b/pom.xml
index 6e32bb7..cb76444 100644
--- a/pom.xml
+++ b/pom.xml
@@ -351,16 +351,6 @@ target platform and specify -Dntdll_target=msbuild on the mvn command line.
</executions>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>rat-maven-plugin</artifactId>
- <version>1.0-alpha-3</version>
- <configuration>
- <excludes>
- <exclude>tests/witness/**</exclude>
- </excludes>
- </configuration>
- </plugin>
- <plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.0.1</version>
--
1.6.6.1

View File

@ -0,0 +1,28 @@
From c42e2e3263ed639c0fd4cb545ad38f0f15bf05a8 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Mon, 17 May 2010 14:53:10 +0200
Subject: [PATCH 08/10] Remove ant-contrib from dependencies
---
pom.xml | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index cb76444..6d00cf6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -285,11 +285,6 @@ target platform and specify -Dntdll_target=msbuild on the mvn command line.
<version>1.6.5</version>
</dependency>
<dependency>
- <groupId>ant-contrib</groupId>
- <artifactId>ant-contrib</artifactId>
- <version>1.0b2</version>
- </dependency>
- <dependency>
<groupId>ant</groupId>
<artifactId>ant-junit</artifactId>
<version>1.6.5</version>
--
1.6.6.1

View File

@ -0,0 +1,39 @@
From 31d2056b3f625115ad0f26c7e11ab6273cd4c285 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Mon, 17 May 2010 15:34:19 +0200
Subject: [PATCH 09/10] Remove ant run of tests
---
pom.xml | 16 ----------------
1 files changed, 0 insertions(+), 16 deletions(-)
diff --git a/pom.xml b/pom.xml
index 6d00cf6..406fa43 100644
--- a/pom.xml
+++ b/pom.xml
@@ -220,22 +220,6 @@ target platform and specify -Dntdll_target=msbuild on the mvn command line.
<goal>run</goal>
</goals>
</execution>
- <execution>
- <phase>test</phase>
- <id>runAll</id>
- <configuration>
- <tasks>
- <ant dir="tests" target="runAll">
- <property name="m2_repo" location="${m2_repo}" />
- <property name="log4j.jar" location="target/classes" />
- <property name="project.lib.home" location="target" />
- </ant>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
<!-- release builds will put SVN tags into the SCM page, this changes it back to trunk -->
<execution>
<phase>site</phase>
--
1.6.6.1

View File

@ -0,0 +1,26 @@
From 4753784d3e8ed5ec9973f67e9017bcb7ef41b4b1 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Tue, 18 May 2010 15:07:00 +0200
Subject: [PATCH 10/10] Fix javadoc link
---
build.xml | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/build.xml b/build.xml
index 54bad8f..c775a68 100644
--- a/build.xml
+++ b/build.xml
@@ -517,8 +517,7 @@
--&gt;'
bottom="Copyright 2000-2007 Apache Software Foundation.">
- <link href="http://java.sun.com/j2se/1.3/docs/api/"/>
- <link href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/"/>
+ <link href="${jdk.javadoc}"/>
<classpath refid="compile.classpath"/>
</javadoc>
--
1.6.6.1

View File

@ -2,8 +2,7 @@
Name=Chainsaw
Comment=Log4j log viewer
Exec=chainsaw
Icon=chainsaw.png
Icon=chainsaw
Terminal=false
Type=Application
Encoding=UTF-8
Categories=GNOME;Application;Development;X-JPackage;
Categories=GNOME;Application;Development;X-JPackage;GTK;

View File

@ -1,12 +0,0 @@
--- build.xml.sav 2006-04-03 19:34:39.000000000 +0200
+++ build.xml 2006-04-03 19:35:22.000000000 +0200
@@ -434,8 +434,7 @@
header="&lt;b&gt;Log4j ${version}&lt;/b&gt;"
bottom="Copyright 2000-2005 Apache Software Foundation.">
- <link href="http://java.sun.com/j2se/1.3/docs/api/"/>
- <link href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/"/>
+ <link href="${jdk.javadoc}"/>
<classpath refid="compile.classpath"/>
</javadoc>

View File

@ -1,37 +0,0 @@
--- src/java/org/apache/log4j/jmx/Agent.java.sav 2006-09-14 09:04:18.000000000 +0200
+++ src/java/org/apache/log4j/jmx/Agent.java 2007-04-18 15:40:59.000000000 +0200
@@ -19,7 +19,7 @@
import javax.management.ObjectName;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import com.sun.jdmk.comm.HtmlAdaptorServer;
+import mx4j.tools.adaptor.http.HttpAdaptor;
import org.apache.log4j.Logger;
@@ -36,7 +36,7 @@
void start() {
MBeanServer server = MBeanServerFactory.createMBeanServer();
- HtmlAdaptorServer html = new HtmlAdaptorServer();
+ HttpAdaptor html = new HttpAdaptor(8082);
try {
log.info("Registering HtmlAdaptorServer instance.");
@@ -46,9 +46,14 @@
server.registerMBean(hdm, new ObjectName("log4j:hiearchy=default"));
} catch(Exception e) {
- log.error("Problem while regitering MBeans instances.", e);
+ log.error("Problem while registering MBeans instances.", e);
+ return;
+ }
+ try {
+ html.start();
+ } catch(java.io.IOException ioe) {
+ log.error("Problem while starting HtmlAdaptorServer (HttpAdaptor).", ioe);
return;
}
- html.start();
}
}

View File

@ -1,46 +0,0 @@
--- src/java/org/apache/log4j/lf5/viewer/configure/ConfigurationManager.java.sav 2006-04-03 19:30:42.000000000 +0200
+++ src/java/org/apache/log4j/lf5/viewer/configure/ConfigurationManager.java 2006-04-03 19:31:35.000000000 +0200
@@ -340,7 +340,7 @@
String home = System.getProperty("user.home");
String sep = System.getProperty("file.separator");
- return home + sep + "lf5" + sep + CONFIG_FILE_NAME;
+ return home + sep + ".logfactor5" + sep + CONFIG_FILE_NAME;
}
//--------------------------------------------------------------------------
--- src/java/org/apache/log4j/lf5/viewer/configure/MRUFileManager.java.sav 2006-04-03 19:32:18.000000000 +0200
+++ src/java/org/apache/log4j/lf5/viewer/configure/MRUFileManager.java 2006-04-03 19:32:40.000000000 +0200
@@ -166,14 +166,14 @@
/**
* Creates the directory where the MRU file list will be written.
- * The "lf5" directory is created in the Documents and Settings
+ * The ".logfactor5" directory is created in the Documents and Settings
* directory on Windows 2000 machines and where ever the user.home
* variable points on all other platforms.
*/
public static void createConfigurationDirectory() {
String home = System.getProperty("user.home");
String sep = System.getProperty("file.separator");
- File f = new File(home + sep + "lf5");
+ File f = new File(home + sep + ".logfactor5");
if (!f.exists()) {
try {
f.mkdir();
@@ -259,7 +259,7 @@
String home = System.getProperty("user.home");
String sep = System.getProperty("file.separator");
- return home + sep + "lf5" + sep + CONFIG_FILE_NAME;
+ return home + sep + ".logfactor5" + sep + CONFIG_FILE_NAME;
}
/**
@@ -281,4 +281,4 @@
//--------------------------------------------------------------------------
// Nested Top-Level Classes or Interfaces
//--------------------------------------------------------------------------
-}
\ No newline at end of file
+}

View File

@ -2,8 +2,7 @@
Name=LogFactor5
Comment=Graphical user interface for managing log4j log messages
Exec=logfactor5
Icon=logfactor5.png
Icon=logfactor5
Terminal=false
Type=Application
Encoding=UTF-8
Categories=GNOME;Application;Development;X-JPackage;
Categories=GNOME;Application;Development;X-JPackage;GTK;

View File

@ -1,11 +0,0 @@
--- build.xml.sav2 2007-04-18 15:15:09.000000000 +0200
+++ build.xml 2007-04-18 15:15:38.000000000 +0200
@@ -139,7 +139,7 @@
<and>
<available classname="javax.management.MBeanInfo"
classpath="${jmx.jar}"/>
- <available classname="com.sun.jdmk.comm.HtmlAdaptorServer">
+ <available classname="mx4j.tools.adaptor.AdaptorServerSocketFactory">
<classpath>
<pathelement location="${jmx.jar}"/>
<pathelement location="${jmx-extra.jar}"/>

View File

@ -1,48 +1,16 @@
# Copyright (c) 2000-2007, 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.
#
%define _with_gcj_support 1
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
%define bootstrap %{?_with_bootstrap:1}%{!?_with_bootstrap:%{?_without_bootstrap:0}%{!?_without_bootstrap:%{?_bootstrap:%{_bootstrap}}%{!?_bootstrap:0}}}
%define section free
%global bootstrap %{?_with_bootstrap:1}%{!?_with_bootstrap:%{?_without_bootstrap:0}%{!?_without_bootstrap:%{?_bootstrap:%{_bootstrap}}%{!?_bootstrap:0}}}
Name: log4j
Version: 1.2.14
Release: 6.3%{?dist}
Version: 1.2.16
Release: 1%{?dist}
Epoch: 0
Summary: Java logging package
BuildArch: noarch
License: ASL 2.0
URL: http://logging.apache.org/log4j
Source0: http://www.apache.org/dist/logging/log4j/1.2.14/logging-log4j-1.2.14.tar.gz
Group: Development/Libraries
URL: http://logging.apache.org/%{name}
Source0: http://www.apache.org/dist/logging/%{name}/%{version}/apache-%{name}-%{version}.tar.gz
# Converted from src/java/org/apache/log4j/lf5/viewer/images/lf5_small_icon.gif
Source1: %{name}-logfactor5.png
Source2: %{name}-logfactor5.sh
@ -52,126 +20,143 @@ Source4: %{name}-chainsaw.png
Source5: %{name}-chainsaw.sh
Source6: %{name}-chainsaw.desktop
Source7: %{name}.catalog
Patch0: %{name}-logfactor5-userdir.patch
Patch1: %{name}-javadoc-xlink.patch
Patch2: %{name}-mx4j-tools.patch
Patch3: %{name}-jmx-Agent.patch
BuildRequires: jpackage-utils >= 0:1.6
BuildRequires: ant
%if ! %{bootstrap}
#Use classpathx-jaf for now
#BuildRequires: geronimo-jaf-1.0.2-api
BuildRequires: classpathx-jaf
BuildRequires: classpathx-mail
# Use JMS for now
#BuildRequires: geronimo-jms-1.1-api
BuildRequires: jms
BuildRequires: mx4j
%endif
BuildRequires: jndi
BuildRequires: java-javadoc
Patch0: 0001-logfactor5-changed-userdir.patch
Patch1: 0002-Remove-version-dependencies.patch
Patch2: 0003-Removed-example-in-wrong-place.patch
Patch3: 0004-Remove-mvn-release-plugin.patch
Patch4: 0005-Remove-mvn-source-plugin.patch
Patch5: 0006-Remove-mvn-clirr-plugin.patch
Patch6: 0007-Remove-mvn-rat-plugin.patch
Patch7: 0008-Remove-ant-contrib-from-dependencies.patch
Patch8: 0009-Remove-ant-run-of-tests.patch
Patch9: 0010-Fix-javadoc-link.patch
BuildRequires: %{__perl}
BuildRequires: java >= 1:1.6.0
BuildRequires: jpackage-utils >= 0:1.6
BuildRequires: javamail
BuildRequires: geronimo-jms
BuildRequires: geronimo-parent-poms
BuildRequires: desktop-file-utils
BuildRequires: jpackage-utils >= 0:1.7.2
BuildRequires: maven-plugin-bundle
BuildRequires: maven-surefire-maven-plugin
BuildRequires: maven-surefire-provider-junit
BuildRequires: maven2-plugin-ant
BuildRequires: maven2-plugin-antrun
BuildRequires: maven2-plugin-assembly
BuildRequires: maven2-plugin-compiler
BuildRequires: maven2-plugin-idea
BuildRequires: maven2-plugin-install
BuildRequires: maven2-plugin-jar
BuildRequires: maven2-plugin-javadoc
BuildRequires: maven2-plugin-resources
BuildRequires: maven2-plugin-site
Requires: java >= 1:1.6.0
Requires: jpackage-utils >= 0:1.6
Requires(post): jpackage-utils
Requires(postun): jpackage-utils
Requires: xml-commons-apis
Requires: jaxp_parser_impl
Group: System/Logging
%if ! %{gcj_support}
BuildArch: noarch
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
Log4j is a tool to help the programmer output log statements to a
variety of output targets.
%package manual
Summary: Manual for %{name}
Group: System/Logging
Summary: Developer manual for %{name}
Group: Documentation
Requires: %{name}-javadoc = %{version}-%{release}
%description manual
Documentation for %{name}.
%{summary}.
%package javadoc
Summary: Javadoc for %{name}
Group: System/Logging
# for /bin/rm and /bin/ln
Requires(post): coreutils
Requires(postun): coreutils
Summary: API documentation for %{name}
Group: Documentation
%description javadoc
Javadoc for %{name}.
%{summary}.
%prep
%setup -q -n logging-%{name}-%{version}
%patch0 -b .sav
%patch1 -b .sav
%patch2 -b .sav2
%patch3 -b .sav
%{__perl} -pi -e 's/\r//g' LICENSE
%{__perl} -pi -e 's/\r//g' NOTICE
%setup -q -n apache-%{name}-%{version}
# see patch files themselves for reasons for applying
%patch0 -p1 -b .logfactor-home
%patch1 -p1 -b .remove-dep-version
%patch2 -p1 -b .remove-example
%patch3 -p1 -b .remove-mvn-release
%patch4 -p1 -b .remove-mvn-source
%patch5 -p1 -b .remove-mvn-clirr
%patch6 -p1 -b .remove-mvn-rat
%patch7 -p1 -b .remove-and-contrib
%patch8 -p1 -b .remove-tests
%patch9 -p1 -b .xlink-javadoc
sed -i 's/\r//g' LICENSE NOTICE site/css/*.css site/xref/*.css \
site/xref-test/*.css
# fix encoding of mailbox files
for i in contribs/JimMoore/mail*;do
iconv --from=ISO-8859-1 --to=UTF-8 "$i" > new
mv new "$i"
done
# remove all the stuff we'll build ourselves
find . \( -name "*.jar" -o -name "*.class" \) -exec %__rm -f {} \;
%__rm -rf docs/api
%build
# javac.source=1.1 doesn't work with Sun's 1.4.2_09/1.5.0_05
%ant \
-Djavamail.jar=$(build-classpath javamail/mailapi) \
-Dactivation.jar=$(build-classpath jaf) \
-Djaxp.jaxp.jar.jar=$(build-classpath jaxp_parser_impl) \
-Djms.jar=$(build-classpath jms) \
-Djmx.jar=$(build-classpath mx4j/mx4j) \
-Djmx-extra.jar=$(build-classpath mx4j/mx4j-tools) \
-Djndi.jar=$(build-classpath jndi) \
-Djavac.source=1.2 \
-Djdk.javadoc=%{_javadocdir}/java \
jar javadoc
%build
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL
# we don't need javadoc:javadoc because build system is broken and
# builds javadoc when install-ing
# also note that maven.test.skip doesn't really work and we had to
# patch ant run of tests out of pom
mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
-Dmaven.test.skip=true \
install
%install
%__rm -rf %{buildroot}
rm -rf %{buildroot}
# jars
%__mkdir_p %{buildroot}%{_javadir}
%__cp -a dist/lib/%{name}-%{version}.jar %{buildroot}%{_javadir}
#install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
install -pD -T -m 644 target/%{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
# javadoc
%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version}
%__cp -a docs/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
(cd %{buildroot}%{_javadocdir} && %__ln_s %{name}-%{version} %{name})
%__rm -rf docs/api
ln -s %{_javadocdir}/log4j docs/api
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# scripts
%__mkdir_p %{buildroot}%{_bindir}
%__install -p -m 755 %{SOURCE2} %{buildroot}%{_bindir}/logfactor5
%__install -p -m 755 %{SOURCE5} %{buildroot}%{_bindir}/chainsaw
install -pD -T -m 755 %{SOURCE2} %{buildroot}%{_bindir}/logfactor5
install -pD -T -m 755 %{SOURCE5} %{buildroot}%{_bindir}/chainsaw
# freedesktop.org menu entries and icons
%__mkdir_p %{buildroot}%{_datadir}/{applications,pixmaps}
%__cp -a %{SOURCE1} \
%{buildroot}%{_datadir}/pixmaps/logfactor5.png
%__cp -a %{SOURCE3} \
%{buildroot}%{_datadir}/applications/jpackage-logfactor5.desktop
%__cp -a %{SOURCE4} \
%{buildroot}%{_datadir}/pixmaps/chainsaw.png
%__cp -a %{SOURCE6} \
%{buildroot}%{_datadir}/applications/jpackage-chainsaw.desktop
install -pD -T -m 755 %{SOURCE1} \
%{buildroot}%{_datadir}/pixmaps/logfactor5.png
desktop-file-install \
--dir=${RPM_BUILD_ROOT}%{_datadir}/applications \
%{SOURCE3}
install -pD -T -m 755 %{SOURCE4} \
%{buildroot}%{_datadir}/pixmaps/chainsaw.png
desktop-file-install \
--dir=${RPM_BUILD_ROOT}%{_datadir}/applications \
%{SOURCE6}
# DTD and the SGML catalog (XML catalog handled in scriptlets)
%__mkdir_p %{buildroot}%{_datadir}/sgml/%{name}
%__cp -a src/java/org/apache/log4j/xml/log4j.dtd \
%{buildroot}%{_datadir}/sgml/%{name}
%__cp -a %{SOURCE7} \
install -pD -T -m 644 src/main/javadoc/org/apache/log4j/xml/doc-files/log4j.dtd \
%{buildroot}%{_datadir}/sgml/%{name}/log4j.dtd
install -pD -T -m 644 %{SOURCE7} \
%{buildroot}%{_datadir}/sgml/%{name}/catalog
# fix perl location
@ -179,9 +164,6 @@ ln -s %{_javadocdir}/log4j docs/api
contribs/KitchingSimon/udpserver.pl
%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif
%clean
%__rm -rf %{buildroot}
@ -200,12 +182,6 @@ if [ -x %{_bindir}/xmlcatalog -a -w %{_sysconfdir}/xml/catalog ]; then
> /dev/null || :
fi
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%preun
if [ $1 -eq 0 ]; then
@ -215,12 +191,6 @@ if [ $1 -eq 0 ]; then
fi
fi
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%postun
# Note that we're using versioned catalog, so this is always ok.
@ -230,49 +200,31 @@ if [ -x %{_bindir}/install-catalog -a -d %{_sysconfdir}/sgml ]; then
%{_datadir}/sgml/%{name}/catalog > /dev/null || :
fi
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%post javadoc
%__rm -f %{_javadocdir}/%{name}
%__ln_s %{name}-%{version} %{_javadocdir}/%{name}
%postun javadoc
if [ $1 -eq 0 ]; then
%__rm -f %{_javadocdir}/%{name}
fi
%files
%defattr(-,root,root,-)
%doc LICENSE
%doc NOTICE
%doc LICENSE NOTICE
%{_bindir}/*
%{_javadir}/*
%{_datadir}/applications/*
%{_datadir}/pixmaps/*
%{_datadir}/sgml/%{name}
%if %{gcj_support}
%attr(-,root,root) %{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif
%files manual
%defattr(0644,root,root,0755)
%doc docs/* contribs
%defattr(-,root,root,-)
%doc site/*.html site/css site/images/ site/xref site/xref-test contribs
%files javadoc
%defattr(0644,root,root,0755)
%dir %{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}-%{version}/*
%ghost %dir %{_javadocdir}/%{name}
%defattr(-,root,root,-)
%doc %{_javadocdir}/%{name}-%{version}
%doc %{_javadocdir}/%{name}
%changelog
* Mon May 17 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0:1.2.16-1
- Complete re-working of whole ebuild to work with maven
- Rebase to new version
- Drop gcj support
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.2.14-6.3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

View File

@ -1 +1 @@
7d8d02888b93e6f8d67b8e5f746196ae logging-log4j-1.2.14.tar.gz
8e331a930d0b56280a1c66a00621b3a3 apache-log4j-1.2.16.tar.gz