File jisp2.spec of Package jisp2
#
# spec file for package jisp2
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define section free
Name: jisp2
Version: 2.5.1
Release: 0
Summary: The Java Indexed Serialization Package
License: Libpng
Group: Development/Libraries/Java
Url: http://www.coyotegulch.com/jisp/
Source0: jisp-2.5.1-source.tar.bz2
Patch0: jisp2-2.5.1-java5-enum.patch
Patch1: jisp2-2.5.1-javac-flags.patch
Requires(post): %{_sbindir}/update-alternatives
Requires(preun): %{_sbindir}/update-alternatives
# jisp-3.0.0 won't work with jakarta-turbine-jcs
BuildRequires: java-devel
BuildRequires: javapackages-tools
BuildRequires: make
Requires: javapackages-tools
Provides: hibernate_in_process_cache
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Jisp uses B-Tree and hash indexes for keyed access to variable-length
serialized objects stored in files.
%package demo
Summary: The Java Indexed Serialization Package
Group: Development/Libraries/Java
%description demo
Jisp uses B-Tree and hash indexes for keyed access to variable-length
serialized objects stored in files.
%package javadoc
Summary: The Java Indexed Serialization Package
Group: Development/Libraries/Java
%description javadoc
Jisp uses B-Tree and hash indexes for keyed access to variable-length
serialized objects stored in files.
%prep
%setup -q -n jisp-%{version}
%patch0 -p1
%{__perl} -pi -e 's/\r$//g' svfl.txt
%patch1 -b .java-cflags
%build
export CLASSPATH=
%{__make} JAVAC_FLAGS=" -target 1.5 -source 1.5"
%{__make} jars
%{__make} docs
%install
# jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
cp -p jisp.jar \
$RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
# javadoc
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr docs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# demo
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/lib
cp jisp-demo.jar $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}/lib
cp *.java $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
cp *.txt $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
# hibernate_in_process_cache ghost symlink
ln -s %{_sysconfdir}/alternatives \
$RPM_BUILD_ROOT%{_javadir}/hibernate_in_process_cache.jar
%clean
rm -rf $RPM_BUILD_ROOT
%post
%{_sbindir}/update-alternatives --install %{_javadir}/hibernate_in_process_cache.jar \
hibernate_in_process_cache %{_javadir}/%{name}.jar 30
%preun
{
[ $1 -eq 0 ] || exit 0
%{_sbindir}/update-alternatives --remove hibernate_in_process_cache %{_javadir}/%{name}.jar
} >/dev/null 2>&1 || :
%files
%defattr(0644,root,root,0755)
%doc svfl.txt
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%{_javadir}/hibernate_in_process_cache.jar
%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}-%{version}
%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog