File libreadline-java.spec of Package libreadline-java

# spec file for package libreadline-java
# 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
# icecream 0

Name:           libreadline-java
Version:        0.8.0
Release:        0
Summary:        Java Wrapper for the EditLine Library
License:        LGPL-2.1+
Group:          Development/Libraries/Java
Source1:        baselibs.conf
Patch0:         libreadline-java-ncurses.patch
Patch1:         libreadline-java-libdir.patch
Patch2:         libreadline-java-0.8.0-missing-return-type.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  java-devel
BuildRequires:  javapackages-tools
BuildRequires:  libedit-devel >= 2.9
BuildRequires:  ncurses-devel

Provides:       gnu.readline
Provides:       java_readline

Requires:       java >= 1.4.2
Requires:       libedit >= 2.9

#BuildRequires:  fastjar
#BuildRequires:  gjdoc
#BuildRequires:  java-1_4_2-gcj-compat-devel
#BuildRequires:  readline-devel
#BuildRequires:  termcap
#BuildRequires:  unzip
#BuildRequires:  xerces-j2
#PreReq:         /sbin/ldconfig

libreadline-java provides Java bindings for libedit though a JNI

%package javadoc
PreReq:         coreutils
Summary:        Javadoc for libreadline-java
Group:          Development/Libraries/Java

%description javadoc
libreadline-java provides Java bindings for libedit though a JNI
wrapper. This package contains the javadoc documentation for it.

%setup -q -n %{name}-%{version}
%patch2 -p1
find . -name "*.jar" -exec rm -f {} \;
sed -i 's|@LIBDIR@|%{_libdir}|' src/org/gnu/readline/

export JAVA_HOME=%{java_home}
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
make T_LIBS=JavaEditline CFLAGS="%{optflags} -fPIC -DPOSIX"
make apidoc

# fix debuginfo package
rm -f org test
for dir in org test
  ln -s src/$dir

# install jar file and JNI library under %{_libdir}/%{name}
# FIXME: fix jpackage-utils to handle multilib correctly
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}
install -m 644 %{name}.jar \
install -m 755 $RPM_BUILD_ROOT%{_libdir}/%{name}

# javadoc
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -a api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}


%dir %{_libdir}/%{name}
%attr(-,root,root) %{_libdir}/%{name}/*

%files javadoc
%doc %{_javadocdir}/%{name}

openSUSE Build Service is sponsored by