hsqldb/hsqldb.spec
Michal Vyskocil 19e37afe6e - 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

OBS-URL: https://build.opensuse.org/package/show/Java:packages/hsqldb?expand=0&rev=8
2012-05-21 12:21:41 +00:00

308 lines
10 KiB
RPMSpec

#
# spec file for package hsqldb
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: hsqldb
Version: 1.8.1.13
Release: 0
Summary: HYperSQL Database Engine
License: BSD-3-Clause
Group: Development/Libraries/Java
Url: http://hsqldb.sourceforge.net/
Source0: %{name}_1_8_1_3.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: %{name}-1.8.0.10.pom
Patch0: %{name}-1.8.0-scripts.patch
Patch1: hsqldb-tmp.patch
Patch3: hsqldb-jdbc-4.1.patch
Patch1000: hsqldb-1.8.0.10-suse-initscript.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
Requires: java
Requires: servletapi5
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: jpackage-utils >= 1.5
BuildRequires: junit
BuildRequires: servletapi5
BuildRequires: unzip
PreReq: %fillup_prereq
%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: Hsqldb Database Engine
Group: Development/Libraries/Java
%description manual
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 javadoc
Summary: Hsqldb Database Engine
Group: Development/Libraries/Java
%description javadoc
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 demo
Summary: Hsqldb Database Engine
Group: Development/Libraries/Java
Requires: %{name} = %{version}
%description demo
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!
%prep
%setup -T -c -n %{name}
(cd ..; unzip -q %{SOURCE0})
# set right permissions
find . -name "*.sh" -exec chmod 755 \{\} \;
# remove all _notes directories
for dir in `find . -name _notes`; do rm -rf $dir; done
# remove all binary libs
find . -name "*.jar" -exec rm -f {} \;
find . -name "*.class" -exec rm -f {} \;
find . -name "*.war" -exec rm -f {} \;
# correct silly permissions
chmod -R go=u-w *
%patch0 -p0
%patch1 -p1
%patch3 -p1
%patch1000 -b .suse-initscript
cp %{SOURCE5} pom.xml
%build
export CLASSPATH=$(build-classpath \
servletapi5 \
junit)
pushd build
ant jar javadoc
popd
%install
# jar
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
# bin
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
install -m 755 bin/runUtil.sh $RPM_BUILD_ROOT%{_bindir}/%{name}RunUtil
# sysv init
install -d -m 755 $RPM_BUILD_ROOT%{_initrddir}
install -m 755 bin/%{name} $RPM_BUILD_ROOT%{_initrddir}/%{name}
# rchsqldb link
install -d -m 0755 $RPM_BUILD_ROOT/%{_sbindir}/
ln -sf %{_sysconfdir}/init.d/%{name} $RPM_BUILD_ROOT/%{_sbindir}/rc%{name}
# sysconfig
#install -d -m 0755 $RPM_BUILD_ROOT/var/adm/fillup-templates
#install -m 700 %{SOURCE1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name}
install -m 0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/%{name}.conf
# serverconfig
install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/server.properties
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/webserver.properties
install -m 600 %{SOURCE4} $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/sqltool.rc
# lib
install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/lib
install -m 644 lib/functions $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/lib
# data
install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/data
# demo
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/demo
install -m 755 demo/*.sh $RPM_BUILD_ROOT%{_datadir}/%{name}/demo
install -m 644 demo/*.html $RPM_BUILD_ROOT%{_datadir}/%{name}/demo
# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -r doc/src/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
rm -rf doc/src
# manual
install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp -pr doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp -p index.html $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
%fdupes -s %{buildroot}
# Maven metadata
install -pD -T -m 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}
pushd $RPM_BUILD_ROOT%{_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 servletapi5) servletapi5.jar
popd
%clean
rm -rf $RPM_BUILD_ROOT
%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} -o %{name} 2> /dev/null || :
fi
%post
%{fillup_and_insserv %{name}}
rm -f %{_localstatedir}/lib/%{name}/lib/hsqldb.jar
rm -f %{_localstatedir}/lib/%{name}/lib/servlet.jar
%postun
%restart_on_update %{name}
%insserv_cleanup
%preun
%stop_on_removal %{name}
%files
%defattr(0644,root,root,0755)
%dir %{_docdir}/%{name}-%{version}
%doc %{_docdir}/%{name}-%{version}/hsqldb_lic.txt
%{_javadir}/*
%attr(0755,root,root) %{_bindir}/*
%attr(0755,root,root) %{_sbindir}/rc%{name}
%attr(0755,root,root) %{_initrddir}/%{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
%attr(0600,hsqldb,hsqldb) %{_localstatedir}/lib/%{name}/sqltool.rc
%dir %{_localstatedir}/lib/%{name}
%config(noreplace) %{_sysconfdir}/%{name}.conf
%dir %{_mavenpomdir}
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
%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