#
# spec file for package apache
#
# Copyright (c) 2019 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/
#
%global base_name fileupload
%global short_name commons-%{base_name}
%bcond_without portlet
Name: apache-%{short_name}
Version: 1.4
Release: 4.26
Summary: API to work with HTML file upload
License: Apache-2.0
Group: Development/Libraries/Java
URL: http://commons.apache.org/fileupload/
Source0: http://archive.apache.org/dist/commons/fileupload/source/commons-fileupload-%{version}-src.tar.gz
Source1: %{name}-build.xml
BuildRequires: ant
BuildRequires: apache-commons-io
BuildRequires: fdupes
BuildRequires: glassfish-servlet-api
BuildRequires: javapackages-local
%if 0%{?rhel} >= 9
BuildRequires: xmvn-tools
%else
BuildRequires: xmvn-install
%endif
Provides: jakarta-%{short_name} = %{version}-%{release}
Obsoletes: jakarta-%{short_name} < %{version}-%{release}
Provides: %{short_name} = %{version}-%{release}
Obsoletes: %{short_name} < %{version}-%{release}
Requires: mvn(commons-io:commons-io)
BuildArch: noarch
%if %{with portlet}
BuildRequires: apache-portlet-1_0-api
%endif
%description
The javax.servlet package lacks support for RFC-1867, HTML file
upload. This package provides a simple to use API for working with
such data. The scope of this package is to create a package of Java
utility classes to read multipart/form-data within a
javax.servlet.http.HttpServletRequest.
%package javadoc
Summary: API documentation for %{name}
Group: Documentation/HTML
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n commons-fileupload-%{version}-src
cp %{SOURCE1} build.xml
sed -i 's/\r//' LICENSE.txt
sed -i 's/\r//' NOTICE.txt
%if %{with portlet}
# fix gId
sed -i "s|portlet-api|javax.portlet|" pom.xml
%else
%pom_remove_dep portlet-api:portlet-api
%pom_xpath_remove pom:properties/pom:commons.osgi.import
%pom_xpath_remove pom:properties/pom:commons.osgi.dynamicImport
rm -r src/main/java/org/apache/commons/fileupload/portlet
%endif
%{pom_remove_parent}
%mvn_file :commons-fileupload %{name}/%{short_name} %{short_name} %{name}
%build
%mvn_artifact pom.xml target/%{short_name}-%{version}.jar
mkdir -p lib
build-jar-repository -s lib \
commons-io \
glassfish-servlet-api
%if %{with portlet}
build-jar-repository -s lib \
portlet-api
%endif
# tests fail to compile because they use an obsolete version of servlet API (2.4)
%{ant} \
-Dtest.skip=true \
jar javadoc
%install
%mvn_install
%files -f .mfiles
%license LICENSE.txt NOTICE.txt
%{_javadir}/%{name}.jar
%files javadoc -f .mfiles-javadoc
%license LICENSE.txt NOTICE.txt
%changelog
* Tue Apr 26 2022 Stefan Bluhm
- Removed deprecated %%add_maven_depmap.
* Mon Apr 8 2019 Fridrich Strba
- Rename to apache-commons-fileupload and upgrade to version 1.4
- Generate and customize ant build.xml file
* Fri Dec 7 2018 Fridrich Strba
- Build against xml-commons-apis instead of xerces-j2-xml-apis
* Mon Sep 18 2017 fstrba@suse.com
- Fix build with jdk9: specify java source and target 1.6
- Clean spec file and fix rpmlint warnings
* Tue Jul 8 2014 tchvatal@suse.com
- Not needed condition.
* Tue Jul 8 2014 tchvatal@suse.com
- Cleanup with spec-cleaner and fix build on sle11 properly.
* Fri Jun 27 2014 jmatejek@suse.com
- added Xerces xml-apis to dependencies to fix build
* Thu May 15 2014 darin@darins.net
- disable bytecode check on sle_11
- remove removal of buildroot in %%install
* Wed Apr 2 2014 tchvatal@suse.com
- Fix bnc#862781/CVE-2014-0050: buffer overflow
http://svn.apache.org/viewvc?view=revision&revision=1565143
* jakarta-commons-fileupload-CVE-2014-0050-DOS-buffer-overflow.patch
* Fri Oct 18 2013 mvyskocil@suse.com
- remove gcj part and deprecated macros
* Thu Oct 17 2013 mvyskocil@suse.com
- fix bnc#846174/CVE-2013-2186: null byte injection flaw
http://svn.apache.org/viewvc?view=revision&revision=1507048
* jakarta-commons-fileupload-CVE-2013-2186.patch
* Mon Sep 9 2013 tchvatal@suse.com
- Move from jpackage-utils to javapackage-tools
* Thu Mar 13 2008 mvyskocil@suse.cz
- merged with jpackage 1.7
- update to 1.1.1
* Fri Sep 22 2006 skh@suse.de
- don't use icecream
- use target="1.4" for build with java 1.5
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Oct 18 2005 jsmeix@suse.de
- Current version 1.0 from JPackage.org
* Wed Sep 28 2005 dmueller@suse.de
- add norootforbuild
* Thu Sep 16 2004 skh@suse.de
- Fix prerequires of javadoc subpackage
* Sun Sep 5 2004 skh@suse.de
- Initial package created with version 1.0 (JPackage 1.5)