File h2.spec of Package h2

# norootforbuild
Name:           h2
Version:        1.2.145
Release:        1
Summary:        An RDBMS written in a pure Java.
Group:          Development/Java
License:        MPL/EPL
Source0:        h2-1.2.145.tar.bz2
Requires: servletapi5
Requires: lucene
BuildRequires: ant >= 1.7
BuildRequires: jpackage-utils
BuildRequires: geronimo-servlet-2_5-api
BuildRequires: slf4j
BuildRequires: felix-osgi-core
BuildRequires: lucene
BuildRequires: zip
BuildArch:      noarch
Source2: h2.jar-OSGi-MANIFEST.MF

H2 is a relational database management system written in Java.
It can be embedded in Java applications or run in the client-server mode.
The main features of H2 are:
* Very fast, open source, JDBC API
* Embedded and server modes; in-memory databases
* Browser based Console application
* Small footprint: around 1 MB jar file size 

%setup -q

# XXX: allows easy servlet upgrade
rm src/test/org/h2/test/unit/
%{__perl} -p -e 's/\@version\@/%{version}/g;' src/installer/pom-template.xml > %{name}-%{version}.pom

%{_bindir}/find -type f -name "*.jar" | %{_bindir}/xargs -t %{__rm}

%{__mkdir_p} ext

%{__ln_s} $(build-classpath servlet_2_5_api) ext/servlet-api-2.4.jar
%{__ln_s} $(build-classpath lucene) ext/lucene-core-2.2.0.jar
%{__ln_s} $(build-classpath felix/org.osgi.core) ext/org.osgi.core-1.2.0.jar
%{__ln_s} $(build-classpath slf4j/api) ext/slf4j-api-1.5.0.jar
ls ext

%{ant} all

%__rm -rf %{buildroot}

# jar
%{__mkdir_p} %{buildroot}%{_javadir}
%{__cp} -p bin/h2.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do %{__ln_s} ${jar} ${jar/-%{version}/}; done)

# pom
%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/maven2/poms
%{__cp} -p %{name}-%{version}.pom $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-%{name}.pom
%add_to_maven_depmap com.h2database h2 %{version} JPP %{name}

# inject OSGi manifest h2.jar-OSGi-MANIFEST.MF
rm -rf META-INF
mkdir -p META-INF
# update even MANIFEST.MF already exists
/usr/bin/zip -v %buildroot/usr/share/java/h2.jar META-INF/MANIFEST.MF
# end inject OSGi manifest h2.jar-OSGi-MANIFEST.MF


* Thu Apr 14 2011 Bo Maryniuk <>
- Adapted for openSUSE

* Sat Mar 12 2011 Igor Vlasenko <> 0:1.2.145-alt2_2jpp6
- added OSGi manifest

* Sat Mar 12 2011 Igor Vlasenko <> 0:1.2.145-alt1_2jpp6
- new version

* Mon Oct 18 2010 Igor Vlasenko <> 1.1.119-alt1_1jpp6
- new version