%define pkgver %(echo %version|tr . _) %define majver %(echo %pkgver | cut -d_ -f 1-3) %define with_gcj 1 Name: java-hsqldb Version: 1.8.0.10 Release: 3mamba Summary: Lightweight 100% Java SQL Database Engine Group: Applications/Databases Vendor: openmamba Distribution: openmamba Packager: Silvan Calarco URL: http://hsqldb.org Source0: http://sourceforge.net/projects/hsqldb/files/hsqldb/hsqldb_%{majver}/hsqldb_%{pkgver}.zip Source1: java-hsqldb-1.8.0.10-standard.cfg Source2: java-hsqldb-1.8.0.10-standard-server.properties Source3: java-hsqldb-1.8.0.10-standard-webserver.properties Source4: java-hsqldb-1.8.0.10-standard-sqltool.rc Source5: java-hsqldb-1.8.0.10-component-info.xml Source6: http://mirrors.ibiblio.org/pub/mirrors/maven2/hsqldb/hsqldb/%{version}/hsqldb-%{version}.pom Patch0: java-hsqldb-1.8.0.10-scripts.patch Patch1: java-hsqldb-1.8.0.10-tmp.patch Patch2: java-hsqldb-1.8.0.10-alt-init.patch Patch3: java-hsqldb-1.8.0.10-specify-su-shell.patch Patch4: java-hsqldb-1.8.0.10-libreoffice-i96823.patch Patch5: java-hsqldb-1.8.0.10-libreoffice-i97032.patch Patch6: java-hsqldb-1.8.0.10-libreoffice-i103528.patch Patch7: java-hsqldb-1.8.0.10-libreoffice-i104901.patch License: BSD ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel BuildRequires: java-gcj-compat BuildRequires: libgcc BuildRequires: libgcj4-devel BuildRequires: libz-devel ## AUTOBUILDREQ-END BuildRequires: apache-ant %if "%{stage1}" != "1" BuildRequires: apache-tomcat5-servletapi5 %endif BuildRequires: java-junit3 BuildRequires: jpackage-utils %if "%{stage1}" != "1" Requires: apache-tomcat5-servletapi5 %endif Requires: coreutils Requires: initscripts Requires: shadow-common Obsoletes: hsqldb Provides: hsqldb BuildRoot: %{_tmppath}/%{name}-%{version}-root %description HSQLDB is a relational database engine written in Java, with a JDBC driver, supporting a large subset of ANSI-92 SQL. A small, fast engine with both in memory and disk based tables. This product is the continuation of HypersonicSQL. Active since 2001. %package demo Group: Documentation Summary: Demo for %{name} Requires: %{name} = %{version}-%{release} %description demo HSQLDB is a relational database engine written in Java, with a JDBC driver, supporting a large subset of ANSI-92 SQL. A small, fast engine with both in memory and disk based tables. This product is the continuation of HypersonicSQL. Active since 2001. This package contains demonstrations and samples for %{name}. %package javadoc Group: Documentation Summary: Javadoc for %{name} %description javadoc HSQLDB is a relational database engine written in Java, with a JDBC driver, supporting a large subset of ANSI-92 SQL. A small, fast engine with both in memory and disk based tables. This product is the continuation of HypersonicSQL. Active since 2001. This package contains javadoc for %{name}. %package manual Group: Documentation Summary: Manual for %{name} %description manual HSQLDB is a relational database engine written in Java, with a JDBC driver, supporting a large subset of ANSI-92 SQL. A small, fast engine with both in memory and disk based tables. This product is the continuation of HypersonicSQL. Active since 2001. This package contains documentation for %{name}. %if %with_gcj %package gcj Group: System/Libraries/Java Summary: GCJ support for %{name} Requires: java-gcj-compat %description gcj Lightweight 100% Java SQL Database Engine. This package contains GCJ support for %{name}. %endif %prep %setup -q -n hsqldb for j in $(find . -name "*.jar"); do mv $j $j.no done for j in $(find . -name "*.sh"); do chmod 755 $j done for dir in $(find . -name _notes); do rm -rf $dir done for dir in $(find . -name "*.class"); do rm -rf $dir done for dir in $(find . -name "*.war"); do rm -rf $dir done find . -type f -name '*.css' -o -name '*.html' -o -name '*.txt' | xargs -t perl -pi -e 's/\r$//g' chmod -R go=u-w * cp %{SOURCE6} pom.xml %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p0 %patch4 -p0 %patch5 -p0 %patch6 -p0 %patch7 -p1 %build export JAVA_HOME=%{_jvmdir}/jdk %if "%{stage1}" != "1" export CLASSPATH=$(build-classpath servletapi5 junit-3.8.2):$JAVA_HOME/jre/lib/jsse.jar:$JAVA_HOME/jre/lib/rt.jar %else mv lib/servlet.jar.no lib/servlet.jar export CLASSPATH=$(build-classpath junit-3.8.2):$JAVA_HOME/jre/lib/jsse.jar:$JAVA_HOME/jre/lib/rt.jar %endif pushd build ant jar javadoc popd %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" mkdir -p %{buildroot}%{_javadir} install -pm 755 lib/hsqldb.jar %{buildroot}%{_javadir}/hsqldb-%{version}.jar ( cd %{buildroot}%{_javadir} for jar in *-%{version}.jar; do ln -sf ${jar} ${jar/-%{version}/} done ) mkdir -p %{buildroot}%{_bindir} install -m 755 bin/runUtil.sh %{buildroot}%{_bindir}/RunUtil mkdir -p %{buildroot}%{_initrddir} install -m 755 bin/hsqldb %{buildroot}%{_initrddir}/hsqldb mkdir -p %{buildroot}%{_sysconfdir}/sysconfig install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/hsqldb mkdir -p %{buildroot}%{_localstatedir}/lib/hsqldb install -m 644 %{SOURCE2} %{buildroot}%{_localstatedir}/lib/hsqldb/server.properties install -m 644 %{SOURCE3} %{buildroot}%{_localstatedir}/lib/hsqldb/webserver.properties install -m 600 %{SOURCE4} %{buildroot}%{_localstatedir}/lib/hsqldb/sqltool.rc mkdir -p %{buildroot}%{_localstatedir}/lib/hsqldb/lib install -m 644 lib/functions %{buildroot}%{_localstatedir}/lib/hsqldb/lib pushd %{buildroot}%{_localstatedir}/lib/hsqldb/lib ln -s %{_javadir}/hsqldb-%{version}.jar hsqldb.jar ln -s $(build-classpath servletapi5) servlet.jar popd mkdir -p %{buildroot}%{_localstatedir}/lib/hsqldb/data mkdir -p %{buildroot}%{_datadir}/hsqldb/demo install -m 755 demo/*.sh %{buildroot}%{_datadir}/hsqldb/demo install -m 644 demo/*.html %{buildroot}%{_datadir}/hsqldb/demo mkdir -p %{buildroot}%{_javadocdir}/hsqldb-%{version} cp -r doc/src/* %{buildroot}%{_javadocdir}/hsqldb-%{version} ln -s hsqldb-%{version} %{buildroot}%{_javadocdir}/hsqldb rm -rf doc/src mkdir -p %{buildroot}%{_mavenpomdir} install -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-hsqldb.pom %add_to_maven_depmap nhsqldb hsqldb %{version} JPP hsqldb %if %with_gcj %{_bindir}/aot-compile-rpm %endif %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %preun if [ $1 = 0 ] ; then /sbin/service hsqldb stop >/dev/null 2>&1 /sbin/chkconfig --del hsqldb fi %pre %{_sbindir}/groupadd -g 96 -f -r hsqldb 2> /dev/null || : %{_sbindir}/useradd -u 96 -g hsqldb -s /sbin/nologin \ -d %{_localstatedir}/lib/hsqldb -r hsqldb 2> /dev/null || : %post /sbin/chkconfig --add hsqldb %update_maven_depmap %postun %update_maven_depmap %files %defattr(-,root,root) %config(noreplace) %attr(644,root,root) %{_sysconfdir}/sysconfig/hsqldb %attr(755,root,root) %{_initrddir}/hsqldb %{_bindir}/RunUtil %dir %{_localstatedir}/lib/hsqldb %dir %{_localstatedir}/lib/hsqldb/lib %{_localstatedir}/lib/hsqldb/lib/hsqldb.jar %{_localstatedir}/lib/hsqldb/lib/servlet.jar %attr(644,root,root) %{_localstatedir}/lib/hsqldb/lib/functions %attr(644,root,root) %{_localstatedir}/lib/hsqldb/server.properties %attr(644,root,root) %{_localstatedir}/lib/hsqldb/webserver.properties %attr(600,hsqldb,hsqldb) %{_localstatedir}/lib/hsqldb/sqltool.rc %dir %attr(755,hsqldb,hsqldb) %{_localstatedir}/lib/hsqldb/data %{_javadir}/hsqldb-%{version}.jar %{_javadir}/hsqldb.jar %{_mavenpomdir} %{_mavendepmapfragdir} %doc readme.txt doc/hsqldb_lic.txt %files demo %defattr(-,root,root) %dir %{_datadir}/hsqldb %{_datadir}/hsqldb/demo %files javadoc %defattr(-,root,root) %{_javadocdir}/hsqldb-%{version} %{_javadocdir}/hsqldb %files manual %defattr(-,root,root) %doc doc/* index.html %if %with_gcj %post gcj if [ -x %{_bindir}/rebuild-gcj-db ] ; then %{_bindir}/rebuild-gcj-db fi %postun gcj if [ -x %{_bindir}/rebuild-gcj-db ] ; then %{_bindir}/rebuild-gcj-db fi %files gcj %defattr(-,root,root) %{_libdir}/gcj/java-hsqldb/hsqldb-%{version}.jar.db %{_libdir}/gcj/java-hsqldb/hsqldb-%{version}.jar.so %endif %changelog * Thu Jan 27 2011 gil 1.8.0.10-3mamba - rebuilt with java-openjdk - add gcj support - add libreoffice patches * Tue Mar 03 2009 gil 1.8.0.10-2mamba - added manual and javadoc pakage - added system junit (java-junit3) and servlet (tomcat5) support - added %%pre %%post %%preun scripts - renamed java-hsqldb * Thu Jul 10 2008 Silvan Calarco 1.8.0-1mamba - package created by autospec