# # spec file for package c3p0 # # Copyright (c) 2022 SUSE LLC # Copyright (c) 2000-2008, JPackage Project # # 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/ # %define mchange_commons_min_version 0.2.15 %define mchange_commons_version %(rpm -q --qf '%%{VERSION}' mchange-commons) Name: c3p0 Version: 0.9.5.5 Release: 4.15 Summary: JDBC DataSources/Resource Pools License: LGPL-2.0-or-later Group: Development/Libraries/Java URL: https://www.mchange.com/projects/c3p0/ Source0: http://downloads.sourceforge.net/sourceforge/c3p0/c3p0-%{version}.src.tgz Patch1: %{name}-javadoc.patch BuildRequires: ant %if !0%{?rhel} BuildRequires: ant-nodeps %endif BuildRequires: fdupes BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local BuildRequires: junit BuildRequires: mchange-commons >= %{mchange_commons_min_version} %if 0%{?rhel} >= 9 BuildRequires: xmvn-tools %endif Requires: mchange-commons = %{mchange_commons_version} %if 0%{?rhel} Requires(post): chkconfig Requires(postun):chkconfig %else Requires(post): update-alternatives Requires(postun):update-alternatives %endif Provides: hibernate_jdbc_cache BuildArch: noarch %description c3p0 is a library for augmenting traditional (DriverManager-based) JDBC drivers with JNDI-bindable DataSources, including DataSources that implement Connection and Statement Pooling, as described by the jdbc3 spec and jdbc2 standard extension. %package javadoc Summary: Javadoc for c3p0 Group: Documentation/HTML %description javadoc Javadoc documentation for c3p0. %prep %setup -q -n %{name}-%{version}.src %patch1 -p1 %build export CLASSPATH= export OPT_JAR_LIST="ant/ant-nodeps" ant \ -Dmchange-commons-java.jar.file=%{_javadir}/mchange-commons/mchange-commons-java.jar \ -Djunit.jar.file=$(build-classpath junit) -Djvm.target.version=8 \ jar javadoc sed -i "s/@c3p0.version.maven@/%{version}/g" src/maven/pom.xml sed -i "s/@mchange-commons-java.version.maven@/%{mchange_commons_version}/g" \ src/maven/pom.xml %mvn_artifact src/maven/pom.xml build/%{name}-%{version}.jar %install %if 0%{?rhel} %mvn_install ln -s /usr/share/java/c3p0/c3p0.jar %{buildroot}/usr/share/java/c3p0.jar %else # jars mkdir -p %{buildroot}%{_javadir} cp -p build/%{name}-%{version}.jar \ %{buildroot}%{_javadir}/%{name}-%{version}.jar (cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done) # poms mkdir -p %{buildroot}%{_mavenpomdir} cp -p src/maven/pom.xml %{buildroot}%{_mavenpomdir}/%{name}-%{version}.pom %add_maven_depmap %{name}-%{version}.pom %{name}-%{version}.jar -a c3p0:c3p0 %endif # javadoc mkdir -p %{buildroot}%{_javadocdir}/%{name}-%{version} cp -pr build/apidocs/* %{buildroot}%{_javadocdir}/%{name}-%{version} ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name} %fdupes -s %{buildroot}%{_javadocdir}/%{name}-%{version} # hibernate_jdbc_cache ghost symlink mkdir -p %{buildroot}%{_sysconfdir}/alternatives ln -s -f %{_sysconfdir}/alternatives/hibernate_jdbc_cache.jar \ %{buildroot}%{_javadir}/hibernate_jdbc_cache.jar %post update-alternatives --install %{_javadir}/hibernate_jdbc_cache.jar \ hibernate_jdbc_cache %{_javadir}/%{name}.jar 20 %preun if [ "$1" = 0 ] ; then update-alternatives --remove hibernate_jdbc_cache %{_javadir}/%{name}.jar fi %files %license src/dist-static/LICENSE %doc src/doc/index.html %{_javadir}/* %{_mavenpomdir}/* %if %{defined _maven_repository} %{_mavendepmapfragdir}/%{name} %else %{_datadir}/maven-metadata/%{name}.xml %endif /usr/share/java/c3p0.jar %ghost %{_sysconfdir}/alternatives/hibernate_jdbc_cache.jar %files javadoc %{_javadocdir}/%{name}-%{version} %{_javadocdir}/%{name} %changelog * Thu Apr 14 2022 Stefan Bluhm - Added building on Enterprise Linux 9. * Tue Mar 29 2022 Michael Calmer - fix building on EL8 OSes * Fri Apr 16 2021 Ferdinand Thiessen - Update to 0.9.5.5 * Fixed CVE-2018-20433, version 0.9.5.2 allowed XXE in extractXmlConfigFromInputStream during initialization. (bsc#1120648) * Properly implement the JDBC 4.1 abort method. * Make XML parsing much more restrictove by default, but allow users to revert to the old, permissive behavior by setting config property 'com.mchange.v2.c3p0.cfg.xml.usePermissiveParser' to true CVE-2019-5427 (bsc#1133198) * Address situation where a throwable during forceKillAcquires() left the force_kill_acquires flag set to true, making it impossible for the pool to restart acquisition attempts on recovery. * Upgrade dependency to mchange-commons-java 0.2.15, which includes support for log4j2 * Sun Jul 7 2019 Jan Engelhardt - Ensure neutrality of description. - Update RPM group for c3p0-javadoc. * Fri Dec 21 2018 Fridrich Strba - Do not bundle mchange-commons, but build against the new mchange-commons package - Removed patch * c3p0-embed-mchange-common.patch + Do not embed mchange-commons - Add alias c3p0:c3p0 to the maven artifact * Tue Dec 4 2018 Fridrich Strba - Add maven pom files * Wed May 16 2018 fstrba@suse.com - Build with source and target 8 to prepare for a possible removal of 1.6 compatibility * Fri May 4 2018 pmonrealgonzalez@suse.com - Added fdupes to fix building error with file jquery-1.10.2.js * Mon Sep 18 2017 fstrba@suse.com - Added patch: * c3p0-javadoc.patch + Use test-classpath for javadoc generation, since it tries to document also junit test files - Add dependency on junit - Clean spec file * Fri Apr 22 2016 dmacvicar@suse.de - update to version 0.9.5.2 - update mchange-commons-java component to version 0.2.11 - clean spec file * Fri Jun 27 2014 smoioli@suse.com - bugfix: dependent library was not embedded correctly * Fri Jun 27 2014 smoioli@suse.com - updated to upstream 0.9.5, that is compatible with Java 7 / JDBC 4 * Tue Sep 24 2013 dmacvicar@suse.de - Explicitly BuildRequires java-devel * Thu Dec 9 2010 mc@suse.de - initial release