apache-commons-lang3/apache-commons-lang3.spec

102 lines
3.2 KiB
RPMSpec

#
# spec file for package apache-commons-lang3
#
# Copyright (c) 2018 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 https://bugs.opensuse.org/
#
%define base_name lang3
%define short_name commons-%{base_name}
Name: apache-commons-lang3
Version: 3.5
Release: 0
Summary: Apache Commons Lang Package
License: Apache-2.0
Group: Development/Libraries/Java
URL: http://commons.apache.org/%{base_name}
Source0: http://archive.apache.org/dist/commons/lang/source/%{short_name}-%{version}-src.tar.gz
Source1: build.xml
Source2: default.properties
BuildRequires: ant
BuildRequires: ant-junit
BuildRequires: fdupes
BuildRequires: java-devel >= 1.6
BuildRequires: javapackages-local
BuildRequires: javapackages-tools
BuildRequires: junit
Provides: %{short_name} = %{version}-%{release}
BuildArch: noarch
%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 help with building methods, such
as hashCode, toString and equals.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation/HTML
%description javadoc
Javadoc for %{name}.
%prep
%setup -q -n %{short_name}-%{version}-src
cp %{SOURCE1} .
cp %{SOURCE2} .
sed -i 's/\r//' *.txt
%build
export OPT_JAR_LIST=`cat %{_sysconfdir}/ant.d/junit`
export CLASSPATH=
ant \
-Dcompile.source=1.6 -Dcompile.target=1.6 \
-Dfinal.name=%{short_name} \
jar javadoc
%install
# jars
mkdir -p %{buildroot}%{_javadir}
cp -p target/%{short_name}.jar %{buildroot}%{_javadir}/%{name}.jar
(cd %{buildroot}%{_javadir} && for jar in apache-*; do ln -sf ${jar} `echo $jar| sed "s|apache-||g"`; done)
# pom
mkdir -p %{buildroot}%{_mavenpomdir}
cp -p pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap
# javadoc
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr target/apidocs/* %{buildroot}%{_javadocdir}/%{name}/
%fdupes -s %{buildroot}%{_javadocdir}/%{name}/
%files
%license LICENSE.txt
%doc NOTICE.txt RELEASE-NOTES.txt
%{_javadir}/%{name}.jar
%{_javadir}/%{short_name}.jar
%{_mavenpomdir}/*
%{_datadir}/maven-metadata/%{name}.xml
%files javadoc
%{_javadocdir}/%{name}
%changelog