Package init

This commit is contained in:
lei_ju 2020-08-28 19:53:53 +08:00
parent 84a7341aa2
commit 67ae2f214d
14 changed files with 798 additions and 0 deletions

View File

@ -0,0 +1,33 @@
From 8d452f0a40d7f2d244bba0fff238d2be788e093f Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Thu, 30 Nov 2017 19:49:42 +0200
Subject: [PATCH 1/2] Fix javadoc build
---
build/build.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/build/build.xml b/build/build.xml
index a370a20..054db25 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -133,6 +133,7 @@ examples:
There is no performance penalty, since the javadoc task regenerates
everything each run.
-->
+ <mkdir dir="doc/apidocs"/>
<copy todir="doc/apidocs">
<!-- IMPORTANT:
Add a fixcrlf if we add non-binary files to doc-src/apidocs. -->
@@ -936,7 +937,7 @@ examples:
src/org/hsqldb/auth/LdapAuthBean.java,
src/org/hsqldb/auth/LdapAuthBeanTester.java"
destdir="doc/apidocs"
- stylesheetfile="doc-src/apidocs/javadoc.css"
+ additionalparam="-Xdoclint:none"
docencoding="UTF-8"
charset="UTF-8"
author="true"
--
2.14.3

View File

@ -0,0 +1,33 @@
From 4db4a99c17d5c058dbe8f33a3b4cc7f0cd5fb9b6 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Thu, 30 Nov 2017 19:53:15 +0200
Subject: [PATCH 2/2] Build cmdline classes
---
build/build.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/build/build.xml b/build/build.xml
index 054db25..2a70d2b 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -443,7 +443,7 @@ examples:
</target>
<!-- compiles the cmdline classes -->
- <target name="-cmdline" if="ant.java.iscjava15"
+ <target name="-cmdline"
depends="-prepare, -update-switch-branch,
-conditionalize-sqlfile-scanner, -sqlfile-scanner">
<javac srcdir="${swsrc}"
@@ -601,7 +601,6 @@ examples:
</manifest>
<exclude name="org/hsqldb/jmx/**"/>
<exclude name="org/hsqldb/util/**"/>
- <exclude name="org/hsqldb/cmdline/**"/>
<exclude name="org/hsqldb/test/**"/>
<exclude name="org/hsqldb/sample/**"/>
</jar>
--
2.14.3

35
hsqldb-2.4.0.pom Normal file
View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.4.0</version>
<name>HyperSQL Database</name>
<description>HSQLDB - Lightweight 100% Java SQL Database Engine</description>
<url>http://hsqldb.org</url>
<inceptionYear>2001</inceptionYear>
<organization>
<name>The HSQL Development Group</name>
<url>http://hsqldb.org</url>
</organization>
<licenses>
<license>
<name>HSQLDB License, a BSD open source license</name>
<url>http://hsqldb.org/web/hsqlLicense.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>unsaved</id>
<name>Blaine Simpson</name>
<email>blaine.simpson@admc.com</email>
</developer>
</developers>
<scm>
<connection>scm:svn:http://svn.code.sf.net/p/hsqldb/svn/base/</connection>
<tag>2.4.0</tag>
<url>http://sourceforge.net/p/hsqldb/svn/HEAD/tree/base/tags/2.4.0</url>
</scm>
</project>

BIN
hsqldb-2.4.0.zip Normal file

Binary file not shown.

76
hsqldb-post Normal file
View File

@ -0,0 +1,76 @@
#!/bin/sh
# This file was created with portions of the original SysV init script shipped
# with hsqldb
# Copyright (c) 2001-2004, The HSQL Development Group
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# Neither the name of the HSQL Development Group nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# $MAX_START_SECS from when the Server/WebServer is started.
MAX_START_SECS=60
# Class in the org.hsqldb package to start.
# At this time, only the values "Server" or "WebServer" will work.
TARGET_CLASS=Server
. /etc/sysconfig/hsqldb
# PROPERTY_FILE is a derived value.
case "$TARGET_CLASS" in
Server) PROPERTY_FILE="$SERVER_HOME"/server.properties;;
WebServer) PROPERTY_FILE="$SERVER_HOME"/webserver.properties;;
*)
echo 'Unsupported value for $TARGET_CLASS: '"$TARGET_CLASS" 1>&2
exit 2;;
esac
[ -f "$PROPERTY_FILE" ] || {
echo "'$PROPERTY_FILE' is missing" 1>&2
exit 2
}
[ -r "$PROPERTY_FILE" ] || {
echo "'$PROPERTY_FILE' isn't readable" 1>&2
exit 2
}
AUTH_FILE_SWITCH=
# N.b., there will be a problem if there are special characters or
# spaces inside of $AUTH_FILE.
[ -n "$AUTH_FILE" ] && AUTH_FILE_SWITCH="-Dsqltoolsprayer.rcfile=$AUTH_FILE"
# Might as well set CLASSPATH for a cleaner command.
CLASSPATH="$HSQLDB_JAR_PATH"
export CLASSPATH
sleep 1
"$JAVA_EXECUTABLE" $AUTH_FILE_SWITCH $CLIENT_JVMARGS \
"-Dsqltoolsprayer.propfile=$PROPERTY_FILE" \
"-Dsqltoolsprayer.maxtime=${MAX_START_SECS}000" \
org.hsqldb.cmdline.SqlToolSprayer '' db0-url

20
hsqldb-server.properties Normal file
View File

@ -0,0 +1,20 @@
# Hsqldb Server cfg file.
# See the Advanced Topics chapter of the Hsqldb User Guide.
server.database.0 file:data/db0
server.dbname.0 firstdb
server.silent true
server.trace false
server.port 9001
server.no_system_exit true
# Until the following setting is changed, the HSQLDB service will not accept
# remote connections. Failing to set a value for server.address at all will
# result in the service binding itself to 0.0.0.0 and accepting remote
# connections.
#
# IT IS STRONGLY ADVISED that before doing this you alter the password of
# the default account (username "sa"). By default, no password is required
# to connect to HSQLDB with the "sa" account.
server.address localhost

98
hsqldb-sqltool.rc Normal file
View File

@ -0,0 +1,98 @@
# $Id: hsqldb-1.73.0-standard-sqltool.rc,v 1.1 2004/12/23 22:21:08 fnasser Exp $
# This is a sample SqlTool configuration file, a.k.a. rc file.
# You can run SqlTool right now by copying this file to your home directory
# and running
# java -jar /path/to/hsqldb.jar mem
# This will access the first urlid definition below in order to use a
# personal Memory-Only database.
# If you have the least concerns about security, then secure access to
# your sqltool.rc file.
# See the documentation for SqlTool for various ways to use this file.
# A personal Memory-Only database.
urlid mem
url jdbc:hsqldb:mem:memdbid
username sa
password
# This is for a hsqldb Server running with default settings on your local
# computer (and for which you have not changed the password for "sa").
urlid db0-url
url jdbc:hsqldb:hsql://localhost/firstdb
username sa
password
###########################################################################
# Template for a urlid for an Oracle database.
# You will need to put the oracle.jdbc.OracleDriver class into your
# classpath.
# In the great majority of cases, you want to use the file classes12.zip
# (which you can get from the directory $ORACLE_HOME/jdbc/lib of any
# Oracle installation compatible with your server).
# Since you need to add to the classpath, you can't invoke SqlTool with
# the jar switch, like "java -jar .../hsqldb.jar..." or
# "java -jar .../hsqlsqltool.jar...".
# Put both the HSQLDB jar and classes12.zip in your classpath (and export!)
# and run something like "java org.hsqldb.util.SqlTool...".
#urlid cardiff2
#url jdbc:oracle:thin:@aegir.admc.com:1522:TRAFFIC_SID
#username blaine
#password secretpassword
#driver oracle.jdbc.OracleDriver
###########################################################################
###########################################################################
# Template for a urlid for a Postgresql database.
# You will need to put the org.postgresql.Driver class into your
# classpath.
# The postgresql jar will be named postgresql.jar (if you built Postgresql
# from source), or something like pg73b1jdbc3.jar or jdbc7.2x-1.2.jar.
# You can obtain it from a client or server Postgresql installation, or
# download it from http://jdbc.postgresql.org/download.html.
# Notice that the jar file names (other than "postgresql.jar") contain both
# the target Postgresql server version and the client-side JDBC level (which
# is determined by your client-side Java version, as explained at
# http://jdbc.postgresql.org/download.html).
# I recommend the latest production version for your JDBC version. The
# later JDBC drivers work better even with older Postgresql servers.
# (E.g. \dt won't list owners with an older driver).
# N.b.: Suse Linux 9.1 users should download a new driver from the PG site,
# since Suse distributes the 7.3 drivers with Postgresql 7.4 (why???).
# Since you need to add to the classpath, you can't invoke SqlTool with
# the jar switch, like "java -jar .../hsqldb.jar..." or
# "java -jar .../hsqlsqltool.jar...".
# Put both the HSQLDB jar and the Postgresql jar in your classpath (and
# export!) and run something like "java org.hsqldb.util.SqlTool...".
# N.b.: I notice that Postgresql is unusual in that it does not do an
# implicit commit before DDL commands. If you get an error message
# "... cannot run inside a transaction block", just run "commit;" and retry.
#urlid commerce
#url jdbc:postgresql://dbsvr2/commercedb
#username blaine
#password obscured
#driver org.postgresql.Driver
###########################################################################
###########################################################################
# Template for a TLS-encrypted HSQLDB Server.
# Remember that the hostname in hsqls (and https) JDBC URLs must match the
# CN of the server certificate (the port and instance alias that follows
# are not part of the certificate at all).
# You only need to set "truststore" if the server cert is not approved by
# your system default truststore (which a commercial certificate probably
# would be).
#urlid tls
#url jdbc:hsqldb:hsqls://db.admc.com:9001/lm2
#username blaine
#password asecret
#truststore /home/blaine/ca/db/db-trust.store
###########################################################################

84
hsqldb-stop Normal file
View File

@ -0,0 +1,84 @@
#!/bin/sh
# This file was created with portions of the original SysV init script shipped
# with hsqldb
# Copyright (c) 2001-2004, The HSQL Development Group
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# Neither the name of the HSQL Development Group nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Class in the org.hsqldb package to start.
# At this time, only the values "Server" or "WebServer" will work.
TARGET_CLASS=Server
MAX_TERMINATE_SECS=1
# To customize settings, edit this file:
. /etc/sysconfig/hsqldb
# PROPERTY_FILE is a derived value.
case "$TARGET_CLASS" in
Server) PROPERTY_FILE="$SERVER_HOME"/server.properties;;
WebServer) PROPERTY_FILE="$SERVER_HOME"/webserver.properties;;
*)
echo 'Unsupported value for $TARGET_CLASS: '"$TARGET_CLASS" 1>&2
exit 6;;
esac
[ -f "$PROPERTY_FILE" ] || {
echo "'$PROPERTY_FILE' is missing" 1>&2
exit 6
}
[ -r "$PROPERTY_FILE" ] || {
echo "'$PROPERTY_FILE' isn't readable" 1>&2
exit 6
}
[ -r "$HSQLDB_JAR_PATH" ] || {
echo "'$HSQLDB_JAR_PATH' isn't readable" 1>&2
exit 6
}
[ -x "$JAVA_EXECUTABLE" ] || {
echo "No Java executable found at '$JAVA_EXECUTABLE'" 1>&2
exit 6
}
AUTH_FILE_SWITCH=
# N.b., there will be a problem if there are special characters or
# spaces inside of $AUTH_FILE.
[ -n "$AUTH_FILE" ] &&
AUTH_FILE_SWITCH="-Dsqltoolsprayer.rcfile=$AUTH_FILE"
# Might as well set CLASSPATH for a cleaner command.
CLASSPATH="$HSQLDB_JAR_PATH"
export CLASSPATH
export PATH # Required only for some funny init environments.
"$JAVA_EXECUTABLE" $AUTH_FILE_SWITCH $CLIENT_JVMARGS \
"-Dsqltoolsprayer.propfile=$PROPERTY_FILE" \
org.hsqldb.cmdline.SqlToolSprayer '' \
db0-url $SHUTDOWN_URLIDS
sleep $MAX_TERMINATE_SECS # Give the JVM a sec. or 2 to fully exit.
echo "Successful shutdown ${SHUTDOWN_OPTION} (for the $TARGET_CLASS process)!"
exit 0

View File

@ -0,0 +1,12 @@
# Hsqldb Server cfg file.
# See the Advanced Topics chapter of the Hsqldb User Guide.
server.database.0 file:data/db0
server.dbname.0 firstdb
server.silent true
server.trace false
server.port 80
server.default_page index.html
server.root ./
.html=text/html

97
hsqldb-wrapper Normal file
View File

@ -0,0 +1,97 @@
#!/bin/sh
# This file was created with portions of the original SysV init script shipped
# with hsqldb
# Copyright (c) 2001-2004, The HSQL Development Group
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# Neither the name of the HSQL Development Group nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Class in the org.hsqldb package to start.
# At this time, only the values "Server" or "WebServer" will work.
TARGET_CLASS=Server
. /etc/sysconfig/hsqldb
# Suffix delimiter to $SERVER_ADDL_CLASSPATH, if it is set.
[ -n "$SERVER_ADDL_CLASSPATH" ] &&
SERVER_ADDL_CLASSPATH="${SERVER_ADDL_CLASSPATH}:"
# Validate that config file sets all required variables.
[ -n "$JAVA_EXECUTABLE" ] && [ -n "$HSQLDB_JAR_PATH" ] &&
[ -n "$SERVER_HOME" ] || {
echo "Config file '$CFGFILE' does not set one or more of following variables
JAVA_EXECUTABLE, HSQLDB_JAR_PATH, SERVER_HOME" 1>&2
exit 2
}
[ -d "$SERVER_HOME" ] || {
echo "SERVER_HOME variable in '$CFGFILE' is set to a non-directory." 1>&2
exit 2
}
[ -f "$JAVA_EXECUTABLE" ] && [ -f "$HSQLDB_JAR_PATH" ] || {
echo "JAVA_EXECUTABLE or HSQLDB_JAR_PATH in '$CFGFILE' is set to a non-file." 1>&2
exit 2
}
[ -r "$HSQLDB_JAR_PATH" ] || {
echo "'$HSQLDB_JAR_PATH' isn't readable" 1>&2
exit 2
}
[ -x "$JAVA_EXECUTABLE" ] || {
echo "No Java executable found at '$JAVA_EXECUTABLE'" 1>&2
exit 2
}
# Make a good effort (but not bullet-proof) check on permissions of the
# auth file. Unfortunately, if auth-file is not specified, this depends
# upon both (a) $HOME being set; and (b) SqlToolSprayer and SqlTool defaults.
# On the other hand, it works great if AUTH_FILE is set explicitly by user.
if [ -z "$AUTH_FILE" ] && [ -z "$HOME" ]; then
: # Lousy init environment didn't set $HOME, so can't find dflt cfg file.
else
_AUTH_TEST_PATH="$AUTH_FILE"
[ -n "${_AUTH_TEST_PATH}" ] || _AUTH_TEST_PATH="$HOME/sqltool.rc"
[ -f "$_AUTH_TEST_PATH" ] || {
echo "No auth file found at '$_AUTH_TEST_PATH'" 1>&2
exit 2
}
[ -r "$_AUTH_TEST_PATH" ] || {
echo "Auth file '$_AUTH_TEST_PATH' not readable" 1>&2
exit 2
}
ls -ld "$_AUTH_TEST_PATH" | grep '^-..------' > /dev/null 2>&1 || {
echo "Fix permissions on '$_AUTH_TEST_PATH' like 'chmod 600 $_AUTH_TEST_PATH'" 1>&2
exit 2
}
fi
TLS_SWITCHES=
[ -n "$TLS_KEYSTORE" ] &&
TLS_SWITCHES="-Djavax.net.ssl.keyStore=$TLS_KEYSTORE -Djavax.net.ssl.keyStorePassword=$TLS_PASSWORD"
cd "$SERVER_HOME" &&
exec "$JAVA_EXECUTABLE" $SERVER_JVMARGS $TLS_SWITCHES -classpath "${SERVER_ADDL_CLASSPATH}${HSQLDB_JAR_PATH}" org.hsqldb.util.MainInvoker org.hsqldb.$TARGET_CLASS $INVOC_ADDL_ARGS

129
hsqldb.cfg Normal file
View File

@ -0,0 +1,129 @@
# $Id: hsqldb-1.73.0-standard.cfg,v 1.1 2004/12/23 22:21:08 fnasser Exp $
# Sample configuration file for HSQLDB database server.
# See the "UNIX Quick Start" chapter of the Hsqldb User Guide.
# N.b.!!!! You must place this in the right location for your type of UNIX.
# See the init script "hsqldb" to see where this must be placed and
# what it should be renamed to.
# This file is "sourced" by a Bourne shell, so use Bourne shell syntax.
# This file WILL NOT WORK until you set (at least) the non-commented
# variables to the appropriate values for your system.
# Life will be easier if you avoid all filepaths with spaces or any other
# funny characters. Don't ask for support if you ignore this advice.
# Thanks to Meikel Bisping for his contributions. -- Blaine
# JPackage hsqldb home is /var/lib/hsqldb
HSQLDB_HOME=/var/lib/hsqldb
# JPackage source Java config
. /etc/java/java.conf
JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/jre}
JAVA_EXECUTABLE=${JAVA_HOME}/bin/java
# Unless you copied a hsqldb.jar file from another system, this typically
# resides at $HSQLDB_HOME/lib/hsqldb.jar, where $HSQLDB_HOME is your HSQLDB
# software base directory.
HSQLDB_JAR_PATH=${HSQLDB_HOME}/lib/hsqldb.jar
# Where the file "server.properties" (or "webserver.properties") resides.
SERVER_HOME=${HSQLDB_HOME}
# What UNIX user the Server/WebServer process will run as.
# (The shutdown client is always run as root or the invoker of the init script).
# Runs as root by default, but you should take the time to set database file
# ownerships to another user and set that user name here.
# You do need to run as root if your Server/WebServer will run on a privileged
# (< 1024) port.
# If you really do want to run as root, comment out the HSQLDB_OWNER setting
# completely. I.e., do not set it to root. This will run Server/Webserver
# without any "su" at all.
HSQLDB_OWNER=hsqldb
# We require all Server/WebServer instances to be accessible within
# $MAX_START_SECS from when the Server/WebServer is started.
# Defaults to 60.
# Raise this is you are running lots of DB instances or have a slow server.
#MAX_START_SECS=200
# Ditto for this one
#SU_ECHO_SECS=1
# Time to allow for JVM to die after all HSQLDB instances stopped.
# Defaults to 1.
#MAX_TERMINATE_SECS=0
# These are "urlid" values from a SqlTool authentication file
# ** IN ADDITION TO THOSE IN YOUR server.properties OR webserver.properties **
# file. All server.urlid.X values from your properties file will automatically
# be started/stopped/tested. $SHUTDOWN_URLIDS is for additional urlids which
# will stopped. (Therefore, most users will not set this at all).
# Separate multiple values with white space. NO OTHER SPECIAL CHARACTERS!
# Make sure to quote the entire value if it contains white space separator(s).
# Defaults to none (i.e., only urlids set in properties file will be stopped).
#SHUTDOWN_URLIDS='sa mygms'
# SqlTool authentication file used only for shutdown.
# The default value will be sqltool.rc in root's home directory, since it is
# root who runs the init script.
# (See the SqlTool chapter of the HSQLDB User Guide if you don't understand
# this).
AUTH_FILE=${HSQLDB_HOME}/sqltool.rc
# Set to 'WebServer' to start a HSQLDB WebServer instead of a Server.
# Defaults to 'Server'.
#TARGET_CLASS=WebServer
# Server-side classpath IN ADDITION TO the HSQLDB_JAR_PATH set above.
# The classpath here is *earlier* than HSQLDB_JAR_PATH, to allow you
# override classes in the HSQLDB_JAR_PATH jar file.
# In particular, you will want to add classpath elements to give access of
# all of your store procedures (store procedures are documented in the
# HSQLDB User Guide in the SQL Syntax chapter.
#
# N.B.!
# If you're adding files to the classpath in order to be able to call them
# from SQL queries, you will be unable to access them unless you adjust the
# value of the system property hsqldb.method_class_names. Please see the
# comments on SERVER_JVMARGS, at the end of this file.
# SERVER_ADDL_CLASSPATH=/home/blaine/storedprocs.jar:/usr/dev/dbutil/classes
# For TLS encryption for your Server, set these two variables.
# N.b.: If you set these, then make this file unreadable to non-root users!!!!
# See the TLS chapter of the HSQLDB User Guide, paying attention to the
# security warning(s).
# If you are running with a private server cert, then you will also need to
# set "truststore" in the your SqlTool config file (location is set by the
# AUTH_FILE variable in this file, or it must be at the default location for
# HSQLDB_OWNER).
#TLS_KEYSTORE=/path/to/jks/server.store
#TLS_PASSWORD=password
# Any JVM args for the invocation of the JDBC client used to verify DB
# instances and to shut them down (SqlToolSprayer).
# For multiple args, put quotes around entire value.
#CLIENT_JVMARGS=-Djavax.net.debug=ssl
# Any JVM args for the server.
# For multiple args, put quotes around entire value.
#
# N.B.!
# The default value of SERVER_JVMARGS sets the system property
# hsqldb.method_class_names to be empty. This is in order to lessen the
# security risk posed by HSQLDB allowing Java method calls in SQL statements.
# The implications of changing this value (as explained by the authors of
# HSQLDB) are as follows:
# If [it] is not set, then static methods of all available Java classes
# can be accessed as functions in HSQLDB. If the property is set, then
# only the list of semicolon seperated method names becomes accessible.
# An empty property value means no class is accessible.
# Regardless of the value of hsqldb.method_class_names, methods in
# org.hsqldb.Library will be accessible.
# Before making changes to the value below, please be advised of the possible
# dangers involved in allowing SQL queries to contain Java method calls.
SERVER_JVMARGS=-Dhsqldb.method_class_names=\"\"

163
hsqldb.spec Normal file
View File

@ -0,0 +1,163 @@
Name: hsqldb
Version: 2.4.0
Release: 1
Epoch: 1
Summary: HyperSQL Database Engine
License: BSD
URL: http://hsqldb.sourceforge.net/
Source0: http://downloads.sourceforge.net/hsqldb/hsqldb-%{version}.zip
Source1: %{name}.cfg
Source2: %{name}-server.properties
Source3: %{name}-webserver.properties
Source4: %{name}-sqltool.rc
Source5: http://www.hsqldb.org/repos/org/hsqldb/hsqldb/%{version}/hsqldb-%{version}.pom
Source6: %{name}.systemd
Source7: %{name}-wrapper
Source8: %{name}-post
Source9: %{name}-stop
Patch0: 0001-Fix-javadoc-build.patch
Patch1: 0002-Build-cmdline-classes.patch
BuildRequires: ant javapackages-local systemd-units glassfish-servlet-api
Requires: %{name}-lib = %{epoch}:%{version}-%{release} glassfish-servlet-api
Requires(pre): shadow-utils
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
BuildArch: noarch
%description
HSQLdb is a relational database engine written in JavaTM , with a JDBC
driver, supporting a subset of ANSI-92 SQL. It offers a small (about
100k), fast database engine which offers both in memory and disk based
tables. Embedded and server modes are available. Additionally, it
includes tools such as a minimal web server, in-memory query and
management tools (can be run as applets or servlets, too) and a number
of demonstration examples.
Downloaded code should be regarded as being of production quality. The
product is currently being used as a database and persistence engine in
many Open Source Software projects and even in commercial projects and
products! In it's current version it is extremely stable and reliable.
It is best known for its small size, ability to execute completely in
memory and its speed. Yet it is a completely functional relational
database management system that is completely free under the Modified
BSD License. Yes, that's right, completely free of cost or restrictions!
%package lib
Summary: HyperSQL Database Engine library
%description lib
Library part of %{name}.
%package manual
Summary: Manual for %{name}
%description manual
Documentation for %{name}.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
Javadoc for %{name}.
%package demo
Summary: Demo for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
%description demo
Demonstrations and samples for %{name}.
%prep
%setup -q -n %{name}-%{version}/%{name}
%patch0 -p1
%patch1 -p1
find . -name "*.sh" -exec chmod 755 \{\} \;
for dir in `find . -name _notes`; do rm -rf $dir; done
find . -name "*.jar" -exec rm -f {} \;
find . -name "*.class" -exec rm -f {} \;
find . -name "*.war" -exec rm -f {} \;
find . -name "*.zip" -exec rm -f {} \;
chmod -R go=u-w *
sed -i -e 's/doc-src/doc/g' build/build.xml
sed -i -e 's|doc/apidocs|%{_javadocdir}/%{name}|g' index.html
%build
pushd build
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
ant hsqldb javadoc -Dservletapi.lib=$(build-classpath glassfish-servlet-api)
popd
%install
%mvn_file :%{name} %{name}
%mvn_artifact %{SOURCE5} lib/%{name}.jar
%mvn_install -J doc/apidocs
install -d -m 755 %{buildroot}%{_unitdir}
install -d -m 755 %{buildroot}%{_prefix}/lib/%{name}
install -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}.service
install -m 755 %{SOURCE7} %{buildroot}%{_prefix}/lib/%{name}/%{name}-wrapper
install -m 755 %{SOURCE8} %{buildroot}%{_prefix}/lib/%{name}/%{name}-post
install -m 755 %{SOURCE9} %{buildroot}%{_prefix}/lib/%{name}/%{name}-stop
install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}
install -m 644 %{SOURCE2} %{buildroot}%{_localstatedir}/lib/%{name}/server.properties
install -m 644 %{SOURCE3} %{buildroot}%{_localstatedir}/lib/%{name}/webserver.properties
install -m 600 %{SOURCE4} %{buildroot}%{_localstatedir}/lib/%{name}/sqltool.rc
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}/lib
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}/data
install -d -m 755 %{buildroot}%{_pkgdocdir}
cp -r doc index.html %{buildroot}%{_pkgdocdir}
pushd %{buildroot}%{_localstatedir}/lib/%{name}/lib
# build-classpath can not be used as the jar is not
# yet present during the build
ln -s %{_javadir}/hsqldb.jar hsqldb.jar
ln -s $(build-classpath glassfish-servlet-api) servlet.jar
popd
%preun
%systemd_preun hsqldb.service
%pre
%{_sbindir}/groupadd -g 96 -f -r %{name} 2> /dev/null || :
%{_sbindir}/useradd -u 96 -g %{name} -s /sbin/nologin \
-d %{_localstatedir}/lib/%{name} -r %{name} 2> /dev/null || :
%post
%systemd_post hsqldb.service
%postun
%systemd_postun_with_restart hsqldb.service
%triggerun -- hsqldb < 1.8.1.3-9
/usr/bin/systemd-sysv-convert --save hsqldb >/dev/null 2>&1 ||:
/bin/systemctl --no-reload enable hsqldb.service >/dev/null 2>&1 ||:
/sbin/chkconfig --del hsqldb >/dev/null 2>&1 || :
/bin/systemctl try-restart hsqldb.service >/dev/null 2>&1 || :
%files
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%{_unitdir}/%{name}.service
%{_prefix}/lib/%{name}/%{name}-wrapper
%{_prefix}/lib/%{name}/%{name}-post
%{_prefix}/lib/%{name}/%{name}-stop
%attr(0700,hsqldb,hsqldb) %{_localstatedir}/lib/%{name}/data
%{_localstatedir}/lib/%{name}/lib
%{_localstatedir}/lib/%{name}/server.properties
%{_localstatedir}/lib/%{name}/webserver.properties
%attr(0600,hsqldb,hsqldb) %{_localstatedir}/lib/%{name}/sqltool.rc
%dir %{_localstatedir}/lib/%{name}
%dir %{_prefix}/lib/%{name}
%files lib -f .mfiles
%files manual
%doc %{_pkgdocdir}
%files javadoc
%doc %{_javadocdir}/%{name}
%files demo
%changelog
* Tue Aug 4 2020 leiju <leiju4@huawei.com> - 2.4.0-1
- Package init

14
hsqldb.systemd Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=HyperSQL Database Engine
After=network.target
[Service]
Type=simple
User=hsqldb
Group=hsqldb
ExecStart=-/usr/lib/hsqldb/hsqldb-wrapper
ExecStartPost=/usr/lib/hsqldb/hsqldb-post
ExecStop=/usr/lib/hsqldb/hsqldb-stop
[Install]
WantedBy=multi-user.target

4
hsqldb.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: svn
src_repo: https://svn.code.sf.net/p/hsqldb/svn/
tag_prefix: "^"
seperator: "."