Update to current packaging guidelines
This commit is contained in:
parent
c681ccfde5
commit
b5eeef60dc
1 changed files with 32 additions and 64 deletions
|
|
@ -1,53 +1,33 @@
|
|||
%global base_name fileupload
|
||||
%global short_name commons-%{base_name}
|
||||
Name: apache-commons-fileupload
|
||||
Version: 1.3.1
|
||||
Release: 6%{?dist}
|
||||
Summary: API to work with HTML file upload
|
||||
License: ASL 2.0
|
||||
URL: http://commons.apache.org/fileupload/
|
||||
BuildArch: noarch
|
||||
|
||||
Name: apache-%{short_name}
|
||||
Version: 1.3.1
|
||||
Release: 5%{?dist}
|
||||
Summary: This package provides an api to work with html file upload
|
||||
License: ASL 2.0
|
||||
Group: Development/Libraries
|
||||
URL: http://commons.apache.org/%{base_name}/
|
||||
Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
|
||||
BuildArch: noarch
|
||||
Source0: http://www.apache.org/dist/commons/fileupload/source/commons-fileupload-%{version}-src.tar.gz
|
||||
|
||||
BuildRequires: java-devel >= 1:1.6.0
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: junit >= 0:3.8.1
|
||||
BuildRequires: servlet
|
||||
BuildRequires: apache-commons-io
|
||||
BuildRequires: maven-antrun-plugin
|
||||
BuildRequires: maven-assembly-plugin
|
||||
BuildRequires: maven-compiler-plugin
|
||||
BuildRequires: maven-doxia-sitetools
|
||||
BuildRequires: maven-install-plugin
|
||||
BuildRequires: maven-jar-plugin
|
||||
BuildRequires: maven-javadoc-plugin
|
||||
BuildRequires: maven-plugin-bundle
|
||||
BuildRequires: maven-release-plugin
|
||||
BuildRequires: maven-resources-plugin
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: mvn(commons-io:commons-io)
|
||||
BuildRequires: mvn(javax.servlet:servlet-api)
|
||||
BuildRequires: mvn(junit:junit)
|
||||
BuildRequires: mvn(org.apache.commons:commons-parent:pom:)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-release-plugin)
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: portlet-2.0-api
|
||||
%endif
|
||||
|
||||
Requires: java-headless >= 1:1.6.0
|
||||
Requires: jpackage-utils
|
||||
Requires: apache-commons-io
|
||||
%if 0%{?fedora}
|
||||
Requires: portlet-2.0-api
|
||||
BuildRequires: mvn(javax.portlet:portlet-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
|
||||
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
|
||||
javax.servlet.http.HttpServletRequest.
|
||||
|
||||
%package javadoc
|
||||
Summary: API documentation for %{name}
|
||||
Group: Documentation
|
||||
Requires: jpackage-utils
|
||||
Summary: API documentation for %{name}
|
||||
|
||||
%description javadoc
|
||||
This package contains the API documentation for %{name}.
|
||||
|
|
@ -55,7 +35,7 @@ This package contains the API documentation for %{name}.
|
|||
# -----------------------------------------------------------------------------
|
||||
|
||||
%prep
|
||||
%setup -q -n %{short_name}-%{version}-src
|
||||
%setup -q -n commons-fileupload-%{version}-src
|
||||
sed -i 's/\r//' LICENSE.txt
|
||||
sed -i 's/\r//' NOTICE.txt
|
||||
|
||||
|
|
@ -73,41 +53,29 @@ rm src/test/java/org/apache/commons/fileupload/*Portlet*
|
|||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
%mvn_file ":{*}" %{name} @1
|
||||
%mvn_alias : org.apache.commons:
|
||||
|
||||
%build
|
||||
# fix build with generics support
|
||||
# tests fail to compile because they use an obsolete version of servlet API (2.4)
|
||||
mvn-rpmbuild -Dmaven.test.skip=true -Dmaven.compile.source=1.5 -Dmaven.compile.target=1.5 install javadoc:javadoc
|
||||
# -----------------------------------------------------------------------------
|
||||
%mvn_build -f
|
||||
|
||||
%install
|
||||
# jars
|
||||
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
|
||||
install -p -m 644 target/%{short_name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
|
||||
pushd $RPM_BUILD_ROOT%{_javadir}
|
||||
ln -sf %{name}.jar %{short_name}.jar
|
||||
popd # come back from javadir
|
||||
|
||||
# javadoc
|
||||
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
|
||||
cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
|
||||
|
||||
# pom
|
||||
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
|
||||
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{short_name}.pom
|
||||
%add_maven_depmap JPP-%{short_name}.pom %{short_name}.jar -a "org.apache.commons:%{short_name}"
|
||||
%mvn_install
|
||||
|
||||
%files -f .mfiles
|
||||
%doc LICENSE.txt NOTICE.txt
|
||||
%{_javadir}/%{name}.jar
|
||||
%{_javadir}/%{short_name}.jar
|
||||
%license LICENSE.txt NOTICE.txt
|
||||
|
||||
%files javadoc
|
||||
%doc LICENSE.txt NOTICE.txt
|
||||
%doc %{_javadocdir}/%{name}
|
||||
%files javadoc -f .mfiles-javadoc
|
||||
%license LICENSE.txt NOTICE.txt
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
%changelog
|
||||
* Wed Apr 8 2015 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.3.1-6
|
||||
- Update to current packaging guidelines
|
||||
|
||||
* Tue Oct 14 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.3.1-5
|
||||
- Remove legacy Obsoletes/Provides for jakarta-commons
|
||||
|
||||
|
|
|
|||
Reference in a new issue