From 36aa5c53a8eb62446e4c21d9755d475de85cd333 Mon Sep 17 00:00:00 2001 From: akdengi Date: Wed, 4 Apr 2012 13:08:28 +0400 Subject: [PATCH] merge 1.8.1.3 from cooker --- .abf.yml | 2 +- hsqldb-1.8.0-specify-su-shell.patch | 37 ++++ hsqldb-1.8.0-standard-server.properties | 10 + hsqldb-1.8.0-standard.cfg | 37 +++- hsqldb-1.8.0.10.pom | 22 ++ hsqldb.spec | 271 ++++++++++-------------- 6 files changed, 209 insertions(+), 170 deletions(-) create mode 100644 hsqldb-1.8.0-specify-su-shell.patch create mode 100644 hsqldb-1.8.0.10.pom diff --git a/.abf.yml b/.abf.yml index f8f36a1..3288cfb 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,2 +1,2 @@ sources: - "hsqldb_1_8_0_10.zip": 7168b0f40aa5c72267899601c116d2348d2f56ec + "hsqldb_1_8_1_3.zip": 15b1ece2f131bdb007cae5762f631e8d5fd6eaae diff --git a/hsqldb-1.8.0-specify-su-shell.patch b/hsqldb-1.8.0-specify-su-shell.patch new file mode 100644 index 0000000..10bba3a --- /dev/null +++ b/hsqldb-1.8.0-specify-su-shell.patch @@ -0,0 +1,37 @@ +--- bin/hsqldb.orig 2011-01-24 11:59:14.356301132 +0200 ++++ bin/hsqldb 2011-01-24 12:00:06.278430417 +0200 +@@ -41,7 +41,7 @@ + # use this file. + + # This stuff will be ignored by systems that don't use chkconfig. +-# chkconfig: 345 87 13 ++# chkconfig: - 87 13 + # description: Hsqldb, A High Performance Java Database + # pidfile: /var/run/hsqldb.pid + # config: /etc/sysconfig/hsqldb +@@ -51,7 +51,6 @@ + # Provides: HSQLDB-Server + # Required-Start: $syslog $remote_fs $network $named + # Required-Stop: +-# Default-Start: 3 5 + # Default-Stop: 0 1 2 6 + # Short-Description: HSQLDB-Server + # Description: Hsqldb, A High Performance Java Database Server +@@ -369,7 +368,7 @@ running with pid $HSQLDB_PID." + # Some OSes choke if there are newlines in this string. + # N.b.!!! The shell of the -c command is the target user's default + # login shell, so keep this command shell-independent! +- nohup su "$HSQLDB_OWNER" -c "cd '$SERVER_HOME' && echo "'$$'" > '$PIDFILE' && 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" >> "$LOGFILE" 2>&1 & ++ nohup su "$HSQLDB_OWNER" -s /bin/sh -c "cd '$SERVER_HOME' && echo "'$$'" > '$PIDFILE' && 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" >> "$LOGFILE" 2>&1 & + else + cd "$SERVER_HOME" || { + echo "Failed to cd to '$SERVER_HOME'" 1>&2 +@@ -464,7 +463,7 @@ See log file '$LOGFILE'." 1>&2 + echo "Successful shutdown ${SHUTDOWN_OPTION} (for the $TARGET_CLASS process)!" + exit 0 + ;; +- restart|restartcompacted) ++ restart|restartcompacted|reload) + STOP_COMMAND=stop + [ "$COMMAND" = restartcompacted ] && STOP_COMMAND=stopcompact + "${INVOC_PATH}"hsqldb $STOP_COMMAND || exit $? diff --git a/hsqldb-1.8.0-standard-server.properties b/hsqldb-1.8.0-standard-server.properties index 12d2ee0..fea30f4 100644 --- a/hsqldb-1.8.0-standard-server.properties +++ b/hsqldb-1.8.0-standard-server.properties @@ -9,3 +9,13 @@ 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 diff --git a/hsqldb-1.8.0-standard.cfg b/hsqldb-1.8.0-standard.cfg index d6c9d3c..53d83d3 100755 --- a/hsqldb-1.8.0-standard.cfg +++ b/hsqldb-1.8.0-standard.cfg @@ -16,23 +16,21 @@ # Thanks to Meikel Bisping for his contributions. -- Blaine -[ -r /etc/hsqldb.conf ] && . /etc/hsqldb.conf || : -[ -r ~/.hsqldbrc ] && . ~/.hsqldbrc || : - # JPackage hsqldb home is /var/lib/hsqldb + HSQLDB_HOME=/var/lib/hsqldb # JPackage source Java config -. /usr/share/java-utils/java-functions -set_jvm -set_javacmd -JAVA_EXECUTABLE=${JAVACMD} +. /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=/usr/share/java/hsqldb.jar +HSQLDB_JAR_PATH=${HSQLDB_HOME}/lib/hsqldb.jar # Where the file "server.properties" (or "webserver.properties") resides. SERVER_HOME=${HSQLDB_HOME} @@ -87,6 +85,12 @@ AUTH_FILE=${HSQLDB_HOME}/sqltool.rc # 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. @@ -107,4 +111,19 @@ AUTH_FILE=${HSQLDB_HOME}/sqltool.rc # Any JVM args for the server. # For multiple args, put quotes around entire value. -#SERVER_JVMARGS=-Xmx512m +# +# 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=\"\" diff --git a/hsqldb-1.8.0.10.pom b/hsqldb-1.8.0.10.pom new file mode 100644 index 0000000..bd0c1fd --- /dev/null +++ b/hsqldb-1.8.0.10.pom @@ -0,0 +1,22 @@ + + 4.0.0 + hsqldb + hsqldb + jar + HSQLDB + 1.8.0.10 + http://hsqldb.org/ + Lightweight 100% Java SQL Database Engine + + + HSQLDB License + http://hsqldb.org/web/hsqlLicense.html + repo + + + + http://sourceforge.net/cvs/?group_id=23316 + + + + diff --git a/hsqldb.spec b/hsqldb.spec index 91c3e4d..1e22e4c 100644 --- a/hsqldb.spec +++ b/hsqldb.spec @@ -28,88 +28,39 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -%define _localstatedir %{_var} +%global cvs_version 1_8_1_3 -%define gcj_support 0 - -%define section devel - -%define cvs_version 1_8_0_10 - -Name: hsqldb -Version: 1.8.0.10 -Release: %mkrel 0.0.7 -Epoch: 1 -Summary: Hsqldb Database Engine -License: BSD -Url: http://hsqldb.sourceforge.net/ -Source0: http://downloads.sourceforge.net/hsqldb/hsqldb_%{cvs_version}.zip -Source1: %{name}-1.8.0-standard.cfg -Source2: %{name}-1.8.0-standard-server.properties -Source3: %{name}-1.8.0-standard-webserver.properties -Source4: %{name}-1.8.0-standard-sqltool.rc -Patch0: %{name}-1.8.0-scripts.patch -Patch1: %{name}-tmp.patch -Patch2: %{name}-1.8.0-initscript-restart.patch -Requires: servletapi5 -Requires(pre): rpm-helper -Requires(post): rpm-helper -Requires(preun): rpm-helper -Requires(postun): rpm-helper -Requires(post): servletapi5 -Requires(post): jpackage-utils +Name: hsqldb +Version: 1.8.1.3 +Release: 5 +Epoch: 1 +Summary: HyperSQL Database Engine +License: BSD +URL: http://hsqldb.sourceforge.net/ +Source0: http://downloads.sourceforge.net/hsqldb/%{name}_%{cvs_version}.zip +Source1: %{name}-1.8.0-standard.cfg +Source2: %{name}-1.8.0-standard-server.properties +Source3: %{name}-1.8.0-standard-webserver.properties +Source4: %{name}-1.8.0-standard-sqltool.rc +Source5: http://mirrors.ibiblio.org/pub/mirrors/maven2/%{name}/%{name}/1.8.0.10/%{name}-1.8.0.10.pom +Patch0: %{name}-1.8.0-scripts.patch +Patch1: hsqldb-tmp.patch +Patch2: %{name}-1.8.0-specify-su-shell.patch +Requires: servlet25 +Requires(post): coreutils +Requires(preun): coreutils +Requires(preun): initscripts Requires(pre): shadow-utils +Requires(post): jpackage-utils +Requires(postun): jpackage-utils BuildRequires: ant BuildRequires: junit -%if %mdkversion >= 200810 -BuildRequires: java-rpmbuild >= 0:1.5 -%else -BuildRequires: java-devel-gcj -%endif -BuildRequires: servletapi5 -Group: Development/Java -%if ! %{gcj_support} -Buildarch: noarch -%endif -Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root - -%if %{gcj_support} -BuildRequires: java-gcj-compat-devel -%endif +BuildRequires: jpackage-utils >= 0:1.5 +BuildRequires: servlet25 +Group: Databases +BuildArch: noarch %description -This package contains the hsqldb java classes. The server is contained -in the package %{name}-server. - -%package manual -Summary: Manual for %{name} -Group: Development/Java - -%description manual -Documentation for %{name}. - -%package javadoc -Summary: Javadoc for %{name} -Group: Development/Java - -%description javadoc -Javadoc for %{name}. - -%package demo -Summary: Demo for %{name} -Group: Development/Java -Requires: %{name} = %{epoch}:%{version}-%{release} - -%description demo -Demonstrations and samples for %{name}. - -%package server -Summary: Hsqldb database server -Group: System/Servers -Conflicts: hsqldb < 1:1.8.0.9-0.0.11 -Requires: %{name} = %{epoch}:%{version}-%{release} - -%description server 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 @@ -126,7 +77,28 @@ 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! -This package contains the server. +%package manual +Summary: Manual for %{name} +Group: Development/Java + +%description manual +Documentation for %{name}. + +%package javadoc +Summary: Javadoc for %{name} +Group: Development/Java +Requires: jpackage-utils + +%description javadoc +Javadoc for %{name}. + +%package demo +Summary: Demo for %{name} +Group: Development/Java +Requires: %{name} = %{epoch}:%{version}-%{release} + +%description demo +Demonstrations and samples for %{name}. %prep %setup -T -c -n %{name} @@ -143,43 +115,31 @@ find . -name "*.class" -exec rm -f {} \; find . -name "*.war" -exec rm -f {} \; # correct silly permissions chmod -R go=u-w * -%{_bindir}/find . -type f -name '*.css' -o -name '*.html' -o -name '*.txt' | \ - %{_bindir}/xargs -t %{__perl} -pi -e 's/\r$//g' %patch0 %patch1 -p1 +%patch2 -cat > README.%{version}-%{release}.upgrade.urpmi </dev/null 2>&1 + /sbin/chkconfig --del %{name} +fi + +%pre # Add the "hsqldb" user and group # we need a shell to be able to use su - later - -# (Anssi 01/2008) Previously _pre_groupadd was used here together with -# _pre_useradd, causing an error situation where group is created, but -# the user is not: -# useradd: group hsqldb exists - if you want to add this user to that group, use -g. -# Therefore we remove the hsqldb group if it exists without the corresponding -# user. -getent group %{name} >/dev/null && ! getent passwd %{name} >/dev/null && groupdel %{name} >/dev/null -getent passwd %{name} >/dev/null && chsh -s /bin/sh %{name} >/dev/null -%_pre_useradd %{name} %{_localstatedir}/lib/%{name} /bin/sh - -%post server -%{__rm} -f %{_localstatedir}/lib/%{name}/lib/hsqldb.jar -%{__rm} -f %{_localstatedir}/lib/%{name}/lib/servlet.jar -(cd %{_localstatedir}/lib/%{name}/lib - %{__ln_s} %{_javadir}/hsqldb.jar hsqldb.jar - %{__ln_s} %{_javadir}/servletapi5.jar servlet.jar -) -%_post_service %{name} +%{_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 -%if %{gcj_support} -%{update_gcjdb} -%endif +# This adds the proper /etc/rc*.d links for the script +/sbin/chkconfig --add %{name} -%postun server -%_postun_userdel %{name} +%update_maven_depmap %postun -%if %{gcj_support} -%{clean_gcjdb} -%endif +%update_maven_depmap -%preun server -if [ "$1" = "0" ]; then - %{__rm} -f %{_localstatedir}/lib/%{name}/lib/hsqldb.jar - %{__rm} -f %{_localstatedir}/lib/%{name}/lib/servlet.jar -%if 0 - %{_sbindir}/userdel %{name} >> /dev/null 2>&1 || : - %{_sbindir}/groupdel %{name} >> /dev/null 2>&1 || : -%endif -fi -%_preun_service %{name} +%pre javadoc +# workaround for rpm bug, can be removed in F-17 +[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \ +rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || : %files -%defattr(0644,root,root,0755) -%dir %{_docdir}/%{name}-%{version} -%doc %{_docdir}/%{name}-%{version}/hsqldb_lic.txt -%doc README*.urpmi +%defattr(-,root,root,-) +%doc doc/hsqldb_lic.txt %{_javadir}/* -%{gcj_files} - -%files server -%defattr(0644,root,root,0755) %attr(0755,root,root) %{_bindir}/* -%attr(0755,root,root) %{_initrddir}/%{name} -%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/%{name} -%attr(0755,hsqldb,hsqldb) %{_localstatedir}/lib/%{name}/data +%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/%{name} +%config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%attr(0700,hsqldb,hsqldb) %{_localstatedir}/lib/%{name}/data %{_localstatedir}/lib/%{name}/lib -%attr(0644,root,root) %{_localstatedir}/lib/%{name}/server.properties -%attr(0644,root,root) %{_localstatedir}/lib/%{name}/webserver.properties +%{_localstatedir}/lib/%{name}/server.properties +%{_localstatedir}/lib/%{name}/webserver.properties %attr(0600,hsqldb,hsqldb) %{_localstatedir}/lib/%{name}/sqltool.rc %dir %{_localstatedir}/lib/%{name} +%{_mavendepmapfragdir}/* +%{_mavenpomdir}/* %files manual -%defattr(0644,root,root,0755) +%defattr(-,root,root,-) %doc %{_docdir}/%{name}-%{version} +%doc doc/hsqldb_lic.txt %files javadoc -%defattr(0644,root,root,0755) -%{_javadocdir}/%{name}-%{version} +%defattr(-,root,root,-) +%{_javadocdir}/%{name} +%doc doc/hsqldb_lic.txt %files demo -%defattr(-,root,root,0755) +%defattr(-,root,root,-) %{_datadir}/%{name} + %changelog +* Sun Nov 27 2011 Guilherme Moro 1:1.8.1.3-5 ++ Revision: 733975 +- rebuild +- imported package hsqldb + + + Oden Eriksson + - mass rebuild + * Fri Dec 03 2010 Oden Eriksson 1:1.8.0.10-0.0.5mdv2011.0 + Revision: 605880 - rebuild @@ -351,7 +302,7 @@ fi + Anssi Hannula - fix hsqldb user creation - + Olivier Blin + + Olivier Blin - restore BuildRoot * Mon Dec 31 2007 David Walluck 1:1.8.0.9-0.0.4mdv2008.1