1
0
Tomáš Chvátal 2016-09-29 10:44:28 +00:00 committed by Git OBS Bridge
parent d906c9e328
commit 695ec206a3

View File

@ -1,7 +1,7 @@
# #
# spec file for package jakarta-commons-pool # spec file for package apache-commons-pool
# #
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -16,22 +16,15 @@
# #
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
# If you don't want to build with maven, and use straight ant instead,
# give rpmbuild option '--without maven'
%define with_maven %{!?_without_maven:1}%{?_without_maven:0}
%define without_maven %{?_without_maven:1}%{!?_without_maven:0}
%define with_maven 0
%define base_name pool %define base_name pool
%define short_name commons-%{base_name} %define short_name commons-%{base_name}
%define section free
Name: jakarta-commons-pool Name: jakarta-commons-pool
Version: 1.3 Version: 1.3
Release: 0 Release: 0
Summary: Jakarta Commons Pool Package Summary: Jakarta Commons Pool Package
License: Apache-2.0 License: Apache-2.0
Group: Development/Libraries/Java Group: Development/Libraries/Java
Url: https://commons.apache.org/proper/commons-pool/
Source0: http://www.apache.org/dist/jakarta/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.bz2 Source0: http://www.apache.org/dist/jakarta/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.bz2
Source1: pom-maven2jpp-depcat.xsl Source1: pom-maven2jpp-depcat.xsl
Source2: pom-maven2jpp-newdepmap.xsl Source2: pom-maven2jpp-newdepmap.xsl
@ -42,43 +35,16 @@ Source6: pool-tomcat5-build.xml
Source7: commons-pool-maven-build.dtd Source7: commons-pool-maven-build.dtd
Source8: commons-pool-commons.ent Source8: commons-pool-commons.ent
Patch0: jakarta-commons-pool-build.patch Patch0: jakarta-commons-pool-build.patch
Url: http://jakarta.apache.org/commons/pool/
BuildRequires: ant BuildRequires: ant
BuildRequires: java-devel
BuildRequires: javapackages-tools BuildRequires: javapackages-tools
BuildRequires: junit BuildRequires: junit
%if ! %defined suse_version Provides: jakarta-commons-pool = %{version}
BuildRequires: java-javadoc Obsoletes: jakarta-commons-pool < %{version}
%else Provides: %{short_name} = %{version}
BuildRequires: java-devel Obsoletes: %{short_name} < %{version}
%endif
%if %{with_maven}
BuildRequires: maven >= 1.1
BuildRequires: maven-plugin-changes
BuildRequires: maven-plugin-jdepend
BuildRequires: maven-plugin-jdiff
BuildRequires: maven-plugin-jxr
BuildRequires: maven-plugin-license
BuildRequires: maven-plugin-scm
BuildRequires: maven-plugin-tasklist
BuildRequires: maven-plugin-test
BuildRequires: maven-plugin-xdoc
BuildRequires: maven-plugins-base
BuildRequires: saxon
BuildRequires: saxon-scripts
BuildRequires: xerces-j2
BuildRequires: xml-commons-jaxp-1.3-apis
%endif
%if ! %{gcj_support}
BuildArch: noarch
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: %{short_name} = %{version}-%{release} BuildArch: noarch
Obsoletes: %{short_name} < :%{version}-%{release}
%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif
%description %description
The goal of the Pool package is to create and maintain an object The goal of the Pool package is to create and maintain an object
@ -87,16 +53,15 @@ package supports a variety of pool implementations, but encourages
support of an interface that makes these implementations support of an interface that makes these implementations
interchangeable. interchangeable.
%package javadoc %package javadoc
Summary: Javadoc for jakarta-commons-pool Summary: Javadoc for jakarta-commons-pool
Group: Development/Libraries/Java Group: Development/Libraries/Java
Requires(post): /bin/ln
Requires(post): /bin/rm
Requires(postun): /bin/rm
%if ! %defined suse_version %if ! %defined suse_version
Requires: java-javadoc Requires: java-javadoc
%endif %endif
Requires(post): /bin/rm,/bin/ln
Requires(postun): /bin/rm
%description javadoc %description javadoc
The goal of Pool package it to create and maintain an object (instance) The goal of Pool package it to create and maintain an object (instance)
@ -107,8 +72,6 @@ of an interface that makes these implementations interchangeable.
This package contains the javadoc documentation for the Jakarta Commons This package contains the javadoc documentation for the Jakarta Commons
Pool Package. Pool Package.
%package tomcat5 %package tomcat5
Summary: Jakarta Commons Pool Package Summary: Jakarta Commons Pool Package
Group: Development/Libraries/Java Group: Development/Libraries/Java
@ -120,20 +83,6 @@ package supports a variety of pool implementations, but encourages
support of an interface that makes these implementations support of an interface that makes these implementations
interchangeable. interchangeable.
%if %{with_maven}
%package manual
Summary: Documents for %{name}
Group: Development/Libraries/Java
%description manual
%{summary}.
%endif
%prep %prep
%setup -q -n %{short_name}-%{version}-src %setup -q -n %{short_name}-%{version}-src
# remove all binary libs # remove all binary libs
@ -141,109 +90,29 @@ find . -name "*.jar" -exec rm -f {} \;
bzip2 -dc %{SOURCE5} | tar xf - bzip2 -dc %{SOURCE5} | tar xf -
%patch0 %patch0
cp %{SOURCE6} . cp %{SOURCE6} .
%if %{with_maven}
#Hack to get around building completely offline
#TODO: properly setup xmlcatalog to properly point to local dtd and commons.ent
cp %{SOURCE7} maven-build.dtd
cp %{SOURCE8} commons.ent
sed -i 's_http://jakarta.apache.org/commons/build_'$(pwd)'_' maven-build.dtd
sed -i 's_http://jakarta.apache.org/commons/build_'$(pwd)'_' xdocs/navigation.xml
%endif
%build %build
mkdir ./tmp mkdir ./tmp
%if %{with_maven}
for p in $(find . -name project.xml); do
pushd $(dirname $p)
cp project.xml project.xml.orig
/usr/bin/saxon -o project.xml project.xml.orig %{SOURCE3} map=%{SOURCE4}
popd
done
maven -e \
-Dmaven.javadoc.source=1.4 \
-Dmaven.repo.remote=file:/usr/share/maven/repository \
-Dmaven.home.local=$(pwd)/.maven \
jar javadoc xdoc:transform
%else
ant -Djava.io.tmpdir=. clean dist ant -Djava.io.tmpdir=. clean dist
%endif
#commons-pool-tomcat5 #commons-pool-tomcat5
ant -f pool-tomcat5-build.xml ant -f pool-tomcat5-build.xml
ant -Djava.io.tmpdir=. clean dist ant -Djava.io.tmpdir=. clean dist
%install %install
# jars # jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir} install -d -m 755 %{buildroot}%{_javadir}
%if %{with_maven} %if %{with_maven}
install -m 644 target/%{short_name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar install -m 644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%else %else
install -m 644 dist/%{short_name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar install -m 644 dist/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%endif %endif
#tomcat5 jar #tomcat5 jar
install -m 644 pool-tomcat5/%{short_name}-tomcat5.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-tomcat5-%{version}.jar install -m 644 pool-tomcat5/%{short_name}-tomcat5.jar %{buildroot}%{_javadir}/%{name}-tomcat5-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|jakarta-||g"`; done) (cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|jakarta-||g"`; done)
(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}-%{version} install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
%if %{with_maven} cp -pr dist/docs/api/* %{buildroot}%{_javadocdir}/%{name}
cp -pr target/docs/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
rm -rf target/docs/apidocs
%else
cp -pr dist/docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
%endif
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink
%if %{with_maven}
# manual
install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp -pr target/docs/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
%endif
%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}
%postun javadoc
if [ "$1" = "0" ]; then
rm -f %{_javadocdir}/%{name}
fi
%if %{gcj_support}
%post
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%if %{gcj_support}
%postun
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%if %{gcj_support}
%post tomcat5
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%if %{gcj_support}
%postun tomcat5
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%files %files
%defattr(0644,root,root,0755) %defattr(0644,root,root,0755)
@ -252,30 +121,13 @@ fi
%{_javadir}/%{name}-%{version}.jar %{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{short_name}.jar %{_javadir}/%{short_name}.jar
%{_javadir}/%{short_name}-%{version}.jar %{_javadir}/%{short_name}-%{version}.jar
%if %{gcj_support}
%attr(-,root,root)
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.db
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.so
%endif
%files tomcat5 %files tomcat5
%defattr(0644,root,root,0755) %defattr(0644,root,root,0755)
%{_javadir}/*-tomcat5*.jar %{_javadir}/*-tomcat5*.jar
%if %{gcj_support}
%attr(-,root,root)
%{_libdir}/gcj/%{name}/*-tomcat5*
%endif
%files javadoc %files javadoc
%defattr(0644,root,root,0755) %defattr(0644,root,root,0755)
%doc %{_javadocdir}/%{name}-%{version} %doc %{_javadocdir}/%{name}
%ghost %{_javadocdir}/%{name}
%if %{with_maven}
%files manual
%defattr(0644,root,root,0755)
%doc %{_docdir}/%{name}-%{version}
%endif
%changelog %changelog