janino/janino.spec
2020-03-16 16:37:06 +08:00

117 lines
4.4 KiB
RPMSpec

# 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.
#
Name: janino
Version: 2.7.8
Release: 11
Summary: A super-small, super-fast Java compiler.
License: BSD
URL: http://janino-compiler.github.io/janino
Source0: http://janino.unkrig.de/download/%{name}-%{version}.zip
Source1: https://repo1.maven.org/maven2/org/codehaus/%{name}/%{name}-parent/%{version}/%{name}-parent-%{version}.pom
Source2: https://repo1.maven.org/maven2/org/codehaus/%{name}/commons-compiler/%{version}/commons-compiler-%{version}.pom
Source3: https://repo1.maven.org/maven2/org/codehaus/%{name}/commons-compiler-jdk/%{version}/commons-compiler-jdk-%{version}.pom
Source4: https://repo1.maven.org/maven2/org/codehaus/%{name}/%{name}/%{version}/%{name}-%{version}.pom
# removes the de.unkrig.commons.nullanalysis annotations
Patch0: %{name}-2.7.8-remove-nullanalysis-annotations.patch
BuildRequires: maven-local mvn(junit:junit) mvn(org.apache.ant:ant)
BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin)
BuildRequires: mvn(org.codehaus:codehaus-parent:pom:)
BuildRequires: /usr/bin/perl
BuildArch: noarch
%description
Janino can not only compile a set of source files to a set of class files like JAVAC,
but also compile a Java expression, a block, a class body, one .java file or a set of
.java files in memory, load the bytecode and execute it directly in the same JVM.
%package help
Provides: %{name}-javadoc = %{version}-%{release}
Obsoletes: %{name}-javadoc < %{version}-%{release}
Summary: Javadoc for janino.
%description help
This package contains Introduction for janino.
%prep
%setup -q
find . -name "*.jar" -delete
find . -name "*.class" -delete
for m in commons-compiler commons-compiler-jdk %{name};do
mkdir -p ${m}/src
(
cd ${m}/src/
unzip -qq ../../${m}-src.zip
if [ -f org.codehaus.commons.compiler.properties ]; then
mkdir -p main/resources
mv org.codehaus.commons.compiler.properties main/resources
fi
)
done
%patch0 -p1
install -m 644 %{SOURCE1} pom.xml
install -m 644 %{SOURCE2} commons-compiler/pom.xml
install -m 644 %{SOURCE3} commons-compiler-jdk/pom.xml
install -m 644 %{SOURCE4} %{name}/pom.xml
%pom_change_dep -r :ant-nodeps :ant
%pom_xpath_set "pom:plugin[pom:artifactId = 'maven-compiler-plugin']/pom:configuration/pom:source" 1.6
%pom_xpath_set "pom:plugin[pom:artifactId = 'maven-compiler-plugin']/pom:configuration/pom:target" 1.6
perl -pi -e 's/\r$//g' new_bsd_license.txt README.txt
for plugin in buildnumber-maven-plugin maven-clean-plugin maven-deploy-plugin \
maven-site-plugin maven-source-plugin;do
%pom_remove_plugin :$plugin
done
%build
%mvn_build
%install
%mvn_install
%files -f .mfiles
%doc README.txt
%license new_bsd_license.txt
%files help -f .mfiles-javadoc
%license new_bsd_license.txt
%changelog
* Mon Mar 16 2020 yangjian<yangjian79@huawei.com> - 2.7.8-11
- Package init