File classworlds.spec of Package classworlds

#
# spec file for package classworlds
#
# Copyright (c) 2017 SUSE LINUX 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/
#


Name:           classworlds
Version:        1.1
Release:        0
Summary:        Classworlds Classloader Framework
License:        BSD-3-Clause
Group:          Development/Libraries/Java
Url:            http://classworlds.codehaus.org/
Source0:        classworlds-1.1-src.tar.bz2
# svn export http://svn.codehaus.org/classworlds/tags/CLASSWORLDS_1_1/classworlds/ classworlds-1.1
Source1:        classworlds-1.1-build.xml
Source2:        http://repo1.maven.org/maven2/%{name}/%{name}/%{version}/%{name}-%{version}.pom
Patch0:         classworlds-1.1-project_xml.patch
BuildRequires:  ant >= 1.6
BuildRequires:  fdupes
BuildRequires:  javapackages-local
BuildRequires:  javapackages-tools
BuildRequires:  junit
BuildRequires:  xerces-j2
BuildRequires:  xml-commons-apis
Requires:       xerces-j2
Requires:       xml-commons-apis
BuildArch:      noarch

%description
Classworlds is a framework for container developers
who require complex manipulation of Java's ClassLoaders.
Java's native ClassLoader mechanims and classes can cause
much headache and confusion for certain types of
application developers. Projects which involve dynamic
loading of components or otherwise represent a 'container'
can benefit from the classloading control provided by
classworlds.

%package        javadoc
Summary:        Javadoc for %{name}
Group:          Development/Libraries/Java

%description    javadoc
Classworlds is a framework for container developers
who require complex manipulation of Java's ClassLoaders.
Java's native ClassLoader mechanims and classes can cause
much headache and confusion for certain types of
application developers. Projects which involve dynamic
loading of components or otherwise represent a 'container'
can benefit from the classloading control provided by
classworlds.

%prep
%setup -q
find -name "*.jar" | xargs rm
cp -p %{SOURCE1} build.xml
%patch0

%build
export CLASSPATH=target/classes:target/test-classes
export OPT_JAR_LIST=:
ant -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 \
    -Dbuild.sysclasspath=only \
    jar javadoc

%install
install -Dpm 644 target/%{name}-%{version}.jar \
  %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)

# POM and depmap
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -p -m 644 %{SOURCE2} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap

# javadocs
install -dm 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -pr target/docs/apidocs/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
# FIXME: (dwalluck): breaks -bi --short-circuit
rm -rf target/docs/apidocs

%files
%doc LICENSE.txt
%{_javadir}/*.jar
%{_mavenpomdir}/*
%{_datadir}/maven-metadata/%{name}.xml*

%files javadoc
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}

%changelog
openSUSE Build Service is sponsored by