summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorRalph Sennhauser <sera@gentoo.org>2012-12-23 15:12:57 +0000
committerRalph Sennhauser <sera@gentoo.org>2012-12-23 15:12:57 +0000
commit60eeb308bbdb3f8ce6c7a7373a8674908f204329 (patch)
tree45956ae47dcd52fb597a39ea8e60e3c1ef8ed2b4 /dev-db
parentversion bump (diff)
downloadgentoo-2-60eeb308bbdb3f8ce6c7a7373a8674908f204329.tar.gz
gentoo-2-60eeb308bbdb3f8ce6c7a7373a8674908f204329.tar.bz2
gentoo-2-60eeb308bbdb3f8ce6c7a7373a8674908f204329.zip
Add support for JDBC 4.1/Java 7, thanks to hollow for finding and reporting the patch. #384161
Bump servlet-api dep to 2.5 and make better use of generation-2 eclasses. (Portage version: 2.1.11.31/cvs/Linux x86_64, signed Manifest commit with key 3C5CF75A)
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/hsqldb/ChangeLog10
-rw-r--r--dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch380
-rw-r--r--dev-db/hsqldb/hsqldb-1.8.1.3-r1.ebuild174
3 files changed, 563 insertions, 1 deletions
diff --git a/dev-db/hsqldb/ChangeLog b/dev-db/hsqldb/ChangeLog
index 6b31f573112c..ce4802a76e4d 100644
--- a/dev-db/hsqldb/ChangeLog
+++ b/dev-db/hsqldb/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for dev-db/hsqldb
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/hsqldb/ChangeLog,v 1.70 2012/10/17 08:19:33 ottxor Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/hsqldb/ChangeLog,v 1.71 2012/12/23 15:12:57 sera Exp $
+
+*hsqldb-1.8.1.3-r1 (23 Dec 2012)
+
+ 23 Dec 2012; Ralph Sennhauser <sera@gentoo.org> +hsqldb-1.8.1.3-r1.ebuild,
+ +files/hsqldb-1.8.1.3-java7.patch:
+ Add support for JDBC 4.1/Java 7, thanks to hollow for finding and reporting
+ the patch. #384161
+ Bump servlet-api dep to 2.5 and make better use of generation-2 eclasses.
17 Oct 2012; Christoph Junghans <ottxor@gentoo.org> hsqldb-1.8.1.3.ebuild:
added prefix support (bug #435274)
diff --git a/dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch b/dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch
new file mode 100644
index 000000000000..7f9245597182
--- /dev/null
+++ b/dev-db/hsqldb/files/hsqldb-1.8.1.3-java7.patch
@@ -0,0 +1,380 @@
+diff --git a/build/build.xml b/build/build.xml
+index 68c446f..e82f00f 100644
+--- a/build/build.xml
++++ b/build/build.xml
+@@ -98,16 +98,24 @@ examples:
+ <echo message="ant.java.hasjsse=${ant.java.hasjsse}" />
+ </target>
+
+- <target name="javaversion6">
++ <target name="javaversion7" unless="ant.java.iscjavaset">
++ <available classname="java.util.Objects" property="ant.java.iscjava17"/>
++ <available classname="java.util.Objects" property="ant.java.iscjavaset"/>
++ </target>
++
++ <target name="javaversion6" depends="javaversion7" unless="ant.java.iscjavaset">
+ <available classname="java.net.IDN" property="ant.java.iscjava16"/>
++ <available classname="java.net.IDN" property="ant.java.iscjavaset"/>
+ </target>
+
+- <target name="javaversion4" depends="javaversion6" unless="ant.java.iscjava16">
++ <target name="javaversion4" depends="javaversion6" unless="ant.java.iscjavaset">
+ <available classname="java.nio.Buffer" property="ant.java.iscjava14"/>
++ <available classname="java.nio.Buffer" property="ant.java.iscjavaset"/>
+ </target>
+
+- <target name="javaversion2" depends="javaversion4" unless="ant.java.iscjava14">
++ <target name="javaversion2" depends="javaversion4" unless="ant.java.iscjavaset">
+ <available classname="java.lang.ref.Reference" property="ant.java.iscjava12"/>
++ <available classname="java.lang.ref.Reference" property="ant.java.iscjavaset"/>
+ </target>
+
+ <target name="-prepare" depends="init,javaversion2">
+@@ -166,6 +174,7 @@ examples:
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcStatement.java"/>
+ <arg file="${src}/org/hsqldb/persist/LockFile.java"/>
+ <arg file="${src}/org/hsqldb/persist/Logger.java"/>
+@@ -183,6 +192,7 @@ examples:
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
+@@ -210,6 +220,7 @@ examples:
+ <arg value="+JAVA2FULL"/>
+ <arg value="-JAVA4"/>
+ <arg value="-JAVA6"/>
++ <arg value="-JAVA7"/>
+ </java>
+ </target>
+
+@@ -218,6 +229,7 @@ examples:
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
+@@ -244,6 +256,7 @@ examples:
+ <arg value="+JAVA2FULL"/>
+ <arg value="+JAVA4"/>
+ <arg value="-JAVA6"/>
++ <arg value="-JAVA7"/>
+ </java>
+ </target>
+
+@@ -253,6 +266,43 @@ examples:
+ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
+ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
+ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcCallableStatement.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcClob.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcConnection.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcParameterMetaData.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcPreparedStatement.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcResultSet.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcResultSetMetaData.java"/>
++ <arg file="${src}/org/hsqldb/jdbc/jdbcStatement.java"/>
++ <arg file="${src}/org/hsqldb/persist/LockFile.java"/>
++ <arg file="${src}/org/hsqldb/persist/Logger.java"/>
++ <arg file="${src}/org/hsqldb/persist/ScaledRAFile.java"/>
++ <arg file="${src}/org/hsqldb/rowio/RowInputTextLog.java"/>
++ <arg file="${src}/org/hsqldb/util/DatabaseManager.java"/>
++ <arg file="${src}/org/hsqldb/util/ConnectionDialogCommon.java"/>
++ <arg file="${src}/org/hsqldb/lib/SimpleLog.java"/>
++ <arg file="${src}/org/hsqldb/rowio/RowInputTextLog.java"/>
++ <arg file="${src}/org/hsqldb/lib/SimpleLog.java"/>
++ <arg file="${src}/org/hsqldb/rowio/RowInputTextLog.java"/>
++ <arg file="${src}/org/hsqldb/HsqlDateTime.java"/>
++ <arg value="+JAVA2"/>
++ <arg value="+JAVA2FULL"/>
++ <arg value="+JAVA4"/>
++ <arg value="+JAVA6"/>
++ <arg value="-JAVA7"/>
++ </java>
++ </target>
++
++ <target name="switchtojdk17" depends="switchtojdk16"
++ description="self explanatory" if="ant.java.iscjava17">
++ <java classname="org.hsqldb.util.CodeSwitcher" classpath="classes" >
++ <arg file="${src}/org/hsqldb/lib/java/JavaSystem.java"/>
++ <arg file="${src}/org/hsqldb/lib/HsqlTimer.java"/>
++ <arg file="${src}/org/hsqldb/jdbcDriver.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcBlob.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDatabaseMetaData.java"/>
+ <arg file="${src}/org/hsqldb/jdbc/jdbcDataSource.java"/>
+@@ -279,10 +329,11 @@ examples:
+ <arg value="+JAVA2FULL"/>
+ <arg value="+JAVA4"/>
+ <arg value="+JAVA6"/>
++ <arg value="+JAVA7"/>
+ </java>
+ </target>
+
+- <target name="store" depends="switchtojdk16"
++ <target name="store" depends="switchtojdk17"
+ description="compiles the /store folder">
+ <javac srcdir="${src}"
+ destdir="classes"
+diff --git a/src/org/hsqldb/jdbc/jdbcCallableStatement.java b/src/org/hsqldb/jdbc/jdbcCallableStatement.java
+index 3779094..d2131ed 100644
+--- a/src/org/hsqldb/jdbc/jdbcCallableStatement.java
++++ b/src/org/hsqldb/jdbc/jdbcCallableStatement.java
+@@ -3106,7 +3106,6 @@ implements CallableStatement {
+
+ //#endif JAVA4
+ //#ifdef JAVA6
+-/*
+ public void setPoolable(boolean poolable) throws SQLException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+@@ -3376,7 +3375,20 @@ implements CallableStatement {
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+-*/
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public <T> T getObject(int ColumnIndex, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++
++//#endif JAVA7
+ }
+diff --git a/src/org/hsqldb/jdbc/jdbcConnection.java b/src/org/hsqldb/jdbc/jdbcConnection.java
+index 5d59464..0c7e08a 100644
+--- a/src/org/hsqldb/jdbc/jdbcConnection.java
++++ b/src/org/hsqldb/jdbc/jdbcConnection.java
+@@ -43,13 +43,17 @@ import java.sql.Connection;
+ import java.sql.DatabaseMetaData;
+
+ //#ifdef JAVA6
+-/*
+ import java.sql.NClob;
+ import java.sql.SQLClientInfoException;
+ import java.sql.SQLXML;
+-*/
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++import java.util.concurrent.Executor;
++
++//#endif JAVA7
++
+ import java.sql.PreparedStatement;
+ import java.sql.SQLException;
+ import java.sql.SQLWarning;
+@@ -2794,4 +2798,31 @@ public class jdbcConnection implements Connection {
+ */
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public int getNetworkTimeout() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void setNetworkTimeout(Executor executor, int millis) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void abort(Executor executor) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public String getSchema() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void setSchema(String schema) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++//#endif JAVA7
+ }
+diff --git a/src/org/hsqldb/jdbc/jdbcDataSource.java b/src/org/hsqldb/jdbc/jdbcDataSource.java
+index 9f79a37..d0ab49b 100644
+--- a/src/org/hsqldb/jdbc/jdbcDataSource.java
++++ b/src/org/hsqldb/jdbc/jdbcDataSource.java
+@@ -47,6 +47,11 @@ import javax.sql.DataSource;
+ //#endif JAVA4
+ import org.hsqldb.jdbcDriver;
+
++//#ifdef JAVA7
++import java.sql.SQLFeatureNotSupportedException;
++import java.util.logging.Logger;
++//#endif JAVA7
++
+ // boucherb@users 20040411 - doc 1.7.2 - javadoc updates toward 1.7.2 final
+
+ /**
+@@ -312,7 +317,6 @@ public class jdbcDataSource implements Serializable {
+ }
+
+ //#ifdef JAVA6
+-/*
+ public <T> T unwrap(Class<T> iface) throws SQLException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+@@ -322,7 +326,14 @@ public class jdbcDataSource implements Serializable {
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+-*/
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException
++ {
++ throw new SQLFeatureNotSupportedException("Not supported yet.");
++ }
++
++//#endif JAVA7
+ }
+diff --git a/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java b/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java
+index ffa238d..0480228 100644
+--- a/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java
++++ b/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java
+@@ -5650,7 +5650,6 @@ public class jdbcDatabaseMetaData implements DatabaseMetaData {
+ }
+
+ //#ifdef JAVA6
+-/*
+ public RowIdLifetime getRowIdLifetime() throws SQLException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+@@ -5694,7 +5693,23 @@ public class jdbcDatabaseMetaData implements DatabaseMetaData {
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+-*/
+
+ //#endif JAVA6
++
++
++//#ifdef JAVA7
++ public boolean generatedKeyAlwaysReturned() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public ResultSet getPseudoColumns(String catalog, String schemaPattern,
++ String tableNamePattern, String columnNamePattern) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++
++//#endif JAVA7
++
+ }
+diff --git a/src/org/hsqldb/jdbc/jdbcResultSet.java b/src/org/hsqldb/jdbc/jdbcResultSet.java
+index 2a6567e..81aecf3 100644
+--- a/src/org/hsqldb/jdbc/jdbcResultSet.java
++++ b/src/org/hsqldb/jdbc/jdbcResultSet.java
+@@ -5332,4 +5332,19 @@ public class jdbcResultSet implements ResultSet {
+ */
+
+ //#endif JAVA6
++
++//#ifdef JAVA7
++
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public <T> T getObject(int columnNum, Class<T> type) throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++//#endif JAVA7
++
+ }
+diff --git a/src/org/hsqldb/jdbc/jdbcStatement.java b/src/org/hsqldb/jdbc/jdbcStatement.java
+index f84f2e2..38bf8d0 100644
+--- a/src/org/hsqldb/jdbc/jdbcStatement.java
++++ b/src/org/hsqldb/jdbc/jdbcStatement.java
+@@ -1588,7 +1588,6 @@ public class jdbcStatement implements Statement {
+ }
+ }
+ //#ifdef JAVA6
+-/*
+ public void setPoolable(boolean poolable) throws SQLException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+@@ -1608,6 +1607,17 @@ public class jdbcStatement implements Statement {
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+-*/
+ //#endif JAVA6
++
++//#ifdef JAVA7
++ public boolean isCloseOnCompletion() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ public void closeOnCompletion() throws SQLException
++ {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++//#endif JAVA7
+ }
+diff --git a/src/org/hsqldb/jdbcDriver.java b/src/org/hsqldb/jdbcDriver.java
+index a377b36..361c074 100644
+--- a/src/org/hsqldb/jdbcDriver.java
++++ b/src/org/hsqldb/jdbcDriver.java
+@@ -42,6 +42,11 @@ import org.hsqldb.jdbc.jdbcConnection;
+ import org.hsqldb.persist.HsqlDatabaseProperties;
+ import org.hsqldb.persist.HsqlProperties;
+
++//#ifdef JAVA7
++import java.sql.SQLFeatureNotSupportedException;
++import java.util.logging.Logger;
++//#endif JAVA7
++
+ // fredt@users 20011220 - patch 1.7.0 by fredt
+ // new version numbering scheme
+ // fredt@users 20020320 - patch 1.7.0 - JDBC 2 support and error trapping
+@@ -321,4 +326,12 @@ public class jdbcDriver implements Driver {
+ DriverManager.registerDriver(new jdbcDriver());
+ } catch (Exception e) {}
+ }
++
++//#ifdef JAVA7
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException
++ {
++ throw new SQLFeatureNotSupportedException("Not supported yet.");
++ }
++
++//#endif JAVA7
+ }
diff --git a/dev-db/hsqldb/hsqldb-1.8.1.3-r1.ebuild b/dev-db/hsqldb/hsqldb-1.8.1.3-r1.ebuild
new file mode 100644
index 000000000000..49c5cc013df9
--- /dev/null
+++ b/dev-db/hsqldb/hsqldb-1.8.1.3-r1.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/hsqldb/hsqldb-1.8.1.3-r1.ebuild,v 1.1 2012/12/23 15:12:57 sera Exp $
+
+EAPI=5
+
+JAVA_PKG_IUSE="doc source test"
+
+inherit eutils user versionator java-pkg-2 java-ant-2
+
+MY_PV=$(replace_all_version_separators _ )
+MY_P="${PN}_${MY_PV}"
+
+DESCRIPTION="The leading SQL relational database engine written in Java."
+HOMEPAGE="http://hsqldb.org"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~x86 ~x86-fbsd ~x64-macos ~x64-solaris ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+CDEPEND="
+ java-virtuals/servlet-api:2.5"
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.5"
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.5
+ app-arch/unzip
+ test? ( dev-java/junit:0 )"
+
+S="${WORKDIR}/${PN}"
+
+HSQLDB_JAR=/usr/share/hsqldb/lib/hsqldb.jar
+HSQLDB_HOME=/var/lib/hsqldb
+
+pkg_setup() {
+ enewgroup hsqldb
+ enewuser hsqldb -1 /bin/sh /dev/null hsqldb
+
+ java-pkg-2_pkg_setup
+}
+
+java_prepare() {
+ rm -v lib/*.jar || die
+
+ sed -i -r \
+ -e "s#/etc/sysconfig#${EPREFIX}/etc/conf.d#g" \
+ bin/hsqldb || die
+
+ java-pkg_filter-compiler jikes
+
+ eant -q -f "${EANT_BUILD_XML}" cleanall > /dev/null
+
+ epatch "${FILESDIR}/resolve-config-softlinks.patch"
+ epatch "${FILESDIR}/${P}-java7.patch"
+
+ mkdir conf
+ sed -e "s/^HSQLDB_JAR_PATH=.*$/HSQLDB_JAR_PATH=${EPREFIX//\//\\/}${HSQLDB_JAR//\//\\/}/g" \
+ -e "s/^SERVER_HOME=.*$/SERVER_HOME=${EPREFIX//\//\\/}\/var\/lib\/hsqldb/g" \
+ -e "s/^HSQLDB_OWNER=.*$/HSQLDB_OWNER=hsqldb/g" \
+ -e 's/^#AUTH_FILE=.*$/AUTH_FILE=${SERVER_HOME}\/sqltool.rc/g' \
+ src/org/hsqldb/sample/sample-hsqldb.cfg > conf/hsqldb || die
+ cp "${FILESDIR}/server.properties" conf/ || die
+ cp "${FILESDIR}/sqltool.rc" conf/ || die
+
+ # Missing source file - needed for tests
+ # http://hsqldb.cvs.sourceforge.net/*checkout*/hsqldb/hsqldb-dev/src/org/hsqldb/lib/StringComparator.java?revision=1.1&pathrev=hsqldb_1_8_0_10
+ # http://sourceforge.net/tracker/index.php?func=detail&aid=2008754&group_id=23316&atid=378131
+ cp "${FILESDIR}/StringComparator.java" src/org/hsqldb/lib || die
+ cp "${FILESDIR}/TestBug1191815.java" src/org/hsqldb/test/ || die
+}
+
+JAVA_ANT_REWRITE_CLASSPATH="yes"
+
+# EANT_BUILD_XML used also in src_prepare
+EANT_BUILD_XML="build/build.xml"
+EANT_BUILD_TARGET="jar jarclient jarsqltool jarutil"
+EANT_DOC_TARGET="javadocdev"
+EANT_GENTOO_CLASSPATH="servlet-api-2.5"
+
+src_test() {
+ java-pkg_jar-from --into lib junit
+ eant -f ${EANT_BUILD_XML} jartest
+ cd testrun/hsqldb || die
+ ./runTest.sh TestSelf || die "TestSelf hsqldb tests failed"
+ # TODO. These fail. Investigate why.
+ #cd "${S}/testrun/sqltool" || die
+ #CLASSPATH="${S}/lib/hsqldb.jar" ./runtests.bash || die "sqltool test failed"
+}
+
+src_install() {
+ java-pkg_dojar lib/hsql*.jar
+
+ if use doc; then
+ dodoc doc/*.txt
+ dohtml -r doc/zaurus
+ dohtml -r doc/src
+ fi
+ use source && java-pkg_dosrc src/*
+
+ echo "CONFIG_PROTECT=\"${HSQLDB_HOME}\"" > "${T}"/35hsqldb || die
+ doenvd "${T}"/35hsqldb
+
+ # Put init, configuration and authorization files in /etc
+ doinitd "${FILESDIR}/hsqldb"
+ doconfd conf/hsqldb
+ dodir /etc/hsqldb
+ insinto /etc/hsqldb
+ # Change the ownership of server.properties and sqltool.rc
+ # files to hsqldb:hsqldb. (resolves Bug #111963)
+ use prefix || insopts -m0600 -o hsqldb -g hsqldb
+ doins conf/server.properties
+ use prefix || insopts -m0600 -o hsqldb -g hsqldb
+ doins conf/sqltool.rc
+
+ # Install init script
+ dodir "${HSQLDB_HOME}/bin"
+ keepdir "${HSQLDB_HOME}"
+ exeinto "${HSQLDB_HOME}/bin"
+ doexe bin/hsqldb
+
+ # Make sure that files have correct permissions
+ use prefix || chown -R hsqldb:hsqldb "${ED}${HSQLDB_HOME}"
+ chmod o-rwx "${ED}${HSQLDB_HOME}"
+
+ # Create symlinks to authorization files in the server home dir
+ # (required by the hqldb init script)
+ insinto "${HSQLDB_HOME}"
+ dosym /etc/hsqldb/server.properties "${HSQLDB_HOME}/server.properties"
+ dosym /etc/hsqldb/sqltool.rc "${HSQLDB_HOME}/sqltool.rc"
+}
+
+pkg_postinst() {
+ ewarn "If you intend to run Hsqldb in Server mode and you want to create"
+ ewarn "additional databases, remember to put correct information in both"
+ ewarn "'server.properties' and 'sqltool.rc' files."
+ ewarn "(read the 'Init script Setup Procedure' section of the 'Chapter 3."
+ ewarn "UNIX Quick Start' in the Hsqldb docs for more information)"
+ echo
+ elog "Example:"
+ echo
+ elog "${EPREFIX}/etc/hsqldb/server.properties"
+ elog "============================="
+ elog "server.database.1=file:xdb/xdb"
+ elog "server.dbname.1=xdb"
+ elog "server.urlid.1=xdb"
+ elog
+ elog "${EPREFIX}/etc/hsqldb/sqltool.rc"
+ elog "======================"
+ elog "urlid xdb"
+ elog "url jdbc:hsqldb:hsql://localhost/xdb"
+ elog "username sa"
+ elog "password "
+ echo
+ elog "Also note that each hsqldb server can serve only up to 10"
+ elog "different databases simultaneously (with consecutive {0-9}"
+ elog "suffixes in the 'server.properties' file)."
+ echo
+ ewarn "For data manipulation use:"
+ ewarn
+ ewarn "# java -classpath ${EPREFIX}${HSQLDB_JAR} org.hsqldb.util.DatabaseManager"
+ ewarn "# java -classpath ${EPREFIX}${HSQLDB_JAR} org.hsqldb.util.DatabaseManagerSwing"
+ ewarn "# java -classpath ${EPREFIX}${HSQLDB_JAR} org.hsqldb.util.SqlTool \\"
+ ewarn " --rcFile ${EPREFIX}/var/lib/hsqldb/sqltool.rc <dbname>"
+ echo
+ elog "The Hsqldb can be run in multiple modes - read 'Chapter 1. Running'"
+ elog "and Using Hsqldb' in the Hsqldb docs at:"
+ elog " http://hsqldb.org/web/hsqlDocsFrame.html"
+ elog "If you intend to run it in the Server mode, it is suggested to add the"
+ elog "init script to your start-up scripts, this should be done like this:"
+ elog " \`rc-update add hsqldb default\`"
+ echo
+}