2007-01-16 00:19:17 +01:00
|
|
|
#
|
2011-02-22 20:50:29 +01:00
|
|
|
# spec file for package jython
|
2007-01-16 00:19:17 +01:00
|
|
|
#
|
2022-03-20 13:21:00 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2007-01-16 00:19:17 +01:00
|
|
|
#
|
2009-06-19 00:36:33 +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-23 10:24:37 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2012-02-28 15:11:53 +01:00
|
|
|
#
|
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
|
2021-06-21 16:46:14 +02:00
|
|
|
%global pyver %(python3 -c 'import sys;print(sys.version[0:3])')
|
2011-03-11 14:04:17 +01:00
|
|
|
%global cpython_version %{pyver}
|
2021-06-21 16:46:14 +02:00
|
|
|
%global pyxml_version %{pyver}
|
2011-03-11 14:04:17 +01:00
|
|
|
%global svn_tag Release_2_2_1
|
|
|
|
%global _python_bytecompile_errors_terminate_build 0
|
2007-01-16 00:19:17 +01:00
|
|
|
Name: jython
|
2011-03-11 14:04:17 +01:00
|
|
|
Version: 2.2.1
|
2012-02-28 15:11:53 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: A Java implementation of the Python language
|
2021-06-21 16:46:14 +02:00
|
|
|
License: Apache-2.0 AND Python-2.0
|
2012-02-28 15:11:53 +01:00
|
|
|
Group: Development/Languages/Python
|
2022-03-20 13:21:00 +01:00
|
|
|
URL: https://www.jython.org/
|
2011-03-11 14:04:17 +01:00
|
|
|
# Use the included fetch-jython.sh script to generate the source drop
|
|
|
|
# for jython 2.2.1
|
|
|
|
# sh fetch-jython.sh \
|
|
|
|
# jython https://jython.svn.sourceforge.net/svnroot Release_2_2_1
|
|
|
|
#
|
2012-02-28 15:11:53 +01:00
|
|
|
Source0: %{name}-fetched-src-%{svn_tag}.tar.bz2
|
|
|
|
Source2: fetch-%{name}.sh
|
|
|
|
Patch0: %{name}-cachedir.patch
|
2011-03-11 14:04:17 +01:00
|
|
|
# Make javadoc and copy-full tasks not depend upon "full-build"
|
|
|
|
# Also, copy python's license from source directory and not
|
|
|
|
# ${python.home}
|
2012-02-28 15:11:53 +01:00
|
|
|
Patch1: %{name}-nofullbuildpath.patch
|
2015-02-04 15:24:57 +01:00
|
|
|
# These address CVE-2013-2027 (http://bugs.jython.org/msg8004)
|
|
|
|
Patch3: %{name}-cacheperms.patch
|
|
|
|
Patch4: %{name}-makeCompiledFilename.patch
|
|
|
|
Patch5: %{name}-cached-classes.patch
|
2017-09-10 21:32:03 +02:00
|
|
|
Patch6: %{name}-sourcetarget.patch
|
|
|
|
Patch7: %{name}-module.patch
|
|
|
|
Patch8: %{name}-compareto.patch
|
2018-11-23 10:24:37 +01:00
|
|
|
Patch9: %{name}-dont-validate-pom.patch
|
2012-02-28 15:11:53 +01:00
|
|
|
BuildRequires: ant
|
2018-11-23 10:24:37 +01:00
|
|
|
BuildRequires: fdupes
|
2012-02-28 15:11:53 +01:00
|
|
|
BuildRequires: jakarta-oro
|
2017-12-18 13:27:52 +01:00
|
|
|
BuildRequires: java-devel >= 1.8
|
2018-11-23 10:24:37 +01:00
|
|
|
BuildRequires: javapackages-local
|
2019-02-12 14:38:08 +01:00
|
|
|
BuildRequires: jline1
|
2015-07-21 11:10:32 +02:00
|
|
|
BuildRequires: libreadline-java >= 0.8.0
|
2012-02-28 15:11:53 +01:00
|
|
|
BuildRequires: mysql-connector-java
|
2021-06-21 16:46:14 +02:00
|
|
|
BuildRequires: python3 >= %{cpython_version}
|
|
|
|
BuildRequires: python3-xml >= %{pyxml_version}
|
2012-02-28 15:11:53 +01:00
|
|
|
BuildRequires: servletapi5
|
2018-11-23 10:24:37 +01:00
|
|
|
Requires: jakarta-oro
|
|
|
|
Requires: java >= 1.8
|
|
|
|
Requires: javapackages-local
|
2019-02-12 14:38:08 +01:00
|
|
|
Requires: jline1
|
2018-11-23 10:24:37 +01:00
|
|
|
Requires: libreadline-java >= 0.8.0
|
2021-06-21 16:46:14 +02:00
|
|
|
Requires: python3 >= %{cpython_version}
|
2018-11-23 10:24:37 +01:00
|
|
|
Requires: servletapi5
|
|
|
|
Recommends: mysql-connector-java
|
2011-03-11 14:04:17 +01:00
|
|
|
BuildArch: noarch
|
2007-01-16 00:19:17 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
Jython is an implementation of the high-level, dynamic, object-oriented
|
|
|
|
language Python seamlessly integrated with the Java platform. The
|
|
|
|
predecessor to Jython, JPython, is certified as 100% Pure Java. Jython
|
|
|
|
is freely available for both commercial and noncommercial use and is
|
|
|
|
distributed with source code. Jython is complementary to Java and is
|
|
|
|
especially suited for the following tasks: Embedded scripting--Java
|
|
|
|
programmers can add the Jython libraries to their system to allow end
|
|
|
|
users to write simple or complicated scripts that add functionality to
|
|
|
|
the application. Interactive experimentation--Jython provides an
|
|
|
|
interactive interpreter that can be used to interact with Java packages
|
|
|
|
or with running Java applications. This allows programmers to
|
|
|
|
experiment and debug any Java system using Jython. Rapid application
|
|
|
|
development--Python programs are typically 2-10X shorter than the
|
|
|
|
equivalent Java program. This translates directly to increased
|
|
|
|
programmer productivity. The seamless interaction between Python and
|
|
|
|
Java allows developers to freely mix the two languages both during
|
|
|
|
development and in shipping products.
|
|
|
|
|
|
|
|
%package manual
|
|
|
|
Summary: Manual for jython
|
|
|
|
Group: Development/Libraries/Java
|
|
|
|
|
|
|
|
%description manual
|
|
|
|
This package contains the manual for Jython.
|
|
|
|
|
|
|
|
Jython is an implementation of the high-level, dynamic, object-oriented
|
|
|
|
language Python seamlessly integrated with the Java platform. The
|
|
|
|
predecessor to Jython, JPython, is certified as 100% Pure Java. Jython
|
|
|
|
is freely available for both commercial and non-commercial use and is
|
|
|
|
distributed with source code. Jython is complementary to Java and is
|
|
|
|
especially suited for the following tasks: Embedded scripting - Java
|
|
|
|
programmers can add the Jython libraries to their system to allow end
|
|
|
|
users to write simple or complicated scripts that add functionality to
|
|
|
|
the application. Interactive experimentation - Jython provides an
|
|
|
|
interactive interpreter that can be used to interact with Java packages
|
|
|
|
or with running Java applications. This allows programmers to
|
|
|
|
experiment and debug any Java system using Jython. Rapid application
|
|
|
|
development - Python programs are typically 2-10X shorter than the
|
|
|
|
equivalent Java program. This translates directly to increased
|
|
|
|
programmer productivity. The seamless interaction between Python and
|
|
|
|
Java allows developers to freely mix the two languages both during
|
|
|
|
development and in shipping products.
|
|
|
|
|
|
|
|
%package javadoc
|
|
|
|
Summary: Javadoc for jython
|
|
|
|
Group: Development/Libraries/Java
|
|
|
|
|
|
|
|
%description javadoc
|
|
|
|
This package contains the javadoc documentation for jython.
|
|
|
|
|
|
|
|
Jython is an implementation of the high-level, dynamic, object-oriented
|
|
|
|
language Python seamlessly integrated with the Java platform. The
|
|
|
|
predecessor to Jython, JPython, is certified as 100% Pure Java. Jython
|
|
|
|
is freely available for both commercial and non-commercial use and is
|
|
|
|
distributed with source code. Jython is complementary to Java and is
|
|
|
|
especially suited for the following tasks: Embedded scripting - Java
|
|
|
|
programmers can add the Jython libraries to their system to allow end
|
|
|
|
users to write simple or complicated scripts that add functionality to
|
|
|
|
the application. Interactive experimentation - Jython provides an
|
|
|
|
interactive interpreter that can be used to interact with Java packages
|
|
|
|
or with running Java applications. This allows programmers to
|
|
|
|
experiment and debug any Java system using Jython. Rapid application
|
|
|
|
development - Python programs are typically 2-10X shorter than the
|
|
|
|
equivalent Java program. This translates directly to increased
|
|
|
|
programmer productivity. The seamless interaction between Python and
|
|
|
|
Java allows developers to freely mix the two languages both during
|
|
|
|
development and in shipping products.
|
|
|
|
|
|
|
|
%package demo
|
|
|
|
Summary: Demonstration and samples for jython
|
|
|
|
Group: Development/Libraries/Java
|
2012-02-28 15:11:53 +01:00
|
|
|
Requires: %{name} = %{version}-%{release}
|
2007-01-16 00:19:17 +01:00
|
|
|
|
|
|
|
%description demo
|
|
|
|
This package contains demonstration and sample files for Jython.
|
|
|
|
|
|
|
|
Jython is an implementation of the high-level, dynamic, object-oriented
|
|
|
|
language Python seamlessly integrated with the Java platform. The
|
|
|
|
predecessor to Jython, JPython, is certified as 100% Pure Java. Jython
|
|
|
|
is freely available for both commercial and non-commercial use and is
|
|
|
|
distributed with source code. Jython is complementary to Java and is
|
|
|
|
especially suited for the following tasks: Embedded scripting - Java
|
|
|
|
programmers can add the Jython libraries to their system to allow end
|
|
|
|
users to write simple or complicated scripts that add functionality to
|
|
|
|
the application. Interactive experimentation - Jython provides an
|
|
|
|
interactive interpreter that can be used to interact with Java packages
|
|
|
|
or with running Java applications. This allows programmers to
|
|
|
|
experiment and debug any Java system using Jython. Rapid application
|
|
|
|
development - Python programs are typically 2-10X shorter than the
|
|
|
|
equivalent Java program. This translates directly to increased
|
|
|
|
programmer productivity. The seamless interaction between Python and
|
|
|
|
Java allows developers to freely mix the two languages both during
|
|
|
|
development and in shipping products.
|
|
|
|
|
|
|
|
%prep
|
2011-03-11 14:04:17 +01:00
|
|
|
%setup -q -n %{name}-svn-%{svn_tag}
|
2007-01-16 00:19:17 +01:00
|
|
|
%patch0 -p1
|
2011-02-22 20:50:21 +01:00
|
|
|
%patch1 -p1
|
2015-02-04 15:24:57 +01:00
|
|
|
%patch3 -p1
|
|
|
|
%patch4 -p1
|
|
|
|
%patch5 -p1
|
2017-09-10 21:32:03 +02:00
|
|
|
%patch6 -p1
|
|
|
|
%patch7 -p1
|
|
|
|
%patch8 -p1
|
2018-11-23 10:24:37 +01:00
|
|
|
%patch9 -p1
|
2007-01-16 00:19:17 +01:00
|
|
|
|
|
|
|
%build
|
2019-02-12 14:38:08 +01:00
|
|
|
export CLASSPATH=$(build-classpath mysql-connector-java oro servlet jline1)
|
2011-03-11 14:04:17 +01:00
|
|
|
# FIXME: fix jpackage-utils to handle multilib correctly
|
|
|
|
export CLASSPATH=$CLASSPATH:%{_libdir}/libreadline-java/libreadline-java.jar
|
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
rm -rf org/apache
|
|
|
|
perl -p -i -e 's|execon|apply|g' build.xml
|
2011-03-11 14:04:17 +01:00
|
|
|
|
2022-03-20 13:21:00 +01:00
|
|
|
%{ant} \
|
2011-03-11 14:04:17 +01:00
|
|
|
-Dpython.home=%{_bindir} \
|
|
|
|
-Dht2html.dir=%{_datadir}/ht2html \
|
|
|
|
-Dpython.lib=./CPythonLib \
|
2021-06-21 16:46:14 +02:00
|
|
|
-Dpython.exe=%{_bindir}/python3 \
|
2018-11-23 10:24:37 +01:00
|
|
|
-DPyXmlHome=%{_libdir}/python%{pyver} \
|
2011-03-11 14:04:17 +01:00
|
|
|
-Dtargetver=1.3 \
|
|
|
|
copy-dist
|
|
|
|
|
|
|
|
# remove #! from python files
|
|
|
|
pushd dist
|
|
|
|
for f in `find . -name '*.py'`
|
|
|
|
do
|
|
|
|
sed --in-place "s:#!\s*/usr.*::" $f
|
|
|
|
done
|
|
|
|
popd
|
2007-01-16 00:19:17 +01:00
|
|
|
|
2018-11-23 10:24:37 +01:00
|
|
|
pushd maven
|
|
|
|
# generate maven pom
|
|
|
|
ant -Dproject.version=%{version} install
|
|
|
|
popd
|
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
%install
|
|
|
|
# jar
|
2018-11-23 10:24:37 +01:00
|
|
|
install -d -m 755 %{buildroot}%{_javadir}
|
2011-03-11 14:04:17 +01:00
|
|
|
install -m 644 dist/%{name}.jar \
|
2018-11-23 10:24:37 +01:00
|
|
|
%{buildroot}%{_javadir}/%{name}.jar
|
|
|
|
# pom
|
|
|
|
install -d -m 755 %{buildroot}%{_mavenpomdir}
|
|
|
|
install -m 644 build/maven/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
|
2019-06-26 17:53:54 +02:00
|
|
|
%add_maven_depmap JPP-%{name}.pom %{name}.jar -a org.python:jython-standalone,jython:jython
|
2018-11-23 10:24:37 +01:00
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
# javadoc
|
2018-11-23 10:24:37 +01:00
|
|
|
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
|
|
|
|
cp -pr dist/Doc/javadoc/* %{buildroot}%{_javadocdir}/%{name}
|
|
|
|
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
|
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
# data
|
2018-11-23 10:24:37 +01:00
|
|
|
install -d -m 755 %{buildroot}%{_datadir}/%{name}
|
2007-01-16 00:19:17 +01:00
|
|
|
# these are not supposed to be distributed
|
|
|
|
find dist/Lib -type d -name test | xargs rm -rf
|
2011-03-11 14:04:17 +01:00
|
|
|
|
2018-11-23 10:24:37 +01:00
|
|
|
cp -pr dist/Lib %{buildroot}%{_datadir}/%{name}
|
|
|
|
cp -pr dist/Tools %{buildroot}%{_datadir}/%{name}
|
2011-03-11 14:04:17 +01:00
|
|
|
# demo
|
2018-11-23 10:24:37 +01:00
|
|
|
cp -pr dist/Demo %{buildroot}%{_datadir}/%{name}
|
|
|
|
fdupes -s %{buildroot}%{_datadir}/%{name}/Demo
|
|
|
|
fdupes -s %{buildroot}%{_datadir}/%{name}/{Lib,Tools}
|
2011-03-11 14:04:17 +01:00
|
|
|
# manual
|
|
|
|
rm -rf dist/Doc/javadoc
|
|
|
|
mv dist/Doc %{name}-manual-%{version}
|
2018-11-23 10:24:37 +01:00
|
|
|
%fdupes -s %{name}-manual-%{version}
|
2011-03-11 14:04:17 +01:00
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
# registry
|
2018-11-23 10:24:37 +01:00
|
|
|
install -m 644 registry %{buildroot}%{_datadir}/%{name}
|
2007-01-16 00:19:17 +01:00
|
|
|
# scripts
|
2018-11-23 10:24:37 +01:00
|
|
|
install -d %{buildroot}%{_bindir}
|
2011-03-11 14:04:17 +01:00
|
|
|
|
2018-11-23 10:24:37 +01:00
|
|
|
cat > %{buildroot}%{_bindir}/%{name} << EOF
|
2007-01-16 00:19:17 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# %{name} script
|
|
|
|
# JPackage Project (http://jpackage.sourceforge.net)
|
2018-11-23 10:24:37 +01:00
|
|
|
#
|
2007-01-16 00:19:17 +01:00
|
|
|
# Source functions library
|
|
|
|
. %{_datadir}/java-utils/java-functions
|
2011-03-11 14:04:17 +01:00
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
# Source system prefs
|
|
|
|
if [ -f %{_sysconfdir}/%{name}.conf ] ; then
|
|
|
|
. %{_sysconfdir}/%{name}.conf
|
|
|
|
fi
|
2011-03-11 14:04:17 +01:00
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
# Source user prefs
|
|
|
|
if [ -f \$HOME/.%{name}rc ] ; then
|
|
|
|
. \$HOME/.%{name}rc
|
|
|
|
fi
|
2011-03-11 14:04:17 +01:00
|
|
|
|
|
|
|
# Arch-specific location of dependency
|
|
|
|
case \$(uname -m) in
|
|
|
|
x86_64 | ia64 | s390x | ppc64 | sparc64 )
|
2018-11-23 10:24:37 +01:00
|
|
|
JYTHONLIBDIR="%{_libdir}" ;;
|
2011-03-11 14:04:17 +01:00
|
|
|
* )
|
2018-11-23 10:24:37 +01:00
|
|
|
JYTHONLIBDIR="%{_prefix}/lib" ;;
|
2011-03-11 14:04:17 +01:00
|
|
|
esac
|
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
# Configuration
|
|
|
|
MAIN_CLASS=org.python.util.%{name}
|
|
|
|
BASE_FLAGS=-Dpython.home=%{_datadir}/%{name}
|
2011-03-11 14:04:17 +01:00
|
|
|
BASE_JARS="%{name} oro servlet mysql-connector-java"
|
|
|
|
|
|
|
|
BASE_FLAGS="\$BASE_FLAGS -Dpython.console=org.python.util.ReadlineConsole"
|
|
|
|
BASE_FLAGS="\$BASE_FLAGS -Djava.library.path=\$JYTHONLIBDIR/libreadline-java"
|
|
|
|
BASE_FLAGS="\$BASE_FLAGS -Dpython.console.readlinelib=Editline"
|
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
# Set parameters
|
|
|
|
set_jvm
|
2011-03-11 14:04:17 +01:00
|
|
|
CLASSPATH=$CLASSPATH:\$JYTHONLIBDIR/libreadline-java/libreadline-java.jar
|
2007-01-16 00:19:17 +01:00
|
|
|
set_classpath \$BASE_JARS
|
|
|
|
set_flags \$BASE_FLAGS
|
|
|
|
set_options \$BASE_OPTIONS
|
2011-03-11 14:04:17 +01:00
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
# Let's start
|
|
|
|
run "\$@"
|
|
|
|
EOF
|
2011-03-11 14:04:17 +01:00
|
|
|
|
2018-11-23 10:24:37 +01:00
|
|
|
cat > %{buildroot}%{_bindir}/%{name}c << EOF
|
2007-01-16 00:19:17 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# %{name}c script
|
|
|
|
# JPackage Project (http://jpackage.sourceforge.net)
|
2011-03-11 14:04:17 +01:00
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
%{_bindir}/%{name} %{_datadir}/%{name}/Tools/%{name}c/%{name}c.py "\$@"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
%files
|
2018-11-23 10:24:37 +01:00
|
|
|
%license LICENSE.txt
|
|
|
|
%doc ACKNOWLEDGMENTS NEWS README.txt
|
2007-01-16 00:19:17 +01:00
|
|
|
%attr(0755,root,root) %{_bindir}/%{name}
|
|
|
|
%attr(0755,root,root) %{_bindir}/%{name}c
|
|
|
|
%{_javadir}/*
|
2018-11-23 10:24:37 +01:00
|
|
|
%{_mavenpomdir}/*
|
2007-01-16 00:19:17 +01:00
|
|
|
%dir %{_datadir}/%{name}
|
|
|
|
%{_datadir}/%{name}/Lib
|
|
|
|
%{_datadir}/%{name}/Tools
|
|
|
|
%{_datadir}/%{name}/registry
|
2018-11-23 10:24:37 +01:00
|
|
|
%if %{defined _maven_repository}
|
|
|
|
%{_mavendepmapfragdir}/%{name}
|
|
|
|
%else
|
|
|
|
%{_datadir}/maven-metadata/%{name}.xml*
|
|
|
|
%endif
|
2007-01-16 00:19:17 +01:00
|
|
|
|
2011-03-11 14:04:17 +01:00
|
|
|
%files javadoc
|
2018-11-23 10:24:37 +01:00
|
|
|
%license LICENSE.txt
|
2011-03-11 14:04:17 +01:00
|
|
|
%{_javadocdir}/%{name}
|
2007-01-16 00:19:17 +01:00
|
|
|
|
2011-03-11 14:04:17 +01:00
|
|
|
%files manual
|
2018-11-23 10:24:37 +01:00
|
|
|
%license LICENSE.txt
|
|
|
|
%doc README.txt
|
2011-03-11 14:04:17 +01:00
|
|
|
%doc %{name}-manual-%{version}
|
|
|
|
|
2007-01-16 00:19:17 +01:00
|
|
|
%files demo
|
2018-11-23 10:24:37 +01:00
|
|
|
%license LICENSE.txt
|
|
|
|
%doc ACKNOWLEDGMENTS NEWS README.txt
|
2007-01-16 00:19:17 +01:00
|
|
|
%{_datadir}/%{name}/Demo
|
|
|
|
|
2009-06-19 00:36:33 +02:00
|
|
|
%changelog
|