Accepting request 242664 from Java:packages

- Cleanup with spec-cleaner
- Fix update-alternatives

OBS-URL: https://build.opensuse.org/request/show/242664
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/servletapi4?expand=0&rev=16
This commit is contained in:
Stephan Kulow 2014-08-01 17:26:58 +00:00 committed by Git OBS Bridge
commit 724eb82458
2 changed files with 29 additions and 32 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jul 21 10:32:00 UTC 2014 - tchvatal@suse.com
- Cleanup with spec-cleaner
- Fix update-alternatives
-------------------------------------------------------------------
Fri Feb 7 08:46:53 UTC 2014 - fcrozat@suse.com

View File

@ -16,57 +16,46 @@
#
Name: servletapi4
BuildRequires: ant
BuildRequires: java2-devel-packages
BuildRequires: xml-commons-apis
%define base_name servletapi
%define major_version 4
%define name %{base_name}%{major_version}
%define full_name jakarta-%{base_name}
%define version 4.0.4
%define release 3jpp
%define section free
Name: servletapi4
Version: 4.0.4
Release: 0
Summary: Java servlet and JSP implementation classes
License: Apache-1.1
Group: Development/Libraries/Java
Url: http://jakarta.apache.org/tomcat/
Source: %{full_name}-4-src.tar.gz
Patch150: java150_build.patch
Url: http://jakarta.apache.org/tomcat/
Provides: servlet
PreReq: /usr/sbin/update-alternatives
BuildRequires: ant
BuildRequires: ant >= 1.2
BuildRequires: java2-devel-packages
BuildRequires: javapackages-tools
BuildArch: noarch
BuildRequires: xml-commons-apis
Requires(post): %{_sbindir}/update-alternatives
Provides: servlet = %{version}
Obsoletes: servlet22 < %{version}
Obsoletes: servlet4 < %{version}
Provides: servlet22 = %{version}
Provides: servlet4 = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Obsoletes: servlet23
Obsoletes: servlet4
Provides: servlet23
Provides: servlet4
BuildArch: noarch
%description
This subproject contains the source code for the implementation classes
of the Java Servlet and JSP APIs (packages javax.servlet).
%package javadoc
Summary: Javadoc for servletapi4
Group: Development/Libraries/Java
PreReq: coreutils
%description javadoc
This subproject contains the source code for the implementation classes
of the Java Servlet and JSP APIs (packages javax.servlet). This package
contains the javadoc documentation for the Java Servlet and JSP APIs.
%prep
rm -rf $RPM_BUILD_ROOT
%setup -n %{full_name}-4-src
%setup -q -n %{full_name}-4-src
%patch150 -p1
%build
@ -74,15 +63,15 @@ ant dist -Dservletapi.build=build -Dservletapi.dist=dist
%install
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 dist/lib/servlet.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
install -d -m 755 %{buildroot}%{_javadir}
install -m 644 dist/lib/servlet.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pr build/docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr build/docs/api/* %{buildroot}%{_javadocdir}/%{name}
# alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives/
ln -sf %{_sysconfdir}/alternatives/servlet.jar %{buildroot}%{_javadir}/servlet.jar
%post
update-alternatives --install %{_javadir}/servlet.jar servlet %{_javadir}/%{name}-%{version}.jar 40
@ -96,6 +85,8 @@ fi
%defattr(-,root,root)
%doc LICENSE README.txt
%{_javadir}/*
%{_javadir}/servlet.jar
%ghost %{_sysconfdir}/alternatives/servlet.jar
%files javadoc
%defattr(-,root,root)