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 gcj_support 1 |
33 |
%define section free |
34 |
|
35 |
Name: libreadline-java |
36 |
Version: 0.8.1 |
37 |
Release: %mkrel 1.8 |
38 |
Epoch: 0 |
39 |
Summary: Java wrapper for the GNU-readline library |
40 |
License: LGPL |
41 |
URL: http://java-readline.sourceforge.net/ |
42 |
Source0: http://download.sourceforge.net/java-readline/libreadline-java-%{version}-src.tar.gz |
43 |
BuildRequires: java-rpmbuild >= 0:1.6 |
44 |
%if %with readline |
45 |
BuildRequires: libreadline-devel |
46 |
%else |
47 |
BuildRequires: edit-devel |
48 |
%endif |
49 |
BuildRequires: libtermcap-devel |
50 |
Provides: java_readline = %{epoch}-%{version}-%{release} |
51 |
Provides: gnu.readline = %{epoch}-%{version}-%{release} |
52 |
Group: Development/Java |
53 |
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
54 |
#Distribution: JPackage |
55 |
#Vendor: JPackage Project |
56 |
%if %{gcj_support} |
57 |
BuildRequires: java-gcj-compat-devel |
58 |
%else |
59 |
BuildRequires: java-devel >= 0:1.4.2 |
60 |
%endif |
61 |
|
62 |
%description |
63 |
Java-Readline is a port of GNU Readline for Java. Or, to be more |
64 |
precise, it is a JNI-wrapper to Readline. It is distributed under |
65 |
the LGPL. |
66 |
|
67 |
%package javadoc |
68 |
Summary: Javadoc for %{name} |
69 |
Group: Development/Java |
70 |
|
71 |
%description javadoc |
72 |
Javadoc for %{name}. |
73 |
|
74 |
%prep |
75 |
%setup -q |
76 |
%{_bindir}/find . -type d -name CVS | %{_bindir}/xargs -t %{__rm} -r |
77 |
%{_bindir}/find . -type f -name "*.dll" | %{_bindir}/xargs -t %{__rm} |
78 |
%{__perl} -pi -e 's|javadoc |%{javadoc} |g;' \ |
79 |
-e 's|jar -c|%{jar} -c|g;' \ |
80 |
Makefile |
81 |
|
82 |
%build |
83 |
export JAVA_HOME=%{java_home} |
84 |
%if %with readline |
85 |
%{__make} T_LIBS=JavaReadline JAVAC=%{javac} JC_FLAGS="" LIBPATH="-L%{_libdir}" |
86 |
%else |
87 |
%{__make} T_LIBS=JavaEditline JAVAC=%{javac} JC_FLAGS="" LIBPATH="-L%{_libdir}" |
88 |
%endif |
89 |
%{__make} apidoc |
90 |
|
91 |
%install |
92 |
%{__rm} -rf %{buildroot} |
93 |
# jar |
94 |
%{__mkdir_p} %{buildroot}%{_jnidir} |
95 |
%{__install} -m 644 %{name}.jar %{buildroot}%{_jnidir}/%{name}-%{version}.jar |
96 |
(cd %{buildroot}%{_jnidir} && for jar in *-%{version}*; do \ |
97 |
%{__ln_s} ${jar} ${jar/-%{version}/}; done) |
98 |
# lib |
99 |
%{__mkdir_p} %{buildroot}%{_libdir} |
100 |
%if %with readline |
101 |
%{__install} -m 755 libJavaReadline.so %{buildroot}%{_libdir}/libJavaReadline.so |
102 |
%else |
103 |
%{__install} -m 755 libJavaEditline.so %{buildroot}%{_libdir}/libJavaEditline.so |
104 |
%endif |
105 |
|
106 |
# javadoc |
107 |
%{__mkdir_p} %{buildroot}%{_javadocdir}/%{name}-%{version} |
108 |
%{__cp} -a api/* %{buildroot}%{_javadocdir}/%{name}-%{version} |
109 |
(cd %{buildroot}%{_javadocdir} && %{__ln_s} %{name}-%{version} %{name}) |
110 |
|
111 |
%if %{gcj_support} |
112 |
%{_bindir}/aot-compile-rpm |
113 |
%endif |
114 |
|
115 |
%clean |
116 |
%{__rm} -rf %{buildroot} |
117 |
|
118 |
%files |
119 |
%defattr(0644,root,root,0755) |
120 |
%doc COPYING.LIB NEWS README README.1st TODO VERSION contrib |
121 |
%attr(0755,root,root) %{_libdir}/*.so |
122 |
%{_jnidir}/*.jar |
123 |
%if %{gcj_support} |
124 |
%dir %{_libdir}/gcj/%{name} |
125 |
%attr(-,root,root) %{_libdir}/gcj/%{name}/* |
126 |
%endif |
127 |
|
128 |
%files javadoc |
129 |
%defattr(0644,root,root,0755) |
130 |
%{_javadocdir}/%{name}-%{version} |
131 |
%{_javadocdir}/%{name} |
132 |
|
133 |
|
134 |
|
135 |
|