File jakarta-commons-lang.spec of Package jakarta-commons-lang
#
# spec file for package jakarta-commons-lang (Version 2.3)
#
# 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/
#
# norootforbuild
%define with_maven 0
%define base_name lang
%define short_name commons-%{base_name}
%define section free
Name: jakarta-commons-lang
Version: 2.3
Release: 1
Summary: Jakarta Commons Lang Package
License: The Apache Software License
Group: Development/Libraries/Java
Url: http://jakarta.apache.org/commons/lang.html
Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.bz2
Source1: pom-maven2jpp-depcat.xsl
Source2: pom-maven2jpp-newdepmap.xsl
Source3: pom-maven2jpp-mapdeps.xsl
Source4: %{short_name}-%{version}-jpp-depmap.xml
Source5: %{short_name}-%{version}.pom
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
BuildRequires: jpackage-utils >= 1.7.2
BuildRequires: ant
BuildRequires: ant-junit
BuildRequires: perl
BuildRequires: java-devel
BuildRequires: unzip
BuildRequires: saxon
BuildRequires: saxon-scripts
%if %{with_maven}
BuildRequires: maven >= 1.1
BuildRequires: maven-plugin-changelog
BuildRequires: maven-plugin-changes
BuildRequires: maven-plugin-xdoc
%endif
PreReq: jpackage-utils >= 1.7.2
Requires(post): jpackage-utils >= 1.7.2
Requires(postun): jpackage-utils >= 1.7.2
%description
The standard Java libraries fail to provide enough methods for
manipulation of its core classes. The Commons Lang Component provides
these extra methods. The Commons Lang Component provides a host of
helper utilities for the java.lang API, notably string manipulation
methods, basic numerical methods, object reflection, creation and
serialization, and system properties. Additionally it contains an
inheritable enum type, an exception structure that supports multiple
types of nested exceptions, and a series of utilities dedicated to
helping with building methods, such as hashCode, toString and equals.
%package javadoc
License: The Apache Software License
PreReq: coreutils
Summary: Javadoc for jakarta-commons-lang
Group: Development/Libraries/Java
%description javadoc
The standard Java libraries fail to provide enough methods for
manipulation of its core classes. The Commons Lang Component provides
these extra methods. The Commons Lang Component provides a host of
helper utilities for the java.lang API, notably String manipulation
methods, basic numerical methods, object reflection, creation and
serialization, and System properties. Additionally it contains an
inheritable enum type, an exception structure that supports multiple
types of nested-Exceptions and a series of utlities dedicated to help
with building methods, such as hashCode, toString and equals.
This package contains the javadoc documentation for the Jakarta Commons
Lang Package.
%if %{with_maven}
%package manual
Summary: Documents for %{name}
Group: Development/Documentation
%description manual
The standard Java libraries fail to provide enough methods for
manipulation of its core classes. The Commons Lang Component provides
these extra methods. The Commons Lang Component provides a host of
helper utilities for the java.lang API, notably String manipulation
methods, basic numerical methods, object reflection, creation and
serialization, and System properties. Additionally it contains an
inheritable enum type, an exception structure that supports multiple
types of nested-Exceptions and a series of utlities dedicated to help
with building methods, such as hashCode, toString and equals.
This package contains the documentation for the Jakarta Commons
Lang Package.
%endif
%prep
%setup -q -n %{short_name}-%{version}-src
%{__perl} -pi -e 's/\r//g' *.txt
if [ ! -f %{SOURCE4} ]; then
export DEPCAT=$(pwd)/%{short_name}-%{version}-depcat.new.xml
echo '<?xml version="1.0" standalone="yes"?>' > $DEPCAT
echo '<depset>' >> $DEPCAT
for p in $(find . -name project.xml); do
pushd $(dirname $p)
/usr/bin/saxon project.xml %{SOURCE1} >> $DEPCAT
popd
done
echo >> $DEPCAT
echo '</depset>' >> $DEPCAT
/usr/bin/saxon $DEPCAT %{SOURCE2} > %{short_name}-%{version}-depmap.new.xml
fi
%build
%if %{with_maven}
for p in $(find . -name project.xml); do
pushd $(dirname $p)
cp project.xml project.xml.orig
/usr/bin/saxon -o project.xml project.xml.orig %{SOURCE3} map=%{SOURCE4}
popd
done
maven \
-Dmaven.javadoc.source=1.4 \
-Dmaven.repo.remote=file:/usr/share/maven/repository \
-Dmaven.home.local=$(pwd)/.maven \
jar javadoc xdoc:transform
%else
ant \
-Djunit.jar=$(find-jar junit) \
-Dfinal.name=%{short_name} \
-Djdk.javadoc=%{_javadocdir}/java \
jar javadoc
%endif
%install
# jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
%if %{with_maven}
cp -p target/%{short_name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
%else
cp -p dist/%{short_name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
%endif
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|jakarta-||g"`; done)
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
%add_to_maven_depmap %{base_name} %{base_name} %{version} JPP %{name}
# pom
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
install -m 644 %{SOURCE5} \
$RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-%{name}.pom
# javadoc
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr dist/docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
## manual
install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp -p STATUS.html $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp -p *.txt $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
%if %{with_maven}
rm -rf target/docs/apidocs
install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/site
cp -pr target/docs/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/site
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%post
%update_maven_depmap
%postun
%update_maven_depmap
%files
%defattr(0644,root,root,0755)
%dir %{_docdir}/%{name}-%{version}
%doc %{_docdir}/%{name}-%{version}/STATUS.html
%doc %{_docdir}/%{name}-%{version}/*.txt
%{_javadir}/*
%{_datadir}/maven2
%{_mavendepmapfragdir}
%files javadoc
%defattr(0644,root,root,0755)
%doc %{_javadocdir}/%{name}-%{version}
%doc %{_javadocdir}/%{name}
%if %{with_maven}
%files manual
%defattr(0644,root,root,0755)
%doc %{_docdir}/%{name}-%{version}/site
%endif
%changelog
* Tue Jul 29 2008 anosek@suse.cz
- made the symlink jakarta-commons-lang -> jakarta-commons-lang-2.3
part of the javadoc package
* Mon Jul 21 2008 mvyskocil@suse.cz
- update to 2.3
- merged with japackage 1.7 spec file
- add a maven build support and a maven pom files and post/un scripts for
depmap files
- removed a source=1.1 - fixed build under openjdk6
- removed a crosslink patch
* Fri Sep 15 2006 ro@suse.de
- use source=1.1 for java
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Aug 29 2005 jsmeix@suse.de
- Removed the "test" to be built so that it builds now on all
architectures (see bug 102629).
The "test" failed on ppc, s390x, and ppc64 (see bug 113779).
* Wed Jul 27 2005 jsmeix@suse.de
- Adjustments in the spec file.
* Mon Jul 18 2005 jsmeix@suse.de
- Current version 2.0 from JPackage.org
* Thu Sep 16 2004 skh@suse.de
- Fix prerequires of javadoc subpackage
* Thu Sep 02 2004 skh@suse.de
- Initial package created with version 2.0 (JPackage 1.5)