2d2332a
# Copyright (c) 2000-2005, JPackage Project
2d2332a
# All rights reserved.
2d2332a
#
2d2332a
# Redistribution and use in source and binary forms, with or without
2d2332a
# modification, are permitted provided that the following conditions
2d2332a
# are met:
2d2332a
#
2d2332a
# 1. Redistributions of source code must retain the above copyright
2d2332a
#    notice, this list of conditions and the following disclaimer.
2d2332a
# 2. Redistributions in binary form must reproduce the above copyright
2d2332a
#    notice, this list of conditions and the following disclaimer in the
2d2332a
#    documentation and/or other materials provided with the
2d2332a
#    distribution.
2d2332a
# 3. Neither the name of the JPackage Project nor the names of its
2d2332a
#    contributors may be used to endorse or promote products derived
2d2332a
#    from this software without specific prior written permission.
2d2332a
#
2d2332a
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2d2332a
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2d2332a
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2d2332a
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2d2332a
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2d2332a
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2d2332a
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2d2332a
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2d2332a
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2d2332a
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2d2332a
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2d2332a
#
2d2332a
2d2332a
%define _with_gcj_support 1
2d2332a
2d2332a
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
2d2332a
2762918
%define section		devel
2762918
2d2332a
%define cvs_version	1_8_0_4
2762918
2d2332a
Name:		hsqldb
2d2332a
Version:	1.8.0.4
d640228
Release:	2jpp.2
2d2332a
Epoch:		1
2762918
Summary:	Hsqldb Database Engine
2762918
License:	BSD Style
2762918
Url:		http://hsqldb.sourceforge.net/
gbenson 830d5fe
Source0:	%{name}_%{cvs_version}-RHCLEAN.zip
2762918
Source1:	%{name}-%{version}-standard.cfg
2762918
Source2:	%{name}-%{version}-standard-server.properties
2762918
Source3:	%{name}-%{version}-standard-webserver.properties
2762918
Source4:	%{name}-%{version}-standard-sqltool.rc
2762918
Patch0:		%{name}-%{version}-scripts.patch
gbenson 2241f40
Requires:	servletapi5
2d2332a
Requires(post):   /bin/rm,/bin/ln
2d2332a
Requires(preun): /bin/rm
d640228
Requires(pre):	shadow-utils
2762918
BuildRequires:	ant
2762918
BuildRequires:	junit
2762918
BuildRequires:	jpackage-utils >= 0:1.5
2d2332a
BuildRequires:	servletapi5
2762918
Group:		Development/Java
2d2332a
%if ! %{gcj_support}
2d2332a
Buildarch:	noarch
2d2332a
%endif
2762918
Buildroot:	%{_tmppath}/%{name}-%{version}-buildroot
79c17f9
2d2332a
%if %{gcj_support}
2d2332a
BuildRequires:		java-gcj-compat-devel
2d2332a
Requires(post):		java-gcj-compat
2d2332a
Requires(postun):	java-gcj-compat
2d2332a
%endif
79c17f9
2762918
%description
2762918
HSQLdb is a relational database engine written in JavaTM , with a JDBC
2762918
driver, supporting a subset of ANSI-92 SQL. It offers a small (about
2762918
100k), fast database engine which offers both in memory and disk based
2762918
tables. Embedded and server modes are available. Additionally, it
2762918
includes tools such as a minimal web server, in-memory query and
2762918
management tools (can be run as applets or servlets, too) and a number
2762918
of demonstration examples.
2762918
Downloaded code should be regarded as being of production quality. The
2762918
product is currently being used as a database and persistence engine in
2762918
many Open Source Software projects and even in commercial projects and
2762918
products! In it's current version it is extremely stable and reliable.
2762918
It is best known for its small size, ability to execute completely in
2762918
memory and its speed. Yet it is a completely functional relational
2762918
database management system that is completely free under the Modified
2762918
BSD License. Yes, that's right, completely free of cost or restrictions!
2762918
2762918
%package manual
2762918
Summary:	Manual for %{name}
2762918
Group:		Development/Java
2762918
2762918
%description manual
2762918
Documentation for %{name}.
2762918
2762918
%package javadoc
2762918
Summary:	Javadoc for %{name}
2762918
Group:		Development/Java
2d2332a
Requires(post):   /bin/rm,/bin/ln
2d2332a
Requires(preun): /bin/rm
2762918
2762918
%description javadoc
2762918
Javadoc for %{name}.
2762918
2762918
%package demo
2762918
Summary:	Demo for %{name}
2762918
Group:		Development/Java
2762918
Requires:	%{name} = %{epoch}:%{version}-%{release}
2762918
2762918
%description demo
2762918
Demonstrations and samples for %{name}.
2762918
2762918
%prep
2762918
%setup -T -c -n %{name}
2762918
(cd ..
2762918
unzip -q %{SOURCE0} 
2762918
)
2762918
# set right permissions
2762918
find . -name "*.sh" -exec chmod 755 \{\} \;
2762918
# remove all _notes directories
2762918
for dir in `find . -name _notes`; do rm -rf $dir; done
2762918
# remove all binary libs
2762918
find . -name "*.jar" -exec rm -f {} \;
2762918
find . -name "*.class" -exec rm -f {} \;
2762918
find . -name "*.war" -exec rm -f {} \;
2762918
# correct silly permissions
2762918
chmod -R go=u-w *
2762918
2762918
%patch0
2762918
2762918
%build
2762918
export CLASSPATH=$(build-classpath \
2762918
jsse/jsse \
2762918
jsse/jnet \
2762918
jsse/jcert \
2762918
jdbc-stdext \
gbenson 2241f40
servletapi5 \
2762918
junit)
2762918
pushd build
2762918
ant jar javadoc
2762918
popd
2762918
2762918
%install
2762918
# jar
2762918
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
2762918
install -m 644 lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
2762918
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} ${jar/-%{version}/}; done)
2762918
# bin
2762918
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
2762918
install -m 755 bin/runUtil.sh $RPM_BUILD_ROOT%{_bindir}/%{name}RunUtil
2762918
# sysv init
gbenson 5867107
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
gbenson 5867107
install -m 755 bin/%{name} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}
2762918
# config
2762918
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
2762918
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
2762918
# serverconfig
2762918
install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
2762918
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/server.properties
2762918
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/webserver.properties
2762918
install -m 600 %{SOURCE4} $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/sqltool.rc
2762918
# lib
2762918
install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/lib
2762918
install -m 644 lib/functions 	$RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/lib
2762918
# data
2762918
install -d -m 755 $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}/data
2762918
# demo
2762918
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/demo
2762918
install -m 755 demo/*.sh 	$RPM_BUILD_ROOT%{_datadir}/%{name}/demo
2762918
install -m 644 demo/*.html 	$RPM_BUILD_ROOT%{_datadir}/%{name}/demo
2762918
# javadoc
2762918
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
2762918
cp -r doc/src/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
2762918
rm -rf doc/src
2762918
# manual
gbenson 2241f40
install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
2762918
cp -r doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
2762918
cp index.html $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
2762918
2d2332a
%if %{gcj_support}
2d2332a
%{_bindir}/aot-compile-rpm
2d2332a
%endif
gbenson a9d76c0
2762918
%clean
2762918
rm -rf $RPM_BUILD_ROOT
2762918
2762918
%pre
2762918
# Add the "hsqldb" user and group
2762918
# we need a shell to be able to use su - later
aa2f9b0
%{_sbindir}/groupadd -g 96 -f -r %{name} 2> /dev/null || :
aa2f9b0
%{_sbindir}/useradd -u 96 -g %{name} -s /sbin/nologin \
d640228
    -d %{_localstatedir}/lib/%{name} -r %{name} 2> /dev/null || :
2762918
2762918
%post
2762918
rm -f %{_localstatedir}/lib/%{name}/lib/hsqldb.jar
2762918
rm -f %{_localstatedir}/lib/%{name}/lib/servlet.jar
2762918
(cd %{_localstatedir}/lib/%{name}/lib
2762918
    ln -s $(build-classpath hsqldb) hsqldb.jar
gbenson 2241f40
    ln -s $(build-classpath servletapi5) servlet.jar
2762918
)
2d2332a
2d2332a
%if %{gcj_support}
2d2332a
if [ -x %{_bindir}/rebuild-gcj-db ]
2d2332a
then
2d2332a
  %{_bindir}/rebuild-gcj-db
2d2332a
fi
2d2332a
%endif
2762918
2762918
%preun
2762918
if [ "$1" = "0" ]; then
2762918
    rm -f %{_localstatedir}/lib/%{name}/lib/hsqldb.jar
2762918
    rm -f %{_localstatedir}/lib/%{name}/lib/servlet.jar
gbenson 09994b7
    #%{_sbindir}/userdel %{name} >> /dev/null 2>&1 || :
gbenson 09994b7
    #%{_sbindir}/groupdel %{name} >> /dev/null 2>&1 || :
2762918
fi
2762918
2762918
%post javadoc
2762918
rm -f %{_javadocdir}/%{name}
2762918
ln -s %{name}-%{version} %{_javadocdir}/%{name}
2762918
2762918
%preun javadoc
2762918
if [ "$1" = "0" ]; then
2762918
    rm -f %{_javadocdir}/%{name}
2762918
fi
2762918
2762918
%files
2762918
%defattr(0644,root,root,0755)
2762918
%doc %{_docdir}/%{name}-%{version}/hsqldb_lic.txt
2762918
%{_javadir}/*
2762918
%attr(0755,root,root) %{_bindir}/*
gbenson 5867107
%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/%{name}
2762918
%attr(0644,root,root) %{_sysconfdir}/sysconfig/%{name}
2762918
%attr(0755,hsqldb,hsqldb) %{_localstatedir}/lib/%{name}/data
2762918
%{_localstatedir}/lib/%{name}/lib
2762918
%attr(0644,root,root) %{_localstatedir}/lib/%{name}/server.properties
2762918
%attr(0644,root,root) %{_localstatedir}/lib/%{name}/webserver.properties
2762918
%attr(0600,hsqldb,hsqldb) %{_localstatedir}/lib/%{name}/sqltool.rc
2d2332a
2d2332a
%if %{gcj_support}
gbenson a9d76c0
%attr(-,root,root) %{_libdir}/gcj/%{name}
2d2332a
%endif
2762918
2762918
%files manual
2762918
%defattr(0644,root,root,0755)
gbenson 2241f40
%doc %{_docdir}/%{name}-%{version}
2762918
2762918
%files javadoc
2762918
%defattr(0644,root,root,0755)
2762918
%{_javadocdir}/%{name}-%{version}
2762918
2762918
%files demo
2762918
%defattr(0644,root,root,0755)
2762918
%{_datadir}/%{name}
2762918
2762918
%changelog
d640228
* Tue Aug 08 2006 Deepak Bhole <dbhole@redhat.com> 1:1.8.0.4-2jpp.2
d640228
- Fix regression re: missing shadow-utils prereq.
d640228
2d2332a
* Fri Aug 04 2006 Deepak Bhole <dbhole@redhat.com> 1:1.8.0.4-2jpp.1
2d2332a
- Add missing requirements.
2d2332a
- Merge with fc spec.
2d2332a
  - From gbenson@redhat.com:
2d2332a
    - Change /etc/init.d to /etc/rc.d/init.d.
2d2332a
    - Create hsqldb user and group with low IDs (RH bz #165670).
2d2332a
    - Do not remove hsqldb user and group on uninstall.
2d2332a
    - Build with servletapi5.
2d2332a
  - From ashah@redhat.com:
2d2332a
    - Change hsqldb user shell to /sbin/nologin.
2d2332a
  - From notting@redhat.com
2d2332a
    - use an assigned user/group id
2d2332a
2d2332a
* Fri Apr 28 2006 Fernando Nasser <fnasser@redhat.com> 1:1.8.0.4-1jpp
2d2332a
- First JPP 1.7 build
2d2332a
- Upgrade to 1.8.0.4
gbenson d8eeae2
gbenson d8eeae2
* Tue Jul 26 2005 Fernando Nasser <fnasser@redhat.com> 0:1.80.1-1jpp
gbenson d8eeae2
- Upgrade to 1.8.0.1
gbenson d8eeae2
gbenson d8eeae2
* Mon Mar 07 2005 Fernando Nasser <fnasser@redhat.com> 0:1.73.3-1jpp
gbenson d8eeae2
- Upgrade to 1.7.3.3
gbenson 2241f40
gbenson d8eeae2
* Wed Mar 02 2005 Fernando Nasser <fnasser@redhat.com> 0:1.73.0-1jpp
gbenson 2241f40
- Upgrade to 1.7.3.0
gbenson 2241f40
2762918
* Wed Aug 25 2004 Ralph Apel <r.apel at r-apel.de> 0:1.72.3-2jpp
2762918
- Build with ant-1.6.2
2762918
2762918
* Mon Aug 16 2004 Ralph Apel <r.apel at r-apel.de> 0:1.72.3-1jpp
2762918
- 1.7.2.3 stable
2762918
2762918
* Fri Jun 04 2004 Ralph Apel <r.apel at r-apel.de> 0:1.72-0.rc6b.1jpp
2762918
- 1.7.2 preview
2762918
2762918
* Tue May 06 2003 David Walluck <david@anti-microsoft.org> 0:1.71-1jpp
2762918
- 1.71
2762918
- update for JPackage 1.5
2762918
2762918
* Mon Mar 18 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.61-6jpp 
2762918
- generic servlet support
2762918
2762918
* Mon Jan 21 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.61-5jpp 
2762918
- versioned dir for javadoc
2762918
- no dependencies for javadoc package
2762918
- stricter dependencies for demo package
2762918
- section macro
2762918
- adaptation to new servlet3 package
2762918
2762918
* Mon Dec 17 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.61-4jpp
2762918
- javadoc in javadoc package
2762918
- doc reorganisation
2762918
- removed Requires: ant
2762918
- patches regenerated and bzipped
2762918
2762918
* Wed Nov 21 2001 Christian Zoffoli <czoffoli@littlepenguin.org> 1.61-3jpp
2762918
- removed packager tag
2762918
- new jpp extension
2762918
2762918
* Fri Nov 09 2001 Christian Zoffoli <czoffoli@littlepenguin.org> 1.61-2jpp
2762918
- added BuildRequires:	servletapi3 ant
2762918
- added Requires:	servletapi3 ant
2762918
2762918
* Fri Nov 09 2001 Christian Zoffoli <czoffoli@littlepenguin.org> 1.61-1jpp
2762918
- complete spec restyle
2762918
- splitted & improved linuxization patch
2762918
2762918
* Fri Nov 09 2001 Christian Zoffoli <czoffoli@littlepenguin.org> 1.60-1jpp
2762918
- 1.60 first "official release" of Hsqldb
2762918
2762918
* Fri Nov 09 2001 Christian Zoffoli <czoffoli@littlepenguin.org> 1.43-2jpp
2762918
- fixed version
2762918
2762918
* Fri Nov 09 2001 Christian Zoffoli <czoffoli@littlepenguin.org> 1.43-1jpp
2762918
- first release
2762918
- linuxization patch (doc + script)
2762918