# # spec file # # Copyright (c) 2023 SUSE LLC # # 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} %define full_name apache-%{short_name} %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "bootstrap" %bcond_without bootstrap %else %bcond_with bootstrap %endif Version: 3.12.0 Release: 0 Summary: Apache Commons Lang Package License: Apache-2.0 Group: Development/Libraries/Java URL: https://commons.apache.org/proper/commons-lang/ Source0: https://dlcdn.apache.org/commons/lang/source/%{short_name}-%{version}-src.tar.gz Source1: build.xml Source2: default.properties BuildRequires: java-devel >= 1.8 BuildArch: noarch %if %{with bootstrap} Name: %{full_name}-bootstrap Conflicts: %{full_name} %else Name: %{full_name} BuildRequires: ant BuildRequires: fdupes BuildRequires: javapackages-local >= 6 Conflicts: %{full_name}-bootstrap Provides: %{short_name} = %{version}-%{release} Obsoletes: %{full_name}-bootstrap %endif %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 %if %{without bootstrap} export OPT_JAR_LIST=`cat %{_sysconfdir}/ant.d/junit` export CLASSPATH= ant \ -Dcompile.source=1.8 -Dcompile.target=1.8 \ -Dfinal.name=%{short_name} \ jar javadoc %else mkdir -p target/classes javac -source 8 -target 8 -encoding utf-8 -d target/classes $(find src/main/java -name \*.java | xargs) jar -cf target/%{short_name}.jar -C target/classes . %endif %install # jars install -dm 755 %{buildroot}%{_javadir} install -m 0644 target/%{short_name}.jar %{buildroot}%{_javadir}/%{full_name}.jar ln -sf %{full_name}.jar %{buildroot}%{_javadir}/%{short_name}.jar %if %{without bootstrap} # pom install -dm 755 %{buildroot}%{_mavenpomdir} %mvn_install_pom pom.xml %{buildroot}%{_mavenpomdir}/%{full_name}.pom %add_maven_depmap %{full_name}.pom %{full_name}.jar # javadoc install -dm 755 %{buildroot}%{_javadocdir}/%{name} cp -pr target/apidocs/* %{buildroot}%{_javadocdir}/%{full_name}/ %fdupes -s %{buildroot}%{_javadocdir}/%{full_name}/ %files -f .mfiles %license LICENSE.txt NOTICE.txt %doc RELEASE-NOTES.txt %{_javadir}/%{short_name}.jar %files javadoc %{_javadocdir}/%{full_name} %else %files %license LICENSE.txt NOTICE.txt %{_javadir}/*.jar %endif %changelog