Sync from SUSE:SLFO:Main hsqldb revision 63a3540e56f6acd2525d14915335186e

This commit is contained in:
Adrian Schröter 2024-05-03 13:35:48 +02:00
commit 246d04eb32
16 changed files with 1242 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,24 @@
Index: hsqldb/sample/hsqldb.service
===================================================================
--- hsqldb.orig/sample/hsqldb.service
+++ hsqldb/sample/hsqldb.service
@@ -17,6 +17,19 @@ Description=HyperSQL Database Server
After=socket.service
[Service]
+# added automatically, for details please see
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
+ProtectSystem=full
+ProtectHome=true
+PrivateDevices=true
+ProtectHostname=true
+ProtectClock=true
+ProtectKernelTunables=true
+ProtectKernelModules=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
# TODO! Change these paths to point to the absolute path of the "hsqldb.init"
# script in your HyperSQL distribution:
ExecStart=/local/hsqldb-2.3.4/sample/hsqldb.init start

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

View File

@ -0,0 +1,98 @@
# $Id: hsqldb-1.8.0-standard-sqltool.rc,v 1.1 2007/08/31 13:37:06 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
###########################################################################

View File

@ -0,0 +1,13 @@
# 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.urlid.0 db0-url
server.silent true
server.trace false
server.port 80
server.default_page index.html
server.root ./
.html=text/html

126
hsqldb-1.8.0-standard.cfg Normal file
View File

@ -0,0 +1,126 @@
# $Id: hsqldb-1.8.0-standard.cfg,v 1.2 2007/12/04 15:56:54 jprindiv 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
# JAVA_EXECUTABLE - a path to ${JAVA_HOME}/bin/java
# change if you want to use a different JVM as the default one
# JAVA_EXECUTABLE=
# 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=/usr/share/java/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=\"\"

40
hsqldb-2.7.2.pom Normal file
View File

@ -0,0 +1,40 @@
<?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.7.2</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>fredt</id>
<name>Fred Toussi</name>
<email>ft@cluedup.com</email>
</developer>
<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.7.2</tag>
<url>http://sourceforge.net/p/hsqldb/svn/HEAD/tree/base/tags/2.7.2</url>
</scm>
</project>

BIN
hsqldb-2.7.2.zip (Stored with Git LFS) Normal file

Binary file not shown.

36
hsqldb-apidocs.patch Normal file
View File

@ -0,0 +1,36 @@
Index: hsqldb/build/build.xml
===================================================================
--- hsqldb.orig/build/build.xml
+++ hsqldb/build/build.xml
@@ -167,6 +167,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/apidocs. -->
@@ -780,7 +781,6 @@ ${err.2}</fail>
<delete file="${swsrc}org/hsqldb/server/Servlet.java"/>
<javadoc
destdir="doc/apidocs"
- stylesheetfile="doc/apidocs/javadoc.css"
docencoding="UTF-8"
charset="UTF-8"
author="true"
@@ -818,7 +818,6 @@ ${err.2}</fail>
description="Create javadoc for the org.hsqldb.sqltool module">
<javadoc
destdir="doc/apidocssqltool"
- stylesheetfile="doc/apidocs/javadoc.css"
docencoding="UTF-8"
charset="UTF-8"
author="true"
@@ -857,7 +856,6 @@ ${err.2}</fail>
<javadoc
destdir="doc/apidocsdev"
docencoding="UTF-8"
- stylesheetfile="doc/apidocs/javadoc.css"
charset="UTF-8"
linksource="true"
author="true"

76
hsqldb-mdescriptor.patch Normal file
View File

@ -0,0 +1,76 @@
Index: hsqldb/build/build.xml
===================================================================
--- hsqldb.orig/build/build.xml
+++ hsqldb/build/build.xml
@@ -257,6 +257,8 @@ examples:
<target name="mdesc-hsqldbmin" depends="sw-hsqldbmin" if="ant.java.iscjava11" >
<javac srcdir="${swsrcmin}"
+ source="8"
+ target="8"
bootclasspath="${javac.bootcp.override}"
sourcepath=""
includeantruntime="false"
@@ -276,6 +278,8 @@ examples:
<fail unless='_servlet_available'
message="Place Jar file for Servlet API at '${servletapi.lib}', or set property 'servletapi.lib'"/>
<javac srcdir="${swsrc}"
+ source="8"
+ target="8"
bootclasspath="${javac.bootcp.override}"
sourcepath=""
includeantruntime="false"
@@ -290,6 +294,8 @@ examples:
<target name="classes" depends="sw-hsqldb,-javajsse"
description="compiles JVM-independent non-lib/util/cmdline/servlet classes">
<javac srcdir="${swsrc}"
+ source="8"
+ target="8"
bootclasspath="${javac.bootcp.override}"
includeantruntime="false"
encoding="${javac.encoding}"
@@ -331,6 +337,8 @@ examples:
<target name="-util" depends="-prepare, sw-hsqldb"
description="compiles the util folder">
<javac srcdir="${swsrc}"
+ source="8"
+ target="8"
bootclasspath="${javac.bootcp.override}"
includeantruntime="false"
encoding="${javac.encoding}"
@@ -349,6 +357,8 @@ examples:
<!-- This javac is no longer dependent upon default attr. includeAntRuntime=true -->
<!-- Ant resolver and preprocessor moved to trunk/integration/ant/prepocessor/src -->
<javac srcdir="src"
+ source="8"
+ target="8"
bootclasspath="${javac.bootcp.override}"
encoding="${javac.encoding}"
destdir="classes"
@@ -364,6 +374,8 @@ examples:
-conditionalize-sqlfile-scanner, -sqlfile-scanner">
<javac srcdir="${swsrctool}"
+ source="8"
+ target="8"
bootclasspath="${javac.bootcp.override}"
includeantruntime="false"
encoding="${javac.encoding}"
@@ -390,6 +402,8 @@ examples:
<target name="-swing" depends="sw-hsqldb"
description="compiles the swing based classes in the util folder">
<javac srcdir="${swsrc}"
+ source="8"
+ target="8"
bootclasspath="${javac.bootcp.override}"
includeantruntime="false"
encoding="${javac.encoding}"
@@ -415,6 +429,8 @@ examples:
<target name="scanner-driver" depends="-cmdline"
description="Build Scanner Driver. For SqlTool scanner developers.">
<javac srcdir="${swsrc}"
+ source="8"
+ target="8"
bootclasspath="${javac.bootcp.override}"
includeantruntime="false"
encoding="${javac.encoding}"

83
hsqldb-post Normal file
View File

@ -0,0 +1,83 @@
#!/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/hsqldb.conf
. /usr/share/java-utils/java-functions
[ -z "$JAVA_EXECUTABLE" ] && {
set_javacmd
JAVA_EXECUTABLE=${JAVACMD}
}
# 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

91
hsqldb-stop Normal file
View File

@ -0,0 +1,91 @@
#!/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/hsqldb.conf
. /usr/share/java-utils/java-functions
[ -z "$JAVA_EXECUTABLE" ] && {
set_javacmd
JAVA_EXECUTABLE=${JAVACMD}
}
# 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

104
hsqldb-wrapper Normal file
View File

@ -0,0 +1,104 @@
#!/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/hsqldb.conf
. /usr/share/java-utils/java-functions
[ -z "$JAVA_EXECUTABLE" ] && {
set_javacmd
JAVA_EXECUTABLE=${JAVACMD}
}
# 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

234
hsqldb.changes Normal file
View File

@ -0,0 +1,234 @@
-------------------------------------------------------------------
Thu Feb 15 17:17:17 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- rpm 4.19 requires dependencies on hsqldb user and group
-------------------------------------------------------------------
Thu Sep 21 05:45:42 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Modified patch:
* hsqldb-mdescriptor.patch
+ Build with java source/target levels 8
-------------------------------------------------------------------
Tue Jun 20 14:27:13 UTC 2023 - David Anes <david.anes@suse.com>
- Upgrade to version 2.7.2:
* adds support for JSON constructor functions
* add direct CSV data load and unload
-------------------------------------------------------------------
Mon Oct 24 15:55:11 UTC 2022 - David Anes <david.anes@suse.com>
- Upgrade to upstream version 2.7.1: (bsc#1204521, CVE-2022-41853)
* version 2.7.1 jar requires JRE 11 or later - tested up to Java 17
* version 2.7.1 alternative jar requires JRE 8 or later
* CVE-2022-41853 disallow calling java methods - setting the
hsqldb.java_method_names is required for accessing java methods
* enhancements to RECURSIVE CTE's
- Upgrade to upstream version 2.7.0
* version 2.7.0 jar requires JRE 11 or later - tested up to Java 17
* version 2.7.0 alternative jar requires JRE 8 or later
* added support for JSON constructor functions
* added support for microsecond precision CURRENT_TIMESTAMP and similar functions
* added support for GRANT and REVOKE on all objects in a schema
* added support for CSV file data import and export
* added support for regional time zones such as 'America/New_York' in conversions
* added SET DATABASE SQL MAX RECURSIVE (sql.max_recursive) setting
* changed the default for SET DATABASE SQL SYS INDEX NAMES (sql.sys_index_names) to true
* changed the properties reported by JDBC DatabaseMetaDat::getClientInfoProperties() method
* improved JDBC DatabaseMetaDat::getTablePrivileges() method to cover fine-grained privileges
* improved error messages for SQL settings statements
* improved documentation
* added some minor enhancements
* fixed a number of reported regressions and bugs (see tracker)
- Refreshed/rebased patches with quilt:
* hsqldb-apidocs.patch
* hsqldb-mdescriptor.patch (downgraded to build as 1.7)
* harden_hsqldb.service.patch
-------------------------------------------------------------------
Thu Mar 17 05:53:55 UTC 2022 - Fridrich Strba <fstrba@suse.com>
- Upgrade to upstream version 2.6.1
- Modified patch:
* hsqldb-apidocs.patch
+ adapt to changed context
- Removed patches:
* hsqldb-2.4.1-javadoc10.patch
* hsqldb-cmdline.patch
+ not needed with this version
- Added patch:
* hsqldb-mdescriptor.patch
+ module descriptor needs to be built with at least
source/target level 9
-------------------------------------------------------------------
Wed Sep 22 08:34:22 UTC 2021 - Johannes Segitz <jsegitz@suse.com>
- Added hardening to systemd service(s) (bsc#1181400). Added patch(es):
* harden_hsqldb.service.patch
-------------------------------------------------------------------
Mon Dec 14 19:30:22 UTC 2020 - Pedro Monreal <pmonreal@suse.com>
- Fix service section to use the libexec directory [bsc#1179973]
- Add After=network.target to systemd service
- Remove bundled servlet api
-------------------------------------------------------------------
Wed Jun 12 15:07:02 UTC 2019 - Dominique Leuenberger <dimstar@opensuse.org>
- BuildRequire pkgconfig(systemd) instead of systemd: allow OBS to
shortcut the build queues by allowing usage of systemd-mini
-------------------------------------------------------------------
Thu Jul 12 07:59:04 UTC 2018 - fstrba@suse.com
- Version bump to 2.4.1
* Require java 8 or higher
- Changed patch:
* hsqldb-2.3.3-javadoc10.patch -> hsqldb-2.4.1-javadoc10.patch
+ rediff to changed context
-------------------------------------------------------------------
Mon Dec 18 07:05:16 UTC 2017 - fstrba@suse.com
- Added patch:
* hsqldb-2.3.3-javadoc10.patch
+ Fix build with jdk10's javadoc that ends in error when a
link cannot be downloaded
-------------------------------------------------------------------
Thu Nov 23 13:50:25 UTC 2017 - rbrown@suse.com
- Replace references to /var/adm/fillup-templates with new
%_fillupdir macro (boo#1069468)
-------------------------------------------------------------------
Fri Sep 29 06:52:51 UTC 2017 - fstrba@suse.com
- Mofified patch:
* hsqldb-apidocs.patch
+ Don't force -Xdoclint:none, since we switched the default
doclint run off in all our java-devel providers and this
option does not work with java < 1.8
-------------------------------------------------------------------
Fri Sep 8 06:50:36 UTC 2017 - fstrba@suse.com
- Specify java source and target version 1.7 in order to allow
build with jdk9
-------------------------------------------------------------------
Fri May 19 11:49:45 UTC 2017 - mpluskal@suse.com
- Update dependencies
-------------------------------------------------------------------
Wed Jul 29 11:17:12 UTC 2015 - tchvatal@suse.com
- Version bump to 2.3.3:
* Various serveral minor issues
* No obvious detailed changelog
- Fix build with jdk8 by tweaking doclint:
* hsqldb-apidocs.patch
-------------------------------------------------------------------
Wed Mar 18 09:46:07 UTC 2015 - tchvatal@suse.com
- Fix build with new javapackages-tools
-------------------------------------------------------------------
Sun Jan 18 23:42:53 UTC 2015 - p.drouand@gmail.com
- Update to version 2.3.2
* fixed several minor issues
* fixed bug with incomplete rollback of MVCC transaction that
inserts and updates the same row
* fixed issue with parsing of long BIT strings in SQL
* fixed issue with SQL triggers when columns were added or dropped
from a table with SQL triggers
* fixed issue with an index added to a TEMP table with ON COMMIT
PRESERVE ROWS and containing data
* added URL property hsqldb.digest which can be used with alternative
secure hash algorithms for passwords
* changed the class used for offline backup and restore to
org.hsqldb.lib.tar.DbBackupMain
* extended the scope of SET DATABASE SQL REFERENCES TRUE to catch
ambiguity with identical table aliases
* extended support for the DEFAULT keyword used in INSERT and UPDATE
to apply to columns with no default
* improved support for recursive queries
* improved ORA and MYS syntax compatibility modes
-------------------------------------------------------------------
Mon Sep 9 11:05:43 UTC 2013 - tchvatal@suse.com
- Move from jpackage-utils to javapackage-tools
-------------------------------------------------------------------
Wed Sep 4 12:42:55 UTC 2013 - mvyskocil@suse.com
- Update to 2.2.9
* new core fully multithreaded core supports 2PL (two-phased locking)
and MVCC (multiversion concurrency control), plus a hybrid 2PL+MVCC
transaction control mode
* Massive high performance LOB store for BLOBs and CLOBs up to multi-gigabyte
size, with total storage capacity of 64 terabytes.
* Increased default storage space of 16GB for ordinary data, with fast
startup and shutdown. Storage space can be extended to 2TB.
* Large result sets, views and subqueries can now be stored on disk (on the
server side) while being generated and accessed. The threshold to store
a result on disk, as well as the actual fetch size in client-server
configurations can be specified per connection.
* All query conditions, whether in a JOIN or WHERE clause, are now
allocated to an index if possible.
* HyperSQL supports schema-based stored procedures and functions written
entirely in SQL and JAVA.
* Support for BIT, BIT VARYING, CLOB, BLOB, INTERVAL according to the
SQL Standards
* and many more - see http://hsqldb.sourceforge.net/web/features200.html
- Dropped patches
* hsqldb-1.8.0-scripts.patch
* hsqldb-1.8.0.10-suse-initscript.patch (systemd service is used)
* hsqldb-jdbc-4.1.patch
* hsqldb-tmp.patch (hsqldb-wrapper is used)
- New patches
* hsqldb-apidocs.patch
* hsqldb-cmdline.patch
- systemd integration and drop init script
-------------------------------------------------------------------
Mon May 21 12:19:01 UTC 2012 - mvyskocil@suse.cz
- Update to 1.8.1.3
* adds support for fast closing of huge database files
* better query optimisation.
* bugfixes
- add maven pom
- fix build with jdk7
- run su with -s /bin/sh in initscript
-------------------------------------------------------------------
Mon Dec 19 13:22:15 CET 2011 - dmueller@suse.de
- fix hsqldb_lic.txt packaged in hsqldb-manual and hsqldb
-------------------------------------------------------------------
Fri Jan 14 14:11:21 UTC 2011 - mvyskocil@suse.cz
- fix bnc#664425 - error in init script of hsqldb
* init PATH on the begining
* use absolute names
- change default shell from /bin/false to /bin/sh to make su command
(and server start) possible
- change hsqldb jar location to /usr/share/java/hsqldb.jar
-------------------------------------------------------------------
Wed May 13 09:11:43 CEST 2009 - mvyskocil@suse.cz
- Initial SUSE packaging od hsqldb 1.8.0.10 from jpackage.org

256
hsqldb.spec Normal file
View File

@ -0,0 +1,256 @@
#
# spec file for package hsqldb
#
# Copyright (c) 2024 SUSE LLC
#
# 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/
#
#Compat macro for new _fillupdir macro introduced in Nov 2017
%{!?_fillupdir:%global _fillupdir /var/adm/fillup-templates}
Name: hsqldb
Version: 2.7.2
Release: 0
Summary: HyperSQL Database Engine
License: BSD-3-Clause
Group: Productivity/Databases/Servers
URL: https://hsqldb.org/
Source0: http://downloads.sourceforge.net/hsqldb/%{name}-%{version}.zip
Source1: hsqldb-1.8.0-standard.cfg
Source2: hsqldb-1.8.0-standard-server.properties
Source3: hsqldb-1.8.0-standard-webserver.properties
Source4: hsqldb-1.8.0-standard-sqltool.rc
Source5: https://repo1.maven.org/maven2/org/hsqldb/hsqldb/%{version}/hsqldb-%{version}.pom
# Custom systemd files - talking with upstream about incorporating them, see
# http://sourceforge.net/projects/hsqldb/forums/forum/73673/topic/5367103
Source6: hsqldb.systemd
Source7: hsqldb-wrapper
Source8: hsqldb-post
Source9: hsqldb-stop
# Javadoc fails to create since apidocs folder is deleted and not recreated
Patch0: hsqldb-apidocs.patch
Patch1: hsqldb-mdescriptor.patch
Patch3: harden_hsqldb.service.patch
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: glassfish-servlet-api
BuildRequires: java-devel >= 1.8
# Needed for maven conversions
BuildRequires: javapackages-local
BuildRequires: javapackages-tools
BuildRequires: junit
BuildRequires: pkgconfig
BuildRequires: servletapi5
BuildRequires: unzip
BuildRequires: pkgconfig(systemd)
Requires: java >= 1.8
Requires: servletapi5
Provides: group(hsqldb)
Provides: user(hsqldb)
BuildArch: noarch
%systemd_requires
%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 manual
Summary: Manual for %{name}
Group: Documentation/Other
%description manual
Manual for %{name}.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation/HTML
%description javadoc
Javadoc for %{name}.
%package demo
Summary: Demo for %{name}
Group: Development/Libraries/Java
Requires: %{name} = %{version}
%description demo
Demonstrations and samples for %{name}.
%prep
%setup -q -n %{name}-%{version}/%{name}
# set right permissions
find . -name "*.sh" -exec chmod 755 {} +
# remove all _notes directories
find . -name _notes -exec rm -rf {} +
# remove all binary libs
find . -name "*.jar" -exec rm -f {} +
find . -name "*.class" -exec rm -f {} +
find . -name "*.war" -exec rm -f {} +
find . -name "*.zip" -exec rm -f {} +
# correct silly permissions
chmod -R go=u-w *
# Fix doc location
sed -i -e 's/doc-src/doc/g' build/build.xml
sed -i -e 's|doc/apidocs|%{_javadocdir}/%{name}|g' index.html
%autopatch -p1
%build
pushd build
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
ant hsqldb javadoc -Dservletapi.lib=$(build-classpath glassfish-servlet-api)
popd
%install
# jar
install -d -m 755 %{buildroot}%{_javadir}
install -m 644 lib/%{name}.jar %{buildroot}%{_javadir}/%{name}.jar
# systemd
install -d -m 755 %{buildroot}%{_unitdir}
install -d -m 755 %{buildroot}%{_libexecdir}/%{name}
install -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/%{name}.service
install -m 755 %{SOURCE7} %{buildroot}%{_libexecdir}/%{name}/%{name}-wrapper
install -m 755 %{SOURCE8} %{buildroot}%{_libexecdir}/%{name}/%{name}-post
install -m 755 %{SOURCE9} %{buildroot}%{_libexecdir}/%{name}/%{name}-stop
# rchsqldb link
install -d -m 0755 %{buildroot}/%{_sbindir}/
ln -sf service %{buildroot}/%{_sbindir}/rc%{name}
# sysconfig
install -d -m 0755 %{buildroot}/%{_sysconfdir}
install -m 0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/%{name}.conf
# serverconfig
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
# lib
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}/lib
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -r doc/apidocs/* %{buildroot}%{_javadocdir}/%{name}
# data
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{name}/data
# demo
install -d -m 755 %{buildroot}%{_datadir}/%{name}/sample
rm -f sample/%{name}.init
install -m 644 sample/* %{buildroot}%{_datadir}/%{name}/sample
# manual
install -d -m 755 %{buildroot}%{_docdir}/%{name}-%{version}
cp -pr doc/* %{buildroot}%{_docdir}/%{name}-%{version}
cp -p index.html %{buildroot}%{_docdir}/%{name}-%{version}
cd ..
# Maven metadata
install -pD -T -m 644 %{SOURCE5} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap
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) servletapi5.jar
popd
%fdupes -s %{buildroot}
%pre
# Add the "hsqldb" user and group
# we need a shell to be able to use su - later
if [ `getent group %{name}` ]; then
: OK group hsqldb already present
else
%{_sbindir}/groupadd -r %{name} 2> /dev/null || :
fi
if [ `getent passwd %{name}` ]; then
: OK user hsqldb already present
else
%{_sbindir}/useradd -r -g %{name} -c "Hsqldb" -s /bin/sh \
-d %{_localstatedir}/lib/%{name} %{name} 2> /dev/null || :
fi
%service_add_pre %{name}.service
%post
%{fillup_only %{name}}
%service_add_post %{name}.service
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%files
%defattr(0644,root,root,0755)
%dir %{_docdir}/%{name}-%{version}
%doc %{_docdir}/%{name}-%{version}/hsqldb_lic.txt
%{_javadir}/*
%{_sbindir}/rc%{name}
%{_unitdir}/%{name}.service
%dir %{_libexecdir}/%{name}/
%attr(0755,root,root) %{_libexecdir}/%{name}/%{name}-post
%attr(0755,root,root) %{_libexecdir}/%{name}/%{name}-stop
%attr(0755,root,root) %{_libexecdir}/%{name}/%{name}-wrapper
%{_localstatedir}/lib/%{name}/lib
%attr(0700,hsqldb,hsqldb) %{_localstatedir}/lib/%{name}/data
%attr(0644,root,root) %{_localstatedir}/lib/%{name}/server.properties
%attr(0644,root,root) %{_localstatedir}/lib/%{name}/webserver.properties
%attr(0600,hsqldb,hsqldb) %{_localstatedir}/lib/%{name}/sqltool.rc
%dir %{_localstatedir}/lib/%{name}
%config(noreplace) %{_sysconfdir}/%{name}.conf
%dir %{_mavenpomdir}
%{_mavenpomdir}/*
%{_datadir}/maven-metadata/%{name}.xml
%files manual
%defattr(0644,root,root,0755)
%exclude %doc %{_docdir}/%{name}-%{version}/hsqldb_lic.txt
%doc %{_docdir}/%{name}-%{version}
%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}
%files demo
%defattr(-,root,root,0755)
%{_datadir}/%{name}
%changelog

15
hsqldb.systemd Normal file
View File

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