Matt Wringe 228dfec
# Copyright (c) 2000-2005, JPackage Project
Matt Wringe 228dfec
# All rights reserved.
Matt Wringe 228dfec
#
Matt Wringe 228dfec
# Redistribution and use in source and binary forms, with or without
Matt Wringe 228dfec
# modification, are permitted provided that the following conditions
Matt Wringe 228dfec
# are met:
Matt Wringe 228dfec
#
Matt Wringe 228dfec
# 1. Redistributions of source code must retain the above copyright
Matt Wringe 228dfec
#    notice, this list of conditions and the following disclaimer.
Matt Wringe 228dfec
# 2. Redistributions in binary form must reproduce the above copyright
Matt Wringe 228dfec
#    notice, this list of conditions and the following disclaimer in the
Matt Wringe 228dfec
#    documentation and/or other materials provided with the
Matt Wringe 228dfec
#    distribution.
Matt Wringe 228dfec
# 3. Neither the name of the JPackage Project nor the names of its
Matt Wringe 228dfec
#    contributors may be used to endorse or promote products derived
Matt Wringe 228dfec
#    from this software without specific prior written permission.
Matt Wringe 228dfec
#
Matt Wringe 228dfec
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Matt Wringe 228dfec
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Matt Wringe 228dfec
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Matt Wringe 228dfec
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
Matt Wringe 228dfec
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Matt Wringe 228dfec
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Matt Wringe 228dfec
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Matt Wringe 228dfec
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Matt Wringe 228dfec
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Matt Wringe 228dfec
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Matt Wringe 228dfec
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Matt Wringe 228dfec
#
Matt Wringe 228dfec
Matt Wringe 445c398
%define _without_gcj_support 1
Matt Wringe 228dfec
Matt Wringe 228dfec
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
Matt Wringe 228dfec
Matt Wringe 445c398
%define _with_maven 1
Matt Wringe 228dfec
Matt Wringe 228dfec
%define with_maven %{!?_without_maven:1}%{?_without_maven:0}
Matt Wringe 228dfec
%define without_maven %{?_without_maven:1}%{!?_without_maven:0}
Matt Wringe 228dfec
Matt Wringe 445c398
%define cvs_version     0.9.94
Matt Wringe 228dfec
%define repo_dir    .m2/repository
Matt Wringe 228dfec
Matt Wringe 228dfec
Name:           jline
Matt Wringe 445c398
Version:        0.9.94
c7b5293
Release:        0.2%{?dist}
Matt Wringe 228dfec
Epoch:          0
Matt Wringe 228dfec
Summary:        Java library for reading and editing user input in console applications
Matt Wringe 228dfec
License:        BSD
Matt Wringe 228dfec
URL:            http://jline.sf.net/
Matt Wringe 228dfec
Group:          Development/Libraries
Matt Wringe 228dfec
Source0:        http://download.sourceforge.net/sourceforge/jline/jline-%{cvs_version}.zip
Matt Wringe 228dfec
Source1:        CatalogManager.properties
Matt Wringe 228dfec
Source2:        jline-build.xml
c7b5293
Requires:       bash
c7b5293
# for /bin/stty
c7b5293
Requires:       coreutils
Matt Wringe 228dfec
BuildRequires:  jpackage-utils >= 0:1.7
Matt Wringe 228dfec
%if %{with_maven}
Matt Wringe 228dfec
BuildRequires:  xml-commons-resolver
Matt Wringe 228dfec
BuildRequires:  maven2
Matt Wringe 228dfec
BuildRequires:  maven2-plugin-resources
Matt Wringe 445c398
BuildRequires:  maven2-plugin-compiler
Matt Wringe 445c398
BuildRequires:  maven2-plugin-surefire
Matt Wringe 445c398
BuildRequires:  maven2-plugin-jar
Matt Wringe 445c398
BuildRequires:  maven2-plugin-install
Matt Wringe 445c398
BuildRequires:  maven2-plugin-assembly
Matt Wringe 445c398
BuildRequires:  maven2-plugin-site
Matt Wringe 445c398
BuildRequires:  maven2-plugin-javadoc
Matt Wringe 228dfec
BuildRequires:  ant-apache-resolver
Matt Wringe 228dfec
%else
Matt Wringe 228dfec
BuildRequires:  ant
Matt Wringe 228dfec
BuildRequires:  junit
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
%if ! %{gcj_support}
Matt Wringe 228dfec
BuildArch:      noarch
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Matt Wringe 228dfec
Matt Wringe 228dfec
%if %{gcj_support}
Matt Wringe 228dfec
BuildRequires:          java-gcj-compat-devel
Matt Wringe 228dfec
Requires(post):         java-gcj-compat
Matt Wringe 228dfec
Requires(postun):       java-gcj-compat
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
%description
Matt Wringe 228dfec
JLine is a java library for reading and editing user input in console
Matt Wringe 228dfec
applications. It features tab-completion, command history, password
Matt Wringe 228dfec
masking, customizable keybindings, and pass-through handlers to use to
Matt Wringe 228dfec
chain to other console applications.
Matt Wringe 228dfec
Matt Wringe 228dfec
%package        demo
Matt Wringe 228dfec
Summary:        Demos for %{name}
Matt Wringe 228dfec
Group:          Development/Documentation
Matt Wringe 228dfec
Matt Wringe 228dfec
%if %{gcj_support}
Matt Wringe 228dfec
BuildRequires:          java-gcj-compat-devel
Matt Wringe 228dfec
Requires(post):         java-gcj-compat
Matt Wringe 228dfec
Requires(postun):       java-gcj-compat
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
%description    demo
Matt Wringe 228dfec
Demonstrations and samples for %{name}.
Matt Wringe 228dfec
Matt Wringe 228dfec
# FIXME: the maven ant:ant generated build.xml file does not contain 
Matt Wringe 228dfec
#        a javadoc task
Matt Wringe 228dfec
%if %{with_maven}
Matt Wringe 228dfec
%package        javadoc
Matt Wringe 228dfec
Summary:        Javadoc for %{name}
Matt Wringe 228dfec
Group:          Development/Documentation
Matt Wringe 228dfec
Matt Wringe 228dfec
%if %{gcj_support}
Matt Wringe 228dfec
BuildRequires:          java-gcj-compat-devel
Matt Wringe 228dfec
Requires(post):         java-gcj-compat
Matt Wringe 228dfec
Requires(postun):       java-gcj-compat
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
%description    javadoc
Matt Wringe 228dfec
Javadoc for %{name}.
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
%prep
Matt Wringe 228dfec
# BEWARE: The jar file META-INF is not under the subdir
Matt Wringe 228dfec
%setup -q -c -n %{name}-%{cvs_version}
Matt Wringe 228dfec
cp -pr %{name}-%{cvs_version}/* .
Matt Wringe 228dfec
rm -fr %{name}-%{cvs_version}
Matt Wringe 228dfec
Matt Wringe 228dfec
# Use locally installed DTDs
Matt Wringe 228dfec
mkdir %{_builddir}/%{name}-%{cvs_version}/build
Matt Wringe 228dfec
cp -p %SOURCE1 %{_builddir}/%{name}-%{cvs_version}/build/
Matt Wringe 228dfec
Matt Wringe 228dfec
cp -p %{SOURCE2} src/build.xml
Matt Wringe 228dfec
Matt Wringe 228dfec
%build
Matt Wringe 228dfec
mkdir -p native
Matt Wringe 228dfec
# Now done by Patch0 for documentation purposes
Matt Wringe 228dfec
#perl -p -i -e 's|^.*
Matt Wringe 228dfec
Matt Wringe 228dfec
# Use locally installed DTDs
Matt Wringe 228dfec
export CLASSPATH=%{_builddir}/%{name}-%{cvs_version}/build
Matt Wringe 228dfec
Matt Wringe 228dfec
cd src/
Matt Wringe 228dfec
Matt Wringe 228dfec
%if %{with_maven}
Matt Wringe 228dfec
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
Matt Wringe 228dfec
mkdir -p $MAVEN_REPO_LOCAL
Matt Wringe 228dfec
Matt Wringe 228dfec
mvn-jpp \
Matt Wringe 228dfec
        -e \
Matt Wringe 228dfec
                -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
Matt Wringe 228dfec
                -Dmaven.test.failure.ignore=true \
Matt Wringe 228dfec
        install javadoc:javadoc
Matt Wringe 228dfec
%else
Matt Wringe 228dfec
mkdir -p $(pwd)/.m2/repository
Matt Wringe 228dfec
build-jar-repository $(pwd)/.m2/repository junit
Matt Wringe 228dfec
export CLASSPATH=target/classes
Matt Wringe 228dfec
ant -Dbuild.sysclasspath="only" -Duser.home=$(pwd) 
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
%install
Matt Wringe 228dfec
rm -rf $RPM_BUILD_ROOT
Matt Wringe 228dfec
# jars
Matt Wringe 228dfec
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
Matt Wringe 228dfec
for jar in $(find -type f -name "*.jar" | grep -E target/.*.jar); do
Matt Wringe 228dfec
        install -m 644 $jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
Matt Wringe 228dfec
done
Matt Wringe 228dfec
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do \
Matt Wringe 228dfec
ln -sf ${jar} ${jar/-%{version}/}; done)
Matt Wringe 228dfec
Matt Wringe 228dfec
# the maven ant:ant task did not generate a build.xml file with a javadoc task
Matt Wringe 228dfec
%if %{with_maven}
Matt Wringe 228dfec
# javadoc
Matt Wringe 228dfec
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
Matt Wringe 228dfec
for target in $(find -type d -name target); do
Matt Wringe 228dfec
        install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/`basename \`dirname $target\` | sed -e s:jline-::g`
Matt Wringe 228dfec
        cp -pr $target/site/apidocs/* $jar $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/`basename \`dirname $target\` | sed -e s:jline-::g`
Matt Wringe 228dfec
done
Matt Wringe 228dfec
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} 
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
%if %{gcj_support}
Matt Wringe 228dfec
%{_bindir}/aot-compile-rpm
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
%clean
Matt Wringe 228dfec
rm -rf $RPM_BUILD_ROOT
Matt Wringe 228dfec
rm -rf $RPM_BUILD_DIR/META-INF
Matt Wringe 228dfec
Matt Wringe 228dfec
%if %{gcj_support}
Matt Wringe 228dfec
%post
Matt Wringe 228dfec
if [ -x %{_bindir}/rebuild-gcj-db ]
Matt Wringe 228dfec
then
Matt Wringe 228dfec
  %{_bindir}/rebuild-gcj-db
Matt Wringe 228dfec
fi
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
%if %{gcj_support}
Matt Wringe 228dfec
%postun
Matt Wringe 228dfec
if [ -x %{_bindir}/rebuild-gcj-db ]
Matt Wringe 228dfec
then
Matt Wringe 228dfec
  %{_bindir}/rebuild-gcj-db
Matt Wringe 228dfec
fi
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
%files
Matt Wringe 228dfec
%defattr(0644,root,root,0755)
Matt Wringe 228dfec
%{_javadir}/%{name}.jar
Matt Wringe 228dfec
%{_javadir}/%{name}-%{version}.jar
Matt Wringe 228dfec
%doc LICENSE.txt
Matt Wringe 228dfec
Matt Wringe 228dfec
%if %{with_maven}
Matt Wringe 228dfec
%if %{gcj_support}
Matt Wringe 228dfec
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
Matt Wringe 228dfec
%attr(-,root,root) %{_libdir}/gcj/%{name}/jline-0.9.9.jar.*
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
%files javadoc
Matt Wringe 228dfec
%defattr(0644,root,root,0755)
Matt Wringe 228dfec
%doc %{_javadocdir}/*
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
#FIXME: add javadoc support to generated build.xml
Matt Wringe 228dfec
Matt Wringe 228dfec
%if %{gcj_support}
Matt Wringe 228dfec
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
Matt Wringe 228dfec
%attr(-,root,root) %{_libdir}/gcj/%{name}/jline-0.9.9.jar.*
Matt Wringe 228dfec
%endif
Matt Wringe 228dfec
Matt Wringe 228dfec
%changelog
c7b5293
* Wed Jul  9 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0:9.94-0.2
c7b5293
- drop repotag
c7b5293
Matt Wringe 445c398
* Mon Mar 24 2008 Matt Wringe <mwringe@redhat.com> - 0:9.94-0jpp.1
Matt Wringe 445c398
- Update to 0.9.94 (BZ #436204)
Matt Wringe 445c398
fe116e8
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0:0.9.9-2jpp.1
fe116e8
- Autorebuild for GCC 4.3
fe116e8
Matt Wringe 228dfec
* Tue Mar 06 2007 Matt Wringe <mwringe@redhat.com> - 0:0.9.9-1jpp.1
Matt Wringe 228dfec
- Add option to build with ant.
Matt Wringe 228dfec
- Fix various rpmlint issues
Matt Wringe 228dfec
- Specify proper license
Matt Wringe 228dfec
Matt Wringe 228dfec
* Thu May 04 2006 Alexander Kurtakov <akurtkov at gmail.com> - 0:0.9.9-1jpp
Matt Wringe 228dfec
- Upgrade to 0.9.9
Matt Wringe 228dfec
Matt Wringe 228dfec
* Thu May 04 2006 Ralph Apel <r.apel at r-apel.de> - 0:0.9.5-1jpp
Matt Wringe 228dfec
- Upgrade to 0.9.5
Matt Wringe 228dfec
- First JPP-1.7 release
Matt Wringe 228dfec
Matt Wringe 228dfec
* Mon Apr 25 2005 Fernando Nasser <fnasser@redhat.com> - 0:0.9.1-1jpp
Matt Wringe 228dfec
- Upgrade to 0.9.1
Matt Wringe 228dfec
- Disable attempt to include external jars
Matt Wringe 228dfec
Matt Wringe 228dfec
* Mon Apr 25 2005 Fernando Nasser <fnasser@redhat.com> - 0:0.8.1-3jpp
Matt Wringe 228dfec
- Changes to use locally installed DTDs
Matt Wringe 228dfec
- Do not try and access sun site for linking javadoc
Matt Wringe 228dfec
Matt Wringe 228dfec
* Sun Aug 23 2004 Randy Watler <rwatler at finali.com> - 0:0.8.1-2jpp
Matt Wringe 228dfec
- Rebuild with ant-1.6.2
Matt Wringe 228dfec
Matt Wringe 228dfec
* Mon Jan 26 2004 David Walluck <david@anti-microsoft.org> 0:0.8.1-1jpp
Matt Wringe 228dfec
- release