File apache-commons-fileupload2.spec of Package apache-commons-fileupload2
#
# spec file for package apache-commons-fileupload2
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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/
#
%global base_name fileupload2
%global short_name commons-%{base_name}
%global file_version 2.0.0-M4
Name: apache-%{short_name}
Version: 2.0.0~M4
Release: 0
Summary: API to work with HTML file upload
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://commons.apache.org/proper/commons-fileupload/
Source0: https://archive.apache.org/dist/commons/fileupload/source/%{short_name}-%{file_version}-src.tar.gz
Source1: %{short_name}-build.tar.xz
BuildRequires: ant
BuildRequires: apache-commons-io >= 2.16
BuildRequires: apache-portlet-1_0-api
BuildRequires: fdupes
BuildRequires: glassfish-servlet-api
BuildRequires: jakarta-servlet
BuildRequires: java-devel >= 17
BuildRequires: javapackages-local >= 6
Provides: %{short_name} = %{version}
Obsoletes: %{short_name} < %{version}
BuildArch: noarch
%description
The Apache Commons FileUpload component provides a simple yet
flexible means of adding support for multipart file upload
functionality to servlets and web applications.
%package core
Summary: Apache Commons FileUpload Core
Group: Development/Libraries/Java
%description core
The Apache Commons FileUpload Core component provides the
framework for a simple yet flexible means of adding support
for multipart file upload functionality to servlets, portlets,
and web applications.
%package jakarta-servlet5
Summary: Apache Commons FileUpload Jakarta Servlet 5
Group: Development/Libraries/Java
%description jakarta-servlet5
The Apache Commons FileUpload Jakarta component provides a
simple yet flexible means of adding support for multipart file
upload functionality to Jakarta servlets and web applications.
%package jakarta-servlet6
Summary: Apache Commons FileUpload Jakarta Servlet 6
Group: Development/Libraries/Java
%description jakarta-servlet6
The Apache Commons FileUpload Jakarta component provides a
simple yet flexible means of adding support for multipart file
upload functionality to Jakarta servlets and web applications.
%package javax
Summary: Apache Commons FileUpload Javax
Group: Development/Libraries/Java
%description javax
The Apache Commons FileUpload Javax component provides a simple
yet flexible means of adding support for multipart file upload
functionality to Javax servlets and web applications.
%package portlet
Summary: Apache Commons FileUpload Portlet
Group: Development/Libraries/Java
%description portlet
The Apache Commons FileUpload Portlet component provides a
simple yet flexible means of adding support for multipart
file upload functionality to portlet.
%package javadoc
Summary: API documentation for %{name}
Group: Documentation/HTML
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n %{short_name}-%{file_version} -a1
%build
mkdir -p lib
build-jar-repository -s lib \
commons-io \
glassfish-servlet-api \
jakarta-servlet/jakarta.servlet-api \
portlet-api
ant package javadoc
%install
install -dm 0755 %{buildroot}%{_javadir}
install -dm 0755 %{buildroot}%{_mavenpomdir}
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
for i in core jakarta-servlet5 jakarta-servlet6 javax portlet; do
# jar
install -pm 0644 %{short_name}-${i}/target/%{short_name}-${i}-%{file_version}.jar %{buildroot}%{_javadir}/%{short_name}-${i}.jar
ln -sf %{short_name}-${i}.jar %{buildroot}%{_javadir}/%{name}-${i}.jar
# pom
%{mvn_install_pom} %{short_name}-${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{short_name}-${i}.pom
%add_maven_depmap %{short_name}-${i}.pom %{short_name}-${i}.jar -f ${i}
# javadoc
cp -pr %{short_name}-${i}/target/site/apidocs %{buildroot}%{_javadocdir}/%{name}/${i}
done
%fdupes -s %{buildroot}%{_javadocdir}
%files core -f .mfiles-core
%license LICENSE.txt NOTICE.txt
%doc README.md
%{_javadir}/%{name}-core.jar
%files jakarta-servlet5 -f .mfiles-jakarta-servlet5
%{_javadir}/%{name}-jakarta-servlet5.jar
%files jakarta-servlet6 -f .mfiles-jakarta-servlet6
%{_javadir}/%{name}-jakarta-servlet6.jar
%files javax -f .mfiles-javax
%{_javadir}/%{name}-javax.jar
%files portlet -f .mfiles-portlet
%{_javadir}/%{name}-portlet.jar
%files javadoc
%license LICENSE.txt NOTICE.txt
%{_javadocdir}/%{name}
%changelog