%global majorversion %(echo %(echo %version | cut -d. -f1-2) | tr . _) Name: hsqldb2 Version: 2.2.8 Release: 1%{?dist} Summary: HyperSQL Database Engine Group: Development/Libraries License: BSD Url: http://hsqldb.org/ Source0: http://sourceforge.net/projects/hsqldb/files/hsqldb/hsqldb_%{majorversion}/hsqldb-%{version}.zip # svn export https://hsqldb.svn.sourceforge.net/svnroot/hsqldb/base/tags/2.2.8/doc-src/ doc-src # tar czf hsqldb-2.2.8-doc-src.tar.gz doc-src Source1: hsqldb-%{version}-doc-src.tar.gz Source2: http://www.hsqldb.org/repos/org/hsqldb/hsqldb/%{version}/hsqldb-%{version}.pom Source3: http://www.hsqldb.org/repos/org/hsqldb/sqltool/%{version}/sqltool-%{version}.pom # remove classpath from manifest Patch0: hsqldb-%{version}-build.patch # remove ivy and gradle reference Patch1: hsqldb-%{version}-osgi.patch BuildRequires: java-devel BuildRequires: java-javadoc BuildRequires: jpackage-utils BuildRequires: ant BuildRequires: aqute-bndlib BuildRequires: jflex BuildRequires: tomcat-servlet-3.0-api Requires: java Requires: jpackage-utils BuildArch: noarch %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 javadoc Group: Documentation Summary: Javadoc for %{name} Requires: jpackage-utils %description javadoc This package contains javadoc for %{name}. %prep %setup -q -n hsqldb-%{version} find -name "*.jar" -type f -exec rm {} \; find -name "*.class" -type f -exec rm {} \; find -name "*.zip" -type f -exec rm {} \; find -name "*.bat" -type f -exec rm {} \; ( cd hsqldb rm -rf doc/* ln -sf $(build-classpath jflex) lib/JFlex.jar ln -sf $(build-classpath tomcat-servlet-3.0-api) lib/servlet-2_3-fcs-classfiles.zip tar -xf %{SOURCE1} # Failed to read pathlist file 'hsqldb-2.2.8/hsqldb/jdkcodeswitch.list' cp -p build/jdkcodeswitch.list . ) %patch0 -p0 %patch1 -p0 # fix non ASCII chars for s in hsqldb/src/org/hsqldb/lib/KMPSearchAlgorithm.java;do native2ascii -encoding UTF8 ${s} ${s} done %build ( cd hsqldb ant -f build/build.xml \ -Dant.build.javac.target=1.7 \ -Dant.build.javac.source=1.7 \ -Dbndjar.file=$(build-classpath aqute-bndlib) \ hsqldb sqltool javadoc osgi ) %install mkdir -p %{buildroot}%{_javadir}/%{name} ( cd hsqldb install -pm 644 lib/hsqldb-osgi.jar %{buildroot}%{_javadir}/%{name}/hsqldb.jar install -pm 644 lib/sqltool.jar %{buildroot}%{_javadir}/%{name}/ mkdir -p %{buildroot}%{_javadocdir}/%{name} cp -rp doc/apidocs/* %{buildroot}%{_javadocdir}/%{name} ) mkdir -p %{buildroot}%{_mavenpomdir} install -pm 644 %{SOURCE2} %{buildroot}%{_mavenpomdir}/JPP.%{name}-hsqldb.pom %add_maven_depmap JPP.%{name}-hsqldb.pom %{name}/hsqldb.jar install -pm 644 %{SOURCE3} %{buildroot}%{_mavenpomdir}/JPP.%{name}-sqltool.pom %add_maven_depmap JPP.%{name}-sqltool.pom %{name}/sqltool.jar %files %{_javadir}/%{name}/*.jar %{_mavenpomdir}/JPP.%{name}-*.pom %{_mavendepmapfragdir}/%{name} %doc hsqldb/index.html hsqldb/readme.txt %files javadoc %{_javadocdir}/%{name} %changelog * Mon Apr 23 2012 gil cattaneo 2.2.8-1 - initial rpm