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