File axis.spec of Package axis

#
# spec file for package axis
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# icecream 0


Name:           axis
Version:        1.4
Release:        0
Summary:        Apache implementation of the SOAP
License:        Apache-2.0
Group:          Development/Libraries/Java
Url:            http://ws.apache.org/axis/
Source0:        axis-src-1_4.tar.bz2
# svn export http://svn.apache.org/repos/asf/webservices/axis/branches/AXIS_1_4_FINAL/
# Build only
# cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/tools export -r v1_1_0 org.eclipse.orbit/javax.xml.rpc/META-INF/MANIFEST.MF
# mv org.eclipse.orbit/javax.xml.rpc/META-INF/MANIFEST.MF xmlrpc-MANIFEST.MF
Source1:        xmlrpc-MANIFEST.MF
# cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/tools export -r v1_4_0 org.eclipse.orbit/org.apache.axis/META-INF/MANIFEST.MF
# mv org.eclipse.orbit/org.apache.axis/META-INF/MANIFEST.MF axis-MANIFEST.MF
Source2:        axis-MANIFEST.MF
# cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/tools export -r v1_3_0 org.eclipse.orbit/javax.xml.soap/META-INF/MANIFEST.MF
# mv org.eclipse.orbit/javax.xml.soap/META-INF/MANIFEST.MF saaj-MANIFEST.MF
Source3:        saaj-MANIFEST.MF
Source4:        http://repo1.maven.org/maven2/axis/axis/1.4/axis-1.4.pom
Source5:        http://repo1.maven.org/maven2/axis/axis-ant/1.4/axis-ant-1.4.pom
Source6:        http://repo1.maven.org/maven2/axis/axis-jaxrpc/1.4/axis-jaxrpc-1.4.pom
Source7:        http://repo1.maven.org/maven2/axis/axis-saaj/1.4/axis-saaj-1.4.pom
Source8:        axis-schema-1.4.pom
Patch0:         unimplemented-dom3-methods.patch
Patch1:         axis-1.4-gcc44_build.patch
Patch2:         axis-manifest.patch
BuildRequires:  ant
BuildRequires:  ant-jdepend
BuildRequires:  antlr
BuildRequires:  classpath
BuildRequires:  classpathx-mail
BuildRequires:  gnu-jaf
BuildRequires:  jakarta-commons-discovery
BuildRequires:  jakarta-commons-httpclient3
BuildRequires:  jakarta-commons-logging
BuildRequires:  java-devel
BuildRequires:  jpackage-utils
BuildRequires:  junit
BuildRequires:  log4j-mini
BuildRequires:  servletapi5
BuildRequires:  unzip
BuildRequires:  wsdl4j
BuildRequires:  xerces-j2
Requires:       jaf
Requires:       jakarta-commons-discovery
Requires:       jakarta-commons-httpclient3
Requires:       jakarta-commons-logging
Requires:       java
Requires:       javamail
Requires:       jaxp_parser_impl
Requires:       jpackage-utils >= 1.5
Requires:       log4j
Requires:       wsdl4j
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Apache Axis is an implementation of the SOAP ("Simple Object Access
Protocol") submission to W3C.

%package javadoc
PreReq:         coreutils
Summary:        Api documentation for axis
Group:          Documentation/Other

%description javadoc
Api documentation for axis

%package manual
Summary:        Manual for axis
Group:          Documentation/Other

%description manual
Manual for axis

%prep
%setup -q -n %{name}-1_4
ln -s %{_javadocdir}/%{name} docs/apiDocs

%patch0 -p1
%patch1 -p1 -b gcc44-build
%patch2 -p0

# Remove provided binaries
find . -name "*.jar" -exec rm -f {} \;
find . -name "*.zip" -exec rm -f {} \;
find . -name "*.class" -exec rm -f {} \;

cp %{SOURCE1} %{SOURCE2} %{SOURCE3} .

%build
[ -z "$JAVA_HOME" ] && export JAVA_HOME=%{_jvmdir}/java
CLASSPATH=$(build-classpath wsdl4j commons-discovery commons-httpclient3 commons-logging log4j activation javamail servletapi5)
export CLASSPATH=$CLASSPATH:$(build-classpath oro junit jdepend jimi xml-security jsse httpunit jms castor 2>/dev/null)
export OPT_JAR_LIST="ant/ant-nodeps"
export LC_ALL="en_US.UTF-8" # necessary for javadoc
ant -Dcompile.ime=true \
    -Dwsdl4j.jar=$(build-classpath wsdl4j) \
    -Dcommons-discovery.jar=$(build-classpath commons-discovery) \
    -Dcommons-logging.jar=$(build-classpath commons-logging) \
    -Dcommons-httpclient.jar=$(build-classpath commons-httpclient3) \
    -Dlog4j-core.jar=$(build-classpath log4j) \
    -Dactivation.jar=$(build-classpath jaf) \
    -Dmailapi.jar=$(build-classpath javamail/mailapi) \
    -Dxerces.jar=$(build-classpath jaxp_parser_impl) \
    -Dservlet.jar=$(build-classpath servletapi5) \
    -Dregexp.jar=$(build-classpath oro 2>/dev/null) \
    -Djunit.jar=$(build-classpath junit 2>/dev/null) \
    -Djimi.jar=$(build-classpath jimi 2>/dev/null) \
    -Djsse.jar=$(build-classpath jsse/jsse 2>/dev/null) \
    -Dant.build.javac.source=1.4 \
    -Dant.build.javac.target=1.4 \
    clean compile javadocs

%install
### Jar files
install -d -m 755 %{buildroot}%{_javadir}/%{name}
pushd build/lib
   install -m 644 axis.jar axis-ant.jar saaj.jar jaxrpc.jar \
           %{buildroot}%{_javadir}/%{name}
popd

### Javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr build/javadocs/* %{buildroot}%{_javadocdir}/%{name}

# POMs
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
install -m 644 %{S:4} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-axis.pom
%add_maven_depmap JPP.%{name}-axis.pom %{name}/axis.jar
install -m 644 %{S:5} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-axis-ant.pom
%add_maven_depmap JPP.%{name}-axis-ant.pom %{name}/axis-ant.jar
install -m 644 %{S:6} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-jaxrpc.pom
%add_maven_depmap JPP.%{name}-jaxrpc.pom %{name}/jaxrpc.jar
install -m 644 %{S:7} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-saaj.pom
%add_maven_depmap JPP.%{name}-saaj.pom %{name}/saaj.jar
#install -m 644 %{S:8} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-axis-schema.pom
# % add_maven_depmap JPP.%{name}-axis-schema.pom %{name}/axis-schema.jar

%files
%defattr(0644,root,root,0755)
%doc LICENSE README release-notes.html changelog.html
%dir %{_javadir}/%{name}
%{_javadir}/%{name}/*.jar
%{_mavenpomdir}/*.pom
%{_mavendepmapfragdir}/%{name}

%files javadoc
%defattr(0644,root,root,0755)
%dir %{_javadocdir}/%{name}
%{_javadocdir}/%{name}/*

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

%changelog