ChangeLog

# ChangeLog for dev-db/hsqldb
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/hsqldb/ChangeLog,v 1.46 2008/07/04 19:57:16 betelgeuse Exp $

*hsqldb-1.8.0.10 (04 Jul 2008)

04 Jul 2008; Petteri Räty
+files/StringComparator.java, +hsqldb-1.8.0.10.ebuild:
Version bump. Fixes bug #228697.

30 May 2008; Petteri Räty
hsqldb-1.8.0.9-r1.ebuild:
Add unzip to DEPEND. Fixes bug #224151.

30 May 2008; Petteri Räty -hsqldb-1.8.0.9.ebuild:
Remove old revision.

02 May 2008; Christian Faulhammer
hsqldb-1.8.0.9-r1.ebuild:
stable x86, bug 219636

30 Apr 2008; Brent Baude hsqldb-1.8.0.9-r1.ebuild:
stable ppc64, bug 219636

29 Apr 2008; Brent Baude hsqldb-1.8.0.9-r1.ebuild:
stable ppc, bug 219636

29 Apr 2008; Kenneth Prugh hsqldb-1.8.0.9-r1.ebuild:
amd64 stable, bug #219636

05 Mar 2008; Petteri Räty
hsqldb-1.8.0.9-r1.ebuild:
Add src_test.

15 Feb 2008; William L. Thomson Jr.
hsqldb-1.8.0.9-r1.ebuild:
Switched from einfo -> elog

*hsqldb-1.8.0.9-r1 (14 Feb 2008)

14 Feb 2008; William L. Thomson Jr.
+hsqldb-1.8.0.9-r1.ebuild:
Switched to java-virtuals/servlet-api, set EAPI=1 and switched to slot deps

30 Dec 2007; Tom Gall hsqldb-1.8.0.9.ebuild:
stable on ppc64; bug 201799

26 Dec 2007; Peter Weller hsqldb-1.8.0.9.ebuild:
Stable on amd64; bug 201799

21 Dec 2007; Tobias Scherbaum
hsqldb-1.8.0.9.ebuild:
ppc stable, bug #201799

21 Dec 2007; Christian Faulhammer
hsqldb-1.8.0.9.ebuild:
filter jikes

20 Dec 2007; Markus Meier hsqldb-1.8.0.9.ebuild:
x86 stable, security bug #201799

19 Dec 2007; Vlastimil Babka hsqldb-1.8.0.9.ebuild:
Add forgotten ~x86-fbsd.

*hsqldb-1.8.0.9 (19 Dec 2007)

19 Dec 2007; Vlastimil Babka +files/35hsqldb,
+files/bundle-all-tools.patch, files/hsqldb,
+files/resolve-config-softlinks.patch, +files/server.properties,
+files/sqltool.rc, +hsqldb-1.8.0.9.ebuild:
Version bump, security bug #201799.

24 Oct 2007; William L. Thomson Jr.
-files/server.properties, -files/sqltool.rc, -hsqldb-1.7.3.1-r1.ebuild,
hsqldb-1.7.3.1-r3.ebuild:
Removed java gen 1 ebuild, quoted vars

28 Sep 2007; Wulf C. Krueger
hsqldb-1.7.3.1-r3.ebuild:
Marked stable on amd64 as per bug 185117.

16 Jul 2007; Markus Rothe hsqldb-1.7.3.1-r3.ebuild:
Stable on ppc64; bug #185117

16 Jul 2007; nixnut hsqldb-1.7.3.1-r3.ebuild:
Stable on ppc wrt bug 185117

16 Jul 2007; Christian Faulhammer
hsqldb-1.7.3.1-r3.ebuild:
stable x86, bug 185117

12 Jul 2007; Petteri Räty
hsqldb-1.7.3.1-r3.ebuild:
Prefer virtual/jdk:1.5 over 1.4 and use JAVA_PKG_IUSE.

13 Mar 2007; Petteri Räty
-hsqldb-1.7.3.1-r2.ebuild:
Cleanup.

09 Jan 2007; Vlastimil Babka hsqldb-1.7.3.1-r2.ebuild,
hsqldb-1.7.3.1-r3.ebuild:
Convert einfo to elog.

23 Dec 2006; Timothy Redaelli
hsqldb-1.7.3.1-r3.ebuild:
Applied patch for fbsd wrt bug #157974 (authorized by Caster).
Add ~x86-fbsd keyword.

26 Nov 2006; Petteri Räty
hsqldb-1.7.3.1-r3.ebuild:
Fixed to compile with system VM set to something else than dev-java/sun-jdk.

06 Oct 2006; Gustavo Zacarias
hsqldb-1.7.3.1-r3.ebuild:
Drop sparc for real

05 Oct 2006; Gustavo Zacarias
hsqldb-1.7.3.1-r1.ebuild, hsqldb-1.7.3.1-r2.ebuild:
Dropping sparc keywords, see #96229

14 Sep 2006; Joshua Nichols hsqldb-1.7.3.1-r1.ebuild,
hsqldb-1.7.3.1-r2.ebuild:
Added calls to java-pkg_pkg_setup, see bug #142708.

22 Jul 2006; Krzysiek Pawlik
hsqldb-1.7.3.1-r3.ebuild:
ant_src_unpack -> src_unpack

*hsqldb-1.7.3.1-r3 (01 Jul 2006)

01 Jul 2006; Joshua Nichols +hsqldb-1.7.3.1-r3.ebuild:
Revision bump to support new Java system. Also addresses bug #137332

*hsqldb-1.7.3.1-r2 (27 Dec 2005)

27 Dec 2005; Joshua Nichols
+files/server.properties-r1, +files/sqltool.rc-r1,
+hsqldb-1.7.3.1-r2.ebuild:
Addresses bug #111963. Fix contributed by Sir No . Also
some cleanup.

10 Jul 2005; Thomas Matthijs hsqldb-1.7.3.1-r1.ebuild:
dep fix, cleanup

*hsqldb-1.7.3.1-r1 (04 Jun 2005)

04 Jun 2005; Jan Brinkmann -hsqldb-1.7.3.1.ebuild,
+hsqldb-1.7.3.1-r1.ebuild:
Updated reference to servletapi-2.3, we dont install a versioned servletapi
jar any longer.

18 May 2005; Markus Rothe hsqldb-1.7.3.1.ebuild:
Stable on ppc64

06 May 2005; Gustavo Zacarias hsqldb-1.7.3.1.ebuild:
Stable on sparc

04 May 2005; Jan Brinkmann -hsqldb-1.7.2.4.ebuild,
hsqldb-1.7.3.1.ebuild:
stable on amd64, x86 and ppc

23 Mar 2005; Gustavo Zacarias hsqldb-1.7.3.1.ebuild:
Keyworded ~sparc wrt #84992

13 Mar 2005; Markus Rothe hsqldb-1.7.3.1.ebuild:
Added ~ppc64 to KEYWORDS

20 Jan 2005; Jan Brinkmann hsqldb-1.7.2.4.ebuild,
hsqldb-1.7.3.1.ebuild:
added missing jikes dependency.

*hsqldb-1.7.3.1 (19 Jan 2005)

19 Jan 2005; Jan Brinkmann +hsqldb-1.7.3.1.ebuild:
new upstream version. fixes bug #78640

18 Jan 2005; Jan Brinkmann hsqldb-1.7.2.4.ebuild:
minor dependency issue and a typo in pkg_postinst removed. fixes bug #78414.

*hsqldb-1.7.2.4 (03 Nov 2004)

03 Nov 2004; Thomas Matthijs hsqldb-1.7.2.4.ebuild:
depend on app-arch/unzip

*hsqldb-1.7.2 (30 Oct 2004)

30 Oct 2004; Thomas Matthijs +metadata.xml,
+hsqldb-1.7.2.ebuild:
inital import, ebuild contributed by Dan
Also alot of thanks too Hendrik Sticher for his
contribution

Manifest

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

AUX 35hsqldb 33 RMD160 7f6db20183f2a6ebfe3054f8c3572b7417a4b5e3 SHA1 2f9b09ee3443889c2f1703f57c6ff80b4760aa69 SHA256 bd41e5568084a4856f102863b82f8103b0c9e1ad38423217f75e21d6842e447c
AUX StringComparator.java 1986 RMD160 c35a39b06d0c1f61e5e3a7f960f6680891d5190b SHA1 360f6e2012436bd871fa2f7e6859564e393f9294 SHA256 9f672518cd27d2da5fb9e0a0f7ffe56a872186cdf188cb5840598ed88b959b95
AUX bundle-all-tools.patch 873 RMD160 e13225f63d202fda9d3e54b5141b92f88c2c0b99 SHA1 72a5539601cc09d385ec2e867afe9ad38db2eaa8 SHA256 9ed2f92a998045430b8685c846ebfaeb32898828f45255df7a8e09ffab267468
AUX hsqldb 464 RMD160 9f491a89bc013085205ddcac0cdcc85b26abe431 SHA1 a947e19e7379da582f4193cb6fbdddc884e52333 SHA256 773d18c752b8392fb1b1677789934ea7a531f8cc0276c18917e21c71b717a3a9
AUX resolve-config-softlinks.patch 846 RMD160 93d6f30829e446f1b5f4fde6f61ab1efdeebd928 SHA1 f1843f12ce59bf866757eff7b385ef1565dea0f2 SHA256 a7de5886aed87fa040e65d265d5418daee38376ba23742fb97119b629b678517
AUX server.properties 686 RMD160 c48bc303a028bca284273b969ca01d3dadb20dcd SHA1 bd7a3cd95e451c6bf11b28609819450cf396221c SHA256 be7c54fc356d2b14c26e8ec0eecb79c7fa1c72e84c3475bedcd4d08548beeabd
AUX server.properties-r1 686 RMD160 c48bc303a028bca284273b969ca01d3dadb20dcd SHA1 bd7a3cd95e451c6bf11b28609819450cf396221c SHA256 be7c54fc356d2b14c26e8ec0eecb79c7fa1c72e84c3475bedcd4d08548beeabd
AUX sqltool.rc 619 RMD160 095cf1293ef4d40eed83df5f3025202c5a57f493 SHA1 8a98d518192c09401d077120f5217a8706a8fc53 SHA256 76ab1af1b6359c070c00a0d7499d7f628c94cc6c7b7d6bb8fe196ccfe080d637
AUX sqltool.rc-r1 619 RMD160 095cf1293ef4d40eed83df5f3025202c5a57f493 SHA1 8a98d518192c09401d077120f5217a8706a8fc53 SHA256 76ab1af1b6359c070c00a0d7499d7f628c94cc6c7b7d6bb8fe196ccfe080d637
DIST hsqldb_1_7_3_1.zip 2841759 RMD160 48c5e6e6673217caa67a6bc76775d5e676017051 SHA1 3e75e67e04c15706997e6b19040bd0c34aeea310 SHA256 491a40eb8d01afde4a8d86444dc058d905f15f7c59bbacaf62c5e2967884f676
DIST hsqldb_1_8_0_10.zip 3519470 RMD160 8b25da02fbc2702a43cc88b0af8eaeb41c0f75a0 SHA1 7168b0f40aa5c72267899601c116d2348d2f56ec SHA256 d30b13f4ba2e3b6a2d4f020c0dee0a9fb9fc6fbcc2d561f36b78da4bf3802370
DIST hsqldb_1_8_0_9.zip 3493449 RMD160 202b3dce4b737f928e57e281f4035df378526ce1 SHA1 fab82a70adedaeb427f8115736bd2c8bb6358556 SHA256 e98d1d8bca15059f4ef4f0d3dde2d75778a5e1bbe8bc12abd4ec2cac39d5adec
EBUILD hsqldb-1.7.3.1-r3.ebuild 3621 RMD160 bbe349a6dc800bada1fd7922d05ab100ed2f9bc2 SHA1 d860336d1e05565fd30a30be2c6a5065d7bca058 SHA256 2eaa77aff2476a4fdbfb858f539b80b03161da39f25c03d4d3aa07b0246e6a2d
EBUILD hsqldb-1.8.0.10.ebuild 5891 RMD160 05d570b15dfe91a12f4a52a437cfb1e1a5d83a3d SHA1 b0d5b95d9b1400d7a20d981950572b9779637922 SHA256 2b019fbd15e957365f78f95d48aa61061f41551789334eb2992396554e5c5d94
EBUILD hsqldb-1.8.0.9-r1.ebuild 5487 RMD160 69d897e69d736afc6205bda7b41d9b32faab2e4c SHA1 a057625012dbe2a41dc67f4aa4ab23d73f3d2b6c SHA256 2046910f4016a66e57c99feb5060a312d02b029840c9fdaee542cebfdca15a6e
MISC ChangeLog 6360 RMD160 dbde607eeff47a10096f8c18b15bf4815c29a486 SHA1 b26f4a8ee4aa2718726fb248e2dffd2de8c47e71 SHA256 7ec524dd9a8c2e8230f53ba46038059a3c1ca1241dfc4cf8b612e1baf57a70f6
MISC metadata.xml 158 RMD160 493079b5fb71d66863beea1b023901c90ba81be5 SHA1 77cd509a8b3c377b9a24480b48a5d5481b7874f1 SHA256 ea882ceccfd160b16cf7e79de423bdcc12b3fa000f124491a6df36f5783894fb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkhugKUACgkQcxLzpIGCsLQoFQCeK06OltEAJz/myA/J48kv+Cso
uNwAn0zzsw/bUFQnCUAPuHsTizjvzsp+
=uoCi
-----END PGP SIGNATURE-----

files

hsqldb-1.7.3.1-r3.ebuild

# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/hsqldb/hsqldb-1.7.3.1-r3.ebuild,v 1.12 2007/10/24 03:23:03 wltjr Exp $

JAVA_PKG_IUSE="doc source"

inherit java-pkg-2 eutils versionator 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.sourceforge.net"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip"

LICENSE="as-is"
SLOT="0"
KEYWORDS="amd64 ppc ppc64 x86 ~x86-fbsd"

CDEP="=dev-java/servletapi-2.3*"

# doesn't like Java 1.6 due to JDBC changes
RDEPEND=">=virtual/jre-1.4
${CDEP}"
DEPEND="
|| ( =virtual/jdk-1.5* =virtual/jdk-1.4* )
app-arch/unzip
${CDEP}"

S="${WORKDIR}/${PN}"

pkg_setup() {
enewgroup hsqldb
enewuser hsqldb -1 /bin/sh /dev/null hsqldb

java-pkg-2_pkg_setup
}

src_unpack() {
unpack ${A}
cd "${S}"/lib
rm *.jar
java-pkg_jar-from servletapi-2.3
cd "${S}"
sed -i \
-e "s:/etc/sysconfig:/etc/conf.d:" \
-e "s:/usr/local/etc/hsqldb.cfg:/etc/conf.d/hsqldb:" \
bin/hsqldb

ant -q -f build/build.xml cleanall || die "failed to clean"

mkdir conf
local HSQLDB_JAR=/usr/share/hsqldb/lib/hsqldb.jar
sed -e 's:^JAVA_EXECUTABLE=.*$:JAVA_EXECUTABLE=$(java-config --java):g' \
-e "s/^HSQLDB_JAR_PATH=.*$/HSQLDB_JAR_PATH=${HSQLDB_JAR//\//\\/}/g" \
-e "s/^SERVER_HOME=.*$/SERVER_HOME=\/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
cp "${FILESDIR}"/server.properties-r1 conf/server.properties
cp "${FILESDIR}"/sqltool.rc-r1 conf/sqltool.rc
}

src_compile() {
eant -f build/build.xml jar jarclient jarsqltool $(use_doc javadocdev)
}

src_install() {
java-pkg_dojar lib/hsql*.jar

if use doc; then
dodoc doc/*.txt
java-pkg_dohtml -r doc/guide
java-pkg_dohtml -r doc/src
fi
use source && java-pkg_dosrc src/*

doinitd "${FILESDIR}"/hsqldb
doconfd conf/hsqldb
insinto /etc/hsqldb
# Change the ownership of server.properties and sqltool.rc
# files to hsqldb:hsqldb. (resolves Bug #111963)
insopts -m 0600 -o hsqldb -g hsqldb
doins conf/server.properties
insopts -m 0600 -o hsqldb -g hsqldb
doins conf/sqltool.rc

dodir /var/lib/hsqldb/bin
keepdir /var/lib/hsqldb
exeinto /var/lib/hsqldb/bin
doexe bin/hsqldb
dosym /etc/hsqldb/server.properties /var/lib/hsqldb/server.properties
dosym /etc/hsqldb/sqltool.rc /var/lib/hsqldb/sqltool.rc
chown -R hsqldb:hsqldb "${D}"/var/lib/hsqldb
chmod o-rwx "${D}"/var/lib/hsqldb
}

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)"
elog ""
elog "Example:"
elog ""
elog "/etc/hsqldb/server.properties"
elog "============================="
elog "server.database.1=file:/var/lib/hsqldb/newdb/newdb"
elog "server.dbname.1=newdb"
elog "server.urlid.1=newdb"
elog ""
elog "/etc/hsqldb/sqltool.rc"
elog "======================"
elog "urlid newdb"
elog "url jdbc:hsqldb:hsql://localhost/newdb"
elog "username sa"
elog "password "
ewarn ""
ewarn "Also note that each hsqldb server can serve only up to 10"
ewarn "different databases simultaneously (with consecutive {0-9}"
ewarn "suffixes in the 'server.properties' file)."
}

hsqldb-1.8.0.10.ebuild

# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/hsqldb/hsqldb-1.8.0.10.ebuild,v 1.1 2008/07/04 19:57:16 betelgeuse Exp $

EAPI=1
JAVA_PKG_IUSE="doc source test"
inherit eutils 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"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
IUSE="java6"

CDEPEND="java-virtuals/servlet-api:2.3"
RDEPEND="java6? ( >=virtual/jre-1.6 )
!java6? ( >=virtual/jre-1.4 )
${CDEPEND}"
DEPEND="java6? ( >=virtual/jdk-1.6 )
!java6? ( || ( =virtual/jdk-1.5* =virtual/jdk-1.4* ) )
test? ( dev-java/junit:0 )
app-arch/unzip
${CDEPEND}"

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
}

src_unpack() {
unpack ${A}
cd "${S}"

rm -v lib/*.jar || die
java-pkg_jar-from --virtual --into lib servlet-api-2.3

sed -i -r \
-e "s#etc/sysconfig#etc/conf.d#g" \
bin/hsqldb || die

eant -q -f "${EANT_BUILD_XML}" cleanall > /dev/null

epatch "${FILESDIR}/resolve-config-softlinks.patch"
java-pkg_filter-compiler jikes

mkdir conf
sed -e "s/^HSQLDB_JAR_PATH=.*$/HSQLDB_JAR_PATH=${HSQLDB_JAR//\//\\/}/g" \
-e "s/^SERVER_HOME=.*$/SERVER_HOME=\/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
}

# EANT_BUILD_XML used also in src_unpack
EANT_BUILD_XML="build/build.xml"
EANT_BUILD_TARGET="jar jarclient jarsqltool jarutil"
EANT_DOC_TARGET="javadocdev"

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
java-pkg_dohtml -r doc/guide
java-pkg_dohtml -r doc/src
fi
use source && java-pkg_dosrc src/*

# Install env file for CONFIG_PROTECT support
doenvd "${FILESDIR}/35hsqldb" || die

# Put init, configuration and authorization files in /etc
doinitd "${FILESDIR}/hsqldb" || die
doconfd conf/hsqldb || die
dodir /etc/hsqldb
insinto /etc/hsqldb
# Change the ownership of server.properties and sqltool.rc
# files to hsqldb:hsqldb. (resolves Bug #111963)
insopts -m0600 -o hsqldb -g hsqldb
doins conf/server.properties || die
insopts -m0600 -o hsqldb -g hsqldb
doins conf/sqltool.rc || die

# Install init script
dodir "${HSQLDB_HOME}/bin"
keepdir "${HSQLDB_HOME}"
exeinto "${HSQLDB_HOME}/bin"
doexe bin/hsqldb || die

# 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" || die
dosym /etc/hsqldb/sqltool.rc "${HSQLDB_HOME}/sqltool.rc" || die

# Make sure that files have correct permissions
chown -R hsqldb:hsqldb "${D}${HSQLDB_HOME}"
chmod o-rwx "${D}${HSQLDB_HOME}"
}

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 "/etc/hsqldb/server.properties"
elog "============================="
elog "server.database.1=file:xdb/xdb"
elog "server.dbname.1=xdb"
elog "server.urlid.1=xdb"
elog
elog "/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 ${HSQLDB_JAR} org.hsqldb.util.DatabaseManager"
ewarn "# java -classpath ${HSQLDB_JAR} org.hsqldb.util.DatabaseManagerSwing"
ewarn "# java -classpath ${HSQLDB_JAR} org.hsqldb.util.SqlTool \\"
ewarn " --rcFile /var/lib/hsqldb/sqltool.rc "
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

# Enable CONFIG_PROTECT for hsqldb
env-update
elog "Hsqldb stores its database files in ${HSQLDB_HOME} and this directory"
elog "is added to the CONFIG_PROTECT list. In order to immediately activate"
elog "these settings please do:"
elog " \`env-update && source /etc/profile\`"
elog "Otherwise the settings will become active next time you login"
echo
}

hsqldb-1.8.0.9-r1.ebuild

# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/hsqldb/hsqldb-1.8.0.9-r1.ebuild,v 1.8 2008/05/30 22:19:19 betelgeuse Exp $

EAPI=1
JAVA_PKG_IUSE="doc source test"
inherit eutils 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"
SLOT="0"
KEYWORDS="amd64 ppc ppc64 x86 ~x86-fbsd"
IUSE=""

# doesn't like Java 1.6 due to JDBC changes
CDEPEND="java-virtuals/servlet-api:2.3"
RDEPEND=">=virtual/jre-1.4
${CDEPEND}"
DEPEND="|| ( =virtual/jdk-1.5* =virtual/jdk-1.4* )
test? ( dev-java/junit:0 )
app-arch/unzip
${CDEPEND}"

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
}

src_unpack() {
unpack ${A}
cd "${S}"

rm -v lib/*.jar || die
java-pkg_jar-from --virtual --into lib servlet-api-2.3

sed -i -r \
-e "s#etc/sysconfig#etc/conf.d#g" \
bin/hsqldb || die

eant -q -f "${EANT_BUILD_XML}" cleanall > /dev/null

epatch "${FILESDIR}/resolve-config-softlinks.patch"
java-pkg_filter-compiler jikes

mkdir conf
sed -e "s/^HSQLDB_JAR_PATH=.*$/HSQLDB_JAR_PATH=${HSQLDB_JAR//\//\\/}/g" \
-e "s/^SERVER_HOME=.*$/SERVER_HOME=\/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
}

# EANT_BUILD_XML used also in src_unpack
EANT_BUILD_XML="build/build.xml"
EANT_BUILD_TARGET="jar jarclient jarsqltool jarutil"
EANT_DOC_TARGET="javadocdev"

src_test() {
java-pkg_jar-from --into lib junit
eant -f ${EANT_BUILD_XML} jartest
cd testrun/hsqldb || die
./runTest.sh TestSelf || die "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
java-pkg_dohtml -r doc/guide
java-pkg_dohtml -r doc/src
fi
use source && java-pkg_dosrc src/*

# Install env file for CONFIG_PROTECT support
doenvd "${FILESDIR}/35hsqldb" || die

# Put init, configuration and authorization files in /etc
doinitd "${FILESDIR}/hsqldb" || die
doconfd conf/hsqldb || die
dodir /etc/hsqldb
insinto /etc/hsqldb
# Change the ownership of server.properties and sqltool.rc
# files to hsqldb:hsqldb. (resolves Bug #111963)
insopts -m0600 -o hsqldb -g hsqldb
doins conf/server.properties || die
insopts -m0600 -o hsqldb -g hsqldb
doins conf/sqltool.rc || die

# Install init script
dodir "${HSQLDB_HOME}/bin"
keepdir "${HSQLDB_HOME}"
exeinto "${HSQLDB_HOME}/bin"
doexe bin/hsqldb || die

# 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" || die
dosym /etc/hsqldb/sqltool.rc "${HSQLDB_HOME}/sqltool.rc" || die

# Make sure that files have correct permissions
chown -R hsqldb:hsqldb "${D}${HSQLDB_HOME}"
chmod o-rwx "${D}${HSQLDB_HOME}"
}

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 "/etc/hsqldb/server.properties"
elog "============================="
elog "server.database.1=file:xdb/xdb"
elog "server.dbname.1=xdb"
elog "server.urlid.1=xdb"
elog
elog "/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 ${HSQLDB_JAR} org.hsqldb.util.DatabaseManager"
ewarn "# java -classpath ${HSQLDB_JAR} org.hsqldb.util.DatabaseManagerSwing"
ewarn "# java -classpath ${HSQLDB_JAR} org.hsqldb.util.SqlTool \\"
ewarn " --rcFile /var/lib/hsqldb/sqltool.rc "
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

# Enable CONFIG_PROTECT for hsqldb
env-update
elog "Hsqldb stores its database files in ${HSQLDB_HOME} and this directory"
elog "is added to the CONFIG_PROTECT list. In order to immediately activate"
elog "these settings please do:"
elog " \`env-update && source /etc/profile\`"
elog "Otherwise the settings will become active next time you login"
echo
}

metadata.xml




java