1 |
# Copyright (c) 2000-2005, JPackage Project |
2 |
# All rights reserved. |
3 |
# |
4 |
# Redistribution and use in source and binary forms, with or without |
5 |
# modification, are permitted provided that the following conditions |
6 |
# are met: |
7 |
# |
8 |
# 1. Redistributions of source code must retain the above copyright |
9 |
# notice, this list of conditions and the following disclaimer. |
10 |
# 2. Redistributions in binary form must reproduce the above copyright |
11 |
# notice, this list of conditions and the following disclaimer in the |
12 |
# documentation and/or other materials provided with the |
13 |
# distribution. |
14 |
# 3. Neither the name of the JPackage Project nor the names of its |
15 |
# contributors may be used to endorse or promote products derived |
16 |
# from this software without specific prior written permission. |
17 |
# |
18 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 |
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 |
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
21 |
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 |
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 |
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 |
# |
30 |
|
31 |
%bcond_with readline |
32 |
%define section free |
33 |
|
34 |
Name: libreadline-java |
35 |
Version: 0.8.1 |
36 |
Release: %mkrel 1.12 |
37 |
Epoch: 0 |
38 |
Summary: Java wrapper for the GNU-readline library |
39 |
License: LGPL |
40 |
URL: http://java-readline.sourceforge.net/ |
41 |
Source0: http://download.sourceforge.net/java-readline/libreadline-java-%{version}-src.tar.gz |
42 |
BuildRequires: jpackage-utils >= 1.5 |
43 |
%if %with readline |
44 |
BuildRequires: libreadline-devel |
45 |
%else |
46 |
BuildRequires: edit-devel |
47 |
%endif |
48 |
# (cg) NB tinfo provides termcap compatibility |
49 |
BuildRequires: pkgconfig(tinfo) |
50 |
Group: Development/Java |
51 |
#Distribution: JPackage |
52 |
#Vendor: JPackage Project |
53 |
BuildRequires: java-devel >= 0:1.4.2 |
54 |
|
55 |
%description |
56 |
Java-Readline is a port of GNU Readline for Java. Or, to be more |
57 |
precise, it is a JNI-wrapper to Readline. It is distributed under |
58 |
the LGPL. |
59 |
|
60 |
%package javadoc |
61 |
Summary: Javadoc for %{name} |
62 |
Group: Development/Java |
63 |
BuildArch: noarch |
64 |
|
65 |
%description javadoc |
66 |
Javadoc for %{name}. |
67 |
|
68 |
%prep |
69 |
%setup -q |
70 |
find . -type d -name CVS -delete |
71 |
find . -type f -name "*.dll" -delete |
72 |
%{__perl} -pi -e 's|javadoc |%{javadoc} |g;' \ |
73 |
-e 's|jar -c|%{jar} -c|g;' \ |
74 |
Makefile |
75 |
|
76 |
%build |
77 |
export JAVA_HOME=%{java_home} |
78 |
%if %with readline |
79 |
%{__make} T_LIBS=JavaReadline JAVAC=%{javac} JC_FLAGS="" LIBPATH="-L%{_libdir}" |
80 |
%else |
81 |
%{__make} T_LIBS=JavaEditline JAVAC=%{javac} JC_FLAGS="" LIBPATH="-L%{_libdir}" |
82 |
%endif |
83 |
%{__make} apidoc |
84 |
|
85 |
%install |
86 |
# lib |
87 |
%{__mkdir_p} %{buildroot}%{_libdir} |
88 |
%if %with readline |
89 |
%{__install} -m 755 libJavaReadline.so %{buildroot}%{_libdir}/libJavaReadline.so |
90 |
% else |
91 |
%{__install} -m 755 libJavaEditline.so %{buildroot}%{_libdir}/libJavaEditline.so |
92 |
%endif |
93 |
# jar |
94 |
%{__mkdir_p} %{buildroot}%{_jnidir} |
95 |
%{__install} -pm 644 %{name}.jar %{buildroot}%{_jnidir}/%{name}.jar |
96 |
|
97 |
# javadoc |
98 |
%{__mkdir_p} %{buildroot}%{_javadocdir}/%{name} |
99 |
%{__cp} -a api/* %{buildroot}%{_javadocdir}/%{name} |
100 |
|
101 |
%files |
102 |
%doc COPYING.LIB NEWS README README.1st TODO VERSION contrib |
103 |
%attr(0755,root,root) %{_libdir}/*.so |
104 |
%{_jnidir}/*.jar |
105 |
|
106 |
%pre javadoc |
107 |
[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \ |
108 |
rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || : |
109 |
|
110 |
%files javadoc |
111 |
%{_javadocdir}/%{name} |
112 |
|
113 |
|
114 |
|
115 |
|