2008-09-24 17:27:47 +02:00
|
|
|
#
|
2011-12-20 11:25:45 +01:00
|
|
|
# spec file for package rhino
|
2008-09-24 17:27:47 +02:00
|
|
|
#
|
2020-07-30 07:39:08 +02:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
2009-11-23 11:42:15 +01:00
|
|
|
# Copyright (c) 2000-2009, JPackage Project
|
2008-09-24 17:27:47 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-11-18 17:33:30 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2008-09-24 17:27:47 +02:00
|
|
|
#
|
|
|
|
|
2012-01-16 16:49:54 +01:00
|
|
|
|
2020-07-30 07:39:08 +02:00
|
|
|
%define scm_version 1_7_7_1
|
2008-09-24 17:27:47 +02:00
|
|
|
Name: rhino
|
2020-07-30 07:39:08 +02:00
|
|
|
Version: 1.7.7.1
|
2012-06-18 15:25:37 +02:00
|
|
|
Release: 0
|
2008-09-24 17:27:47 +02:00
|
|
|
Summary: JavaScript for Java
|
2020-07-30 07:39:08 +02:00
|
|
|
License: MPL-2.0
|
2011-12-20 11:25:45 +01:00
|
|
|
Group: Development/Libraries/Java
|
2020-07-30 07:39:08 +02:00
|
|
|
URL: https://www.mozilla.org/rhino/
|
|
|
|
Source0: https://github.com/mozilla/rhino/archive/Rhino%{scm_version}_RELEASE.tar.gz
|
|
|
|
Source1: https://repo1.maven.org/maven2/org/mozilla/rhino/%{version}/rhino-%{version}.pom
|
2008-09-24 17:27:47 +02:00
|
|
|
Source2: rhino.script
|
|
|
|
Source3: rhino-debugger.script
|
|
|
|
Source4: rhino-idswitch.script
|
|
|
|
Source5: rhino-jsc.script
|
2009-11-23 11:42:15 +01:00
|
|
|
Patch0: rhino-build.patch
|
2012-01-16 16:49:54 +01:00
|
|
|
# Add OSGi metadata from Eclipse Orbit project
|
2020-07-30 07:39:08 +02:00
|
|
|
Patch1: rhino-addOrbitManifest.patch
|
2008-09-24 17:27:47 +02:00
|
|
|
BuildRequires: ant
|
2020-07-30 07:39:08 +02:00
|
|
|
BuildRequires: java-devel >= 1.7
|
2018-11-18 17:33:30 +01:00
|
|
|
BuildRequires: javapackages-local
|
2020-07-30 07:39:08 +02:00
|
|
|
Requires: javapackages-tools
|
2019-02-12 17:30:31 +01:00
|
|
|
Requires: jline1
|
2017-05-19 13:28:32 +02:00
|
|
|
BuildArch: noarch
|
2008-09-24 17:27:47 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
Rhino is an open-source implementation of JavaScript written entirely
|
|
|
|
in Java. It is typically embedded into Java applications to provide
|
|
|
|
scripting to end users.
|
|
|
|
|
|
|
|
%package demo
|
2020-07-30 07:39:08 +02:00
|
|
|
Summary: Examples for %{name}
|
2012-06-18 15:25:37 +02:00
|
|
|
Group: Development/Libraries/Java
|
2008-09-24 17:27:47 +02:00
|
|
|
|
|
|
|
%description demo
|
2020-07-30 07:39:08 +02:00
|
|
|
Examples for %{name}
|
2008-09-24 17:27:47 +02:00
|
|
|
|
|
|
|
%prep
|
2020-07-30 07:39:08 +02:00
|
|
|
%setup -q -n %{name}-Rhino%{scm_version}_RELEASE
|
|
|
|
%patch0 -b .build
|
|
|
|
%patch1 -b .fixManifest
|
2020-07-30 08:17:58 +02:00
|
|
|
cp %{SOURCE1} pom.xml
|
|
|
|
%pom_remove_parent
|
2012-01-16 16:49:54 +01:00
|
|
|
|
2008-09-24 17:27:47 +02:00
|
|
|
# Fix manifest
|
2012-01-16 16:49:54 +01:00
|
|
|
sed -i -e '/^Class-Path:.*$/d' src/manifest
|
|
|
|
|
2008-09-24 17:27:47 +02:00
|
|
|
# Add jpp release info to version
|
2012-01-16 16:49:54 +01:00
|
|
|
sed -i -e 's|^implementation.version: Rhino .* release .* \${implementation.date}|implementation.version: Rhino %{version} release %{release} \${implementation.date}|' build.properties
|
|
|
|
|
2008-09-24 17:27:47 +02:00
|
|
|
%build
|
2019-02-12 12:07:50 +01:00
|
|
|
%{ant} \
|
2017-10-03 08:53:13 +02:00
|
|
|
-Dtarget-jvm=6 -Dsource-level=6 \
|
2017-05-19 13:28:32 +02:00
|
|
|
deepclean jar copy-all
|
2012-01-16 16:49:54 +01:00
|
|
|
|
2008-09-24 17:27:47 +02:00
|
|
|
pushd examples
|
2020-07-30 07:39:08 +02:00
|
|
|
|
2020-07-30 08:27:43 +02:00
|
|
|
export CLASSPATH=../build/%{name}%{version}/js.jar
|
2020-07-30 07:39:08 +02:00
|
|
|
SOURCEPATH=../build/%{name}%{version}/src
|
2020-07-30 08:27:43 +02:00
|
|
|
%javac -sourcepath ${SOURCEPATH} -source 6 -target 6 *.java
|
|
|
|
%jar cvf ../build/%{name}%{version}/%{name}-examples.jar *.class
|
2020-07-30 07:39:08 +02:00
|
|
|
|
2008-09-24 17:27:47 +02:00
|
|
|
popd
|
|
|
|
|
|
|
|
%install
|
2012-01-16 16:49:54 +01:00
|
|
|
|
2020-07-30 07:39:08 +02:00
|
|
|
# man page
|
|
|
|
mkdir -p %{buildroot}%{_mandir}/man1/
|
|
|
|
install -m 644 man/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
|
|
|
|
|
2008-09-24 17:27:47 +02:00
|
|
|
# jars
|
2012-01-16 16:49:54 +01:00
|
|
|
mkdir -p %{buildroot}%{_javadir}
|
2020-07-30 08:17:58 +02:00
|
|
|
cp -a build/%{name}%{version}/js.jar %{buildroot}%{_javadir}/%{name}.jar
|
|
|
|
ln -s %{name}.jar %{buildroot}%{_javadir}/js.jar
|
2012-01-16 16:49:54 +01:00
|
|
|
|
2018-11-18 17:33:30 +01:00
|
|
|
# pom
|
|
|
|
mkdir -p %{buildroot}%{_mavenpomdir}
|
2020-07-30 08:17:58 +02:00
|
|
|
cp -a pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
|
|
|
|
%add_maven_depmap %{name}.pom %{name}.jar -a "rhino:js"
|
2018-11-18 17:33:30 +01:00
|
|
|
|
2008-09-24 17:27:47 +02:00
|
|
|
# scripts
|
2012-01-16 16:49:54 +01:00
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
|
|
install -m 0755 %{SOURCE2} %{buildroot}%{_bindir}/%{name}
|
|
|
|
install -m 0755 %{SOURCE3} %{buildroot}%{_bindir}/%{name}-debugger
|
|
|
|
install -m 0755 %{SOURCE4} %{buildroot}%{_bindir}/%{name}-idswitch
|
|
|
|
install -m 0755 %{SOURCE5} %{buildroot}%{_bindir}/%{name}-jsc
|
|
|
|
|
2008-09-24 17:27:47 +02:00
|
|
|
# examples
|
2012-01-16 16:49:54 +01:00
|
|
|
mkdir -p %{buildroot}%{_datadir}/%{name}
|
|
|
|
cp -a examples/* %{buildroot}%{_datadir}/%{name}
|
2020-07-30 07:39:08 +02:00
|
|
|
cp -a build/%{name}%{version}/%{name}-examples.jar %{buildroot}%{_javadir}/%{name}-examples.jar
|
|
|
|
|
|
|
|
find %{buildroot}%{_datadir}/%{name} -name '*.build' -delete
|
2012-01-16 16:49:54 +01:00
|
|
|
|
2020-07-30 08:17:58 +02:00
|
|
|
%files -f .mfiles
|
2020-07-30 07:39:08 +02:00
|
|
|
%license LICENSE.txt
|
2008-09-24 17:27:47 +02:00
|
|
|
%attr(0755,root,root) %{_bindir}/%{name}
|
|
|
|
%attr(0755,root,root) %{_bindir}/%{name}-debugger
|
|
|
|
%attr(0755,root,root) %{_bindir}/%{name}-idswitch
|
|
|
|
%attr(0755,root,root) %{_bindir}/%{name}-jsc
|
2020-07-30 08:17:58 +02:00
|
|
|
%{_javadir}/js.jar
|
|
|
|
%{_javadir}/%{name}-examples.jar
|
2020-07-30 08:27:43 +02:00
|
|
|
%{_mandir}/man1/%{name}.1%{?ext_man}
|
2008-09-24 17:27:47 +02:00
|
|
|
|
|
|
|
%files demo
|
|
|
|
%{_datadir}/%{name}
|
|
|
|
|
|
|
|
%changelog
|