Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > e474fa2c8f8336c918dbb56ef6894861 > files > 4

janino-2.5.15-0.0.2mdv2010.0.src.rpm

# Copyright (c) 2000-2007, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the JPackage Project nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
%define gcj_support 0

%define section free

Name:           janino
Version:        2.5.15
Release:        %mkrel 0.0.2
Epoch:          0
Summary:        An Embedded Java Compiler
License:        BSD-style
URL:            http://www.janino.net/
Group:          Development/Java
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Source0:        http://www.janino.net/download/%{name}-%{version}.zip
Source1:        janino-2.5.11.pom
Patch0:         janino-build_xml.patch
BuildRequires:  ant
BuildRequires:  java-rpmbuild
BuildRequires:  jpackage-utils >= 0:1.7.2
%if ! %{gcj_support}
BuildArch:      noarch
%endif
Requires(post):    jpackage-utils >= 0:1.7.2
Requires(postun):  jpackage-utils >= 0:1.7.2
%if %{gcj_support}
BuildRequires:    java-gcj-compat-devel
%endif

%description
Janino is a compiler that reads a JavaTM expression, block,
class body, source file or a set of source files, and
generates JavaTM bytecode that is loaded and executed
directly. Janino is not intended to be a development tool,
but an embedded compiler for run-time compilation purposes,
e.g. expression evaluators or "server pages" engines like JSP. 
JANINO is integrated with Apache Commons JCI ("Java Compiler
Interface") and JBoss Rules / Drools. 
JANINO can also be used for static code analysis. 

%package        javadoc
Summary:        Javadoc for %{name}
Group:          Development/Java

%description    javadoc
%{summary}.

%prep
%setup -q
%remove_java_binaries
rm -rf javadoc
%patch0 -b .sav

%build
%{ant} jar javadoc

%install
rm -rf $RPM_BUILD_ROOT

# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}

install -m 644 build/lib/janino.jar \
  $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar

(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do \
ln -sf ${jar} ${jar/-%{version}/}; done)

%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}

# pom
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
install -pm 644 %{SOURCE1} \
    $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP-%{name}.pom

# javadoc
install -p -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr build/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
(cd $RPM_BUILD_ROOT%{_javadocdir} && ln -sf %{name}-%{version} %{name})

%{gcj_compile}

%clean
rm -rf $RPM_BUILD_ROOT

%post
%update_maven_depmap
%if %{gcj_support}
%{update_gcjdb}
%endif

%postun
%update_maven_depmap
%if %{gcj_support}
%{clean_gcjdb}
%endif

%files
%defattr(0644,root,root,0755)
%{_javadir}/*.jar
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}
%{gcj_files}

%files javadoc
%defattr(0644,root,root,0755)
%dir %{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}-%{version}/*
%dir %{_javadocdir}/%{name}


%changelog
* Fri Sep 04 2009 Thierry Vignaud <tvignaud@mandriva.com> 0:2.5.15-0.0.2mdv2010.0
+ Revision: 429592
- rebuild

* Wed Jun 25 2008 Alexander Kurtakov <akurtakov@mandriva.org> 0:2.5.15-0.0.1mdv2009.0
+ Revision: 228879
- new version 2.5.15, disable gcj_compile

* Mon Apr 14 2008 Alexander Kurtakov <akurtakov@mandriva.org> 0:2.5.13-0.0.1mdv2009.0
+ Revision: 193231
- new version

  + Thierry Vignaud <tvignaud@mandriva.com>
    - fix no-buildroot-tag

* Fri Jan 25 2008 Alexander Kurtakov <akurtakov@mandriva.org> 0:2.5.12-0.0.1mdv2008.1
+ Revision: 158110
- import janino