A new user interface for you! Read more...

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
URL:            http://www.h2database.com/html/main.html
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
Source1: import.info
Source2: h2.jar-OSGi-MANIFEST.MF

%description
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 

%prep
%setup -q

# XXX: allows easy servlet upgrade
rm src/test/org/h2/test/unit/TestServlet.java
%{__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

%build
%{ant} all
#%{_javadir}/%{name}-%{version}.jar

%install
%__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
cp %{SOURCE2} META-INF/MANIFEST.MF
# update even MANIFEST.MF already exists
# touch META-INF/MANIFEST.MF
/usr/bin/zip -v %buildroot/usr/share/java/h2.jar META-INF/MANIFEST.MF
# end inject OSGi manifest h2.jar-OSGi-MANIFEST.MF


%files
#%{_javadir}/%{name}-%{version}.jar
#%{_javadir}/%{name}database.jar
%{_javadir}
%{_datadir}/maven2/poms/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}

%changelog
* Thu Apr 14 2011 Bo Maryniuk <bo@suse.de>
- Adapted for openSUSE

* Sat Mar 12 2011 Igor Vlasenko <viy@altlinux.ru> 0:1.2.145-alt2_2jpp6
- added OSGi manifest

* Sat Mar 12 2011 Igor Vlasenko <viy@altlinux.ru> 0:1.2.145-alt1_2jpp6
- new version

* Mon Oct 18 2010 Igor Vlasenko <viy@altlinux.ru> 1.1.119-alt1_1jpp6
- new version