File mx4j.spec of Package mx4j

#
# spec file for package mx4j (Version 3.0.1)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#



Name:           mx4j
BuildRequires:  ant ant-junit ant-nodeps ant-trax antlr axis bcel docbook-xsl-stylesheets docbook_3 jaf jakarta-commons-logging javamail jessie jpackage-utils junit libtool log4j-mini perl servletapi5 unzip update-alternatives xalan-j2 xerces-j2
BuildRequires:  java-1_5_0-gcj-compat-devel
%define name        mx4j
%define version     3.0.1
%define release     1jpp
%define section     free
# set this variable to "true" when updating a version 
# in general set to false, as it requires the xmlunit binary
%define compile_and_run_tests false
Version:        3.0.1
Release:        223
Summary:        Open Source Implementation of JMX Java API
License:        The Apache Software License
Group:          Development/Libraries/Java
Source0:        mx4j-%{version}-src.tar.bz2
Source1:        mx4j-build.policy
Source2:        CatalogManager.properties
Patch0:         mx4j-javaxssl.patch
Patch2:         mx4j-build.patch
Patch3:         mx4j-docbook.patch
Patch5:         mx4j-caucho-build.patch
Patch6:         %{name}-%{version}-use-external-rmic.patch
Patch7:         %{name}-%{version}-docbook-stylesheet-location.patch
Url:            http://mx4j.sourceforge.net/
#BuildRequires:  burlap
#BuildRequires:  hessian
BuildArch:      noarch
PreReq:         /usr/sbin/update-alternatives
Requires:       jaf
Requires:       javamail >= 1.2-5jpp
Requires:       log4j >= 1.2.7
Requires:       jakarta-commons-logging >= 1.0.1
Requires:       xml-commons-apis
Requires:       bcel >= 5.0
Requires:       jsse >= 1.0.2-6jpp
Requires:       jce >= 1.2.2
Requires:       axis >= 1.1
Requires:       xml-commons-resolver
Requires:       xml-commons
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Obsoletes:      openjmx
Provides:       jmxri
Provides:       jmx

%description
OpenJMX is an open source implementation of the Java(TM) Management
Extensions (JMX).



%package javadoc
License:        The Apache Software License
Group:          Development/Libraries/Java
Summary:        Javadoc for mx4j
Obsoletes:      openjmx-javadoc

%description javadoc
OpenJMX is an open source implementation of the Java(TM) Management
Extensions (JMX).

This package contains the javadoc documentation for OpenJMX.



%package manual
License:        The Apache Software License
Group:          Development/Libraries/Java
Summary:        Manual for mx4j

%description    manual
OpenJMX is an open source implementation of the Java(TM) Management
Extensions (JMX).

This package contains the manual for OpenJMX.



%prep
%setup -q
%patch0 -p1
%patch2 -p1
%patch3 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
cp %{SOURCE1} build
#cp %{SOURCE2} build
cp %{_sourcedir}/CatalogManager.properties %{_builddir}/%{name}-%{version}/build/
pushd lib
   ln -sf $(build-classpath junit) .
if [ "%compile_and_run_tests" = "true" ]
then
   ln -sf $(build-classpath xmlunit) .
fi
   ln -sf $(build-classpath xml-commons-apis) xml-apis.jar                || :
   ln -sf $(build-classpath xerces-j2) xercesImpl.jar                     || :
   ln -sf $(build-classpath xalan-j2) xalan.jar                           || :
   ln -sf $(build-classpath xalan-j2-serializer)                          || :
   ln -sf $(build-classpath commons-logging)                              || :
   ln -sf $(build-classpath log4j)                                        || :
   ln -sf $(build-classpath bcel)                                         || :
#   ln -sf $(build-classpath burlap)                                      || :
#   ln -sf $(build-classpath hessian)                                     || :
   ln -sf $(build-classpath axis/axis)                                    || :
   ln -sf $(build-classpath axis/jaxrpc)                                  || :
   ln -sf $(build-classpath axis/saaj)                                    || :
   ln -sf $(build-classpath wsdl4j)                                       || :
   ln -sf $(build-classpath commons-discovery)                            || :
   #ln -sf $(build-classpath jetty4) org.mortbay.jetty.jar                || :
   ln -sf $(build-classpath servletapi5) servlet.jar                      || :
   ln -sf $(build-classpath jython)                                       || :
   ln -sf $(build-classpath jsse)                                         || :
   ln -sf $(build-classpath jsse/jcert)                                   || :
   ln -sf $(build-classpath jsse/jnet)                                    || :
   ln -sf $(build-classpath jaas)                                         || :
   #ln -sf $(build-classpath jmxremoteri) jmxremote.jar                   || :
   #ln -sf $(build-classpath jmxremoteri-optional) jmxremote_optional.jar || :
   #ln -sf $(build-classpath jmxri)                                       || :
popd

%build
export GC_MAXIMUM_HEAP_SIZE="134217728" #128M
ln -sf $(build-classpath gnumail) lib/mail.jar
ln -sf $(build-classpath activation) lib/
export ANT_OPTS="-Djava.security.manager -Djava.security.policy=$(pwd)/build/mx4j-build.policy"
export OPT_JAR_LIST="ant/ant-junit junit ant/ant-trax jaxp_transform_impl"
export CLASSPATH=$(build-classpath glibj-tools activation javamail/mailapi javamail/smtp \
   jetty4 jython jakarta-commons-logging xml-commons-apis bcel jsse jaas jce \
   log4j jaxp_transform_impl axis/axis axis/jaxrpc axis/saaj \
   xml-commons-resolver xdoclet/xdoclet xdoclet/xdoclet-jmx-module \
   xdoclet/xdoclet-mx4j-module xalan-j2-serializer)
export CLASSPATH=${CLASSPATH}:%{_builddir}/%{name}-%{version}/classes/core:%{_builddir}/%{name}-%{version}/build
cd build
if [ "%compile_and_run_tests" = "true" ]
then
  ant release -Dbuild.sysclasspath=first tests-report javadocs docs
else
  ant  compile.jmx compile.rjmx compile.tools compile.examples javadocs 
fi

%install
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
install -m 644 dist/lib/%{name}-impl.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-impl-%{version}.jar
install -m 644 dist/lib/%{name}-jmx.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-jmx-%{version}.jar
install -m 644 dist/lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-%{version}.jar
install -m 644 dist/lib/%{name}-tools.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-tools-%{version}.jar
install -m 644 dist/lib/%{name}-rjmx.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-rjmx-%{version}.jar
install -m 644 dist/lib/%{name}-rimpl.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-rimpl-%{version}.jar
install -m 644 dist/lib/%{name}-remote.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-remote-%{version}.jar
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}/boa
install -m 644 dist/lib/boa/%{name}-rjmx-boa.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/boa/%{name}-rjmx-boa-%{version}.jar
install -m 644 dist/lib/boa/%{name}-rimpl-boa.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/boa/%{name}-rimpl-boa-%{version}.jar
install -m 644 dist/lib/boa/%{name}-remote-boa.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/boa/%{name}-remote-boa-%{version}.jar
pushd $RPM_BUILD_ROOT%{_javadir}/%{name}
   for jar in *-%{version}.jar ; do
      ln -fs ${jar} $(echo $jar | sed "s|-%{version}.jar|.jar|g")
   done
popd
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -r dist/docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}

%clean
rm -rf $RPM_BUILD_ROOT

%pre
rm -f %{_javadir}/%{name}.jar

%post
/usr/sbin/update-alternatives --install %{_javadir}/jmxri.jar jmxri %{_javadir}/%{name}/%{name}-jmx.jar 0

%postun
if [ "$1" = "0" ]; then
	/usr/sbin/update-alternatives --remove jmxri %{_javadir}/%{name}/%{name}-jmx.jar
fi

%files
%defattr(-,root,root)
%dir %{_javadir}/%{name}
%{_javadir}/%{name}/*.jar
%dir %{_javadir}/%{name}/boa
%{_javadir}/%{name}/boa/*.jar

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/%{name}-%{version}

%files manual
%defattr(0644,root,root,0755)
%doc dist/docs/*

%changelog
* Tue Jul 15 2008 coolo@suse.de
- next try to reduce build cycles
* Wed Apr 09 2008 mvyskocil@suse.cz
- fixed a build with gjc_1_5_0-compat
- removed some rpmlint warnings:
  - bzipped source code
  - add update-alternatives to PreReq
  - remove the unecessary docbook-style patch
- remove the xmlunit.tar
* Tue May 08 2007 dbornkessel@suse.de
- provide jmx
* Wed May 02 2007 dbornkessel@suse.de
- added unzip to BuildRequires
* Fri Jan 12 2007 dbornkessel@suse.de
- major update to version 3.0.1
  1.1.1 -> 3.0.1
  - JMXServerErrorException thrown during setAttribute invoc.
  - Class loading problem at RMIConnectorServer.start()
  - Basic authentication fails
  - Fetcher thread in RemoteNotificationClientHandler never ends
  - Null pointer exception accessing attribute in model bean
  - RelationService: possible method call param sequence error
  - JMXConnectorServer binding names rather than rebinding JNDI
  - MBeanServer.queryMBeans/Names not thread safe
  - GaugeMonitor setThresholds wrong error message
  - NotifBroadcasterSupport.sendNotif not thread safe
  - MBean registration notification emitted too soon
  - NullPointerException with MLets with no name attribute
  - NotificationListener when server shutdown
  - NotificationBroadcasterSupport error/failed remote listener
  - InvokerMBeanServerInterceptor uses Class.forName
  - bug in ssl http adapter example class
  - Timer MBean should not be daemon
  - MBeanServer.getAttributes() does not follow spec.
  - j.m.monitor.Monitor is not abstract
  - Error in loading the dll using Mlet classloader
  - Invalid value returned for SpecificationVersion
  - MBeanAttributeInfo.equals() ignores description
  - Invalid escape in ObjectName not caught
  - ModelMBeanInfoSupport copy constructor is not complete
  - DescriptorSupport doesn't provide a useful clone imp.
  - Caching Support In Required Model MBean Is Broken
  - JDK 1.3 + MX4J 2.0.1 examples/remote/simple
  - Wrong use of Properties in IIOPResolver class
  - NoSuchMethodError - class file inconsistency
  - Signature compliance for javax.management package
  - Client notification queue overflow
  - Busy Loop on SOAPConnectorServer fetching Notifications
  - XSL problem in serverbydomain.xsl
  - HttpAdapter example code should have public MBeanInterface
  - MLet files should be read with UTF-8 encoding
  - Permissions at start() vs permissions during invocation
  - JMXRI + MX4J documentation is wrong
  - Documentation is wrong
  - Do not write to System.out
  - ModelMBeanInfoSupport#getDescriptors("mbean") does not work
  - RMIConnectorServer problem
  - RequiredModelMBean methods are not invoked !!!
  - DescriptorSupport does not preserve case
  - HttpAdaptor doesn't stop cleanly
  - XSLTProcessor stylesheet error
  - Cannot use port 80 for SOAPConnector
  - Issue in ModelMBeanConstructorInfo descriptor checking
  - Invoke setManagedResource on RequiredModelMBean
  - MBeanDescription not working
  - TabularType hashCode value computed incorrectly
  - MBeanAttributeInfo validation of methods too restrictive
  - System.loadLibrary() is replacing dll with empty file
  - RelationService
  - Race condition in Tomcat 5
  - MBean interface required in same package as implementor
  - CounterMonitor behaves strangely on rollover
  - Add support to discover providers under META-INF/services
  - Add easier SSL protocol for JMXConnectorServers
  - NotificationListener wrapping
  - Default domain is "DefaultDomain"
  - Between operation only operates on numerics
  - Timer must increment seq number
  - An MBean can be in multiple relations
  - setRoles returns wrong value; NPE in getRoles
  - Should throw NoSuchMethodEx if Relation is not implemented
  - RelationSupport roleList can be null
  - findRelationsOfType must throw RelationTypeNotFoundException
  - removeRelationType should throw RelationTypeNotFoundExceptio
  - addRelationType should fail with invalid args
  - Duplicate RelationType should throw InvalidRelationType
  - MBS.isInstanceOf needs to check assignability
  - Exception in preDeregister should terminate immediately
  - Exception from preRegister prevents registration
  - addNotificationListener observed ObjectName cannot be null
  - Notification status should be cleared when monitor stops
  - CounterMonitor should not notify if already able threshold
  - CounterMonitor value can be negative
  - MBeanPermission 4-arg form, null is same as "-"
  - RequiredModelMBean must list default notifications
  - RequiredModelMBean should have one notification broadcaster
  - Incompatible JSR160 implementations between mx4j & sun
  - Several issues with DescriptorSupport
  - In MBeanPersmission, empty [] is allowed
  - Attempt to create an abstract MBean throws wrong exception
  - Incorrect handling of <arg type="object">
  - ModelMBean resource type is case insensitive
  - MBeanPermission implies is incorrect with wildcards
  - MBeanServerPermission must reject invalid names
  - ObjectName should reject unterminated strings
  - ReflectionExceptions are not wrapped
  - MBeanInfo missing classname is not compliant
  - Incorrect default objectname for MLet
  - java.util.ConcurrentModificationException
  - XSLTprocessor produce bad input names
  - Array of primitive types are not correctly displayed
  - Formatting error in "xsl/mbean_attributes.xsl"
  - error in "xsl/mbean_attributes.xsl"
  - Make MX4J JDK 1.5 friendly
  - Timing hole in Monitor stop() start() processing
  - ModelMBeanInfoSupport.getDescriptor(name, type) returns null
  - Could not re-add listener when MBean is unregistered
  - Memory leaks in notification interceptor
  - OutOfMemoryError in Java 1.5 on Refresh
  - RMIConnector cannot unmarshal custom Notifications
  - Monitor thread remains alive when monitors are stopped
  - JettyWebContainer shouldn't listen on localhost
  - please revert the -poa change
  - RMI-IIOP example broken
  - ConcurrentModificationException in DefaultMBeanRepository
  - IIOP / ORB.init
* Mon Sep 25 2006 dbornkessel@suse.de
- set source=\"1.4\" and target=\"1.4\" for ant \"javac\" tasks"
    - set source=\"1.4\" for ant \"javadoc\" tasks"
    - fix Java 1.5 code ambiguity (cf. bsc#4983021)"
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Dec 14 2005 dbornkessel@suse.de
- uncommented the dynamic security provider loading as those providers
  are configures statically for each JRE / SDK.
- replaced deprecated log4j statements with their newer equivalents
* Thu Sep 29 2005 dmueller@suse.de
- add norootforbuild
* Thu Sep 16 2004 skh@suse.de
- Fix prerequires
* Mon Sep 06 2004 skh@suse.de
- Initial package created with version 1.1.1 (JPackage 1.5)
openSUSE Build Service is sponsored by