diff --git a/_service b/_service new file mode 100644 index 0000000..edcf5ac --- /dev/null +++ b/_service @@ -0,0 +1,17 @@ + + + git + https://github.com/jython/jython.git + v2.7.3 + v* + @PARENT_TAG@ + v(.*) + **/*.jar + **/*.zip + + + *.tar + xz + + + diff --git a/fetch-jython.sh b/fetch-jython.sh deleted file mode 100644 index 2142916..0000000 --- a/fetch-jython.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -# Generate a source drop for jython from SVN - -# Usage message -usage="usage: $0 " - -project_name=$1 -svn_root=$2 -svn_tag=$3 - -# Ensure we got all of the variables -if [ "x$project_name"x = "xx" ] -then - echo >&2 "$usage" - exit 1 -fi - -if [ "x$svn_root"x = "xx" ] -then - echo >&2 "$usage" - exit 1 -fi - -if [ "x$svn_tag"x = "xx" ] -then - echo >&2 "$usage" - exit 1 -fi - -mkdir -p temp && cd temp - -svn export --username guest --password "" $svn_root/$project_name/tags/$svn_tag -mv $svn_tag/$project_name $project_name-svn-$svn_tag -tar jcf $project_name-fetched-src-$svn_tag.tar.bz2 $project_name-svn-$svn_tag diff --git a/jython-2.7.3.tar.xz b/jython-2.7.3.tar.xz new file mode 100644 index 0000000..7397fe0 --- /dev/null +++ b/jython-2.7.3.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bbcc0f202babdcb0845c6755ac7ab2f59c9443bebbf532a9f4f577207062ff5 +size 12406520 diff --git a/jython-build.patch b/jython-build.patch new file mode 100644 index 0000000..f5fbe17 --- /dev/null +++ b/jython-build.patch @@ -0,0 +1,143 @@ +--- a/build.xml ++++ b/build.xml +@@ -242,44 +242,14 @@ informix.jar = ../support/jdbc-4.10.12.jar + + + +- +- +- +- +- ++ ++ ++ + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + + + + +- +- +- +- + + + +@@ -835,80 +805,13 @@ The text for an official release would continue like ... + + + +- ++ + +- + + + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + + + +--- a/src/org/python/core/PySystemState.java ++++ b/src/org/python/core/PySystemState.java +@@ -55,7 +55,7 @@ import org.python.expose.ExposedType; + import org.python.modules.Setup; + import org.python.util.Generic; + +-import com.carrotsearch.sizeof.RamUsageEstimator; ++import org.apache.lucene.util.RamUsageEstimator; + + import jnr.posix.util.Platform; + diff --git a/jython-dont-validate-pom.patch b/jython-dont-validate-pom.patch index 643320e..92cd377 100644 --- a/jython-dont-validate-pom.patch +++ b/jython-dont-validate-pom.patch @@ -1,44 +1,99 @@ ---- jython-svn-Release_2_2_1/maven/build.xml 2007-03-26 22:02:00.000000000 +0200 -+++ jython-svn-Release_2_2_1/maven/build.xml 2018-11-23 10:04:54.897037648 +0100 -@@ -85,8 +85,6 @@ - - -- - - - -@@ -114,7 +112,7 @@ - -- -+ - - - -@@ -135,23 +133,6 @@ - - +Only in jython-2.7.3: build.xml.orig +Only in jython-2.7.3: build.xml.rej +--- jython-2.7.3/maven/build.xml 2023-06-27 13:47:28.639774958 +0200 ++++ jython-2.7.3/maven/build.xml 2023-06-27 13:58:10.216237299 +0200 +@@ -155,9 +155,6 @@ + + -- -- -- -- -- -- -- -- -- -- - - - +- +- +- + + + +@@ -175,9 +172,6 @@ + + + +- +- +- + + + +@@ -190,9 +184,6 @@ + + + +- +- +- + + + +@@ -200,61 +191,11 @@ + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + + + + +- ++ + + + +Only in jython-2.7.3/maven: build.xml.orig +Only in jython-2.7.3/maven: build.xml.rej diff --git a/jython-fetched-src-Release_2_2_1.tar.bz2 b/jython-fetched-src-Release_2_2_1.tar.bz2 deleted file mode 100644 index 89deeec..0000000 --- a/jython-fetched-src-Release_2_2_1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:169a2b022faf7362a54591f06585a8f03e88a31df6063d39039f62facbb0854b -size 2546326 diff --git a/jython.spec b/jython.spec index 80a901a..4883f4f 100644 --- a/jython.spec +++ b/jython.spec @@ -1,7 +1,7 @@ # # spec file for package jython # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,54 +19,54 @@ %global pyver %(python3 -c 'import sys;print(sys.version[0:3])') %global cpython_version %{pyver} %global pyxml_version %{pyver} -%global svn_tag Release_2_2_1 %global _python_bytecompile_errors_terminate_build 0 Name: jython -Version: 2.2.1 +Version: 2.7.3 Release: 0 Summary: A Java implementation of the Python language License: Apache-2.0 AND Python-2.0 Group: Development/Languages/Python URL: https://www.jython.org/ -# 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 -# -Source0: %{name}-fetched-src-%{svn_tag}.tar.bz2 -Source2: fetch-%{name}.sh -Patch0: %{name}-cachedir.patch -# Make javadoc and copy-full tasks not depend upon "full-build" -# Also, copy python's license from source directory and not -# ${python.home} -Patch1: %{name}-nofullbuildpath.patch -# These address CVE-2013-2027 (http://bugs.jython.org/msg8004) -Patch3: %{name}-cacheperms.patch -Patch4: %{name}-makeCompiledFilename.patch -Patch5: %{name}-cached-classes.patch -Patch6: %{name}-sourcetarget.patch -Patch7: %{name}-module.patch -Patch8: %{name}-compareto.patch -Patch9: %{name}-dont-validate-pom.patch +Source0: %{name}-%{version}.tar.xz +Patch0: %{name}-build.patch +Patch1: %{name}-dont-validate-pom.patch BuildRequires: ant +BuildRequires: ant-junit +BuildRequires: antlr3-java +BuildRequires: antlr3-tool +BuildRequires: apache-commons-compress BuildRequires: fdupes -BuildRequires: jakarta-oro +BuildRequires: glassfish-servlet-api +BuildRequires: guava +BuildRequires: jarjar BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local -BuildRequires: jline1 -BuildRequires: libreadline-java >= 0.8.0 -BuildRequires: mysql-connector-java +BuildRequires: jffi +BuildRequires: jline +BuildRequires: jnr-constants +BuildRequires: jnr-ffi +BuildRequires: jnr-posix +BuildRequires: lucene-core +BuildRequires: objectweb-asm BuildRequires: python3 >= %{cpython_version} BuildRequires: python3-xml >= %{pyxml_version} -BuildRequires: servletapi5 -Requires: jakarta-oro -Requires: java >= 1.8 -Requires: javapackages-local -Requires: jline1 -Requires: libreadline-java >= 0.8.0 -Requires: python3 >= %{cpython_version} -Requires: servletapi5 -Recommends: mysql-connector-java +BuildRequires: stringtemplate4 +Requires: antlr3-java +Requires: antlr3-tool +Requires: apache-commons-compress +Requires: glassfish-servlet-api +Requires: guava +Requires: jarjar +Requires: jffi +Requires: jline +Requires: jnr-constants +Requires: jnr-ffi +Requires: jnr-posix +Requires: junit +Requires: lucene-core +Requires: objectweb-asm +Requires: stringtemplate4 +Obsoletes: %{name}-manual BuildArch: noarch %description @@ -88,55 +88,12 @@ 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. +API documentation for %{name}. %package demo Summary: Demonstration and samples for jython @@ -144,76 +101,43 @@ Group: Development/Libraries/Java Requires: %{name} = %{version}-%{release} %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. +Demonstrations and samples for %{name}. %prep -%setup -q -n %{name}-svn-%{svn_tag} +%setup -q %patch0 -p1 %patch1 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 %build -export CLASSPATH=$(build-classpath mysql-connector-java oro servlet jline1) -# FIXME: fix jpackage-utils to handle multilib correctly -export CLASSPATH=$CLASSPATH:%{_libdir}/libreadline-java/libreadline-java.jar +build-jar-repository -s -p extlibs \ + jffi/jffi antlr3 antlr3-runtime commons-compress \ + glassfish-servlet-api guava/guava jarjar jline/jline \ + jnr/jnr-constants jnr/jnr-ffi jnr/jnr-posix junit lucene/lucene-core \ + objectweb-asm/asm-commons objectweb-asm/asm objectweb-asm/asm-util \ + stringtemplate4/ST4 -rm -rf org/apache -perl -p -i -e 's|execon|apply|g' build.xml - -%{ant} \ - -Dpython.home=%{_bindir} \ - -Dht2html.dir=%{_datadir}/ht2html \ - -Dpython.lib=./CPythonLib \ - -Dpython.exe=%{_bindir}/python3 \ - -DPyXmlHome=%{_libdir}/python%{pyver} \ - -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 +%{ant} -Djython.version=%{version} pushd maven -# generate maven pom -ant -Dproject.version=%{version} install +%{ant} -Djython.version=%{version} bundle popd +# Symlink run-time libs +rm dist/javalib/*.jar +build-jar-repository -s -p dist/javalib \ + jffi/jffi antlr3 antlr3-runtime commons-compress \ + glassfish-servlet-api guava/guava jarjar jline/jline \ + jnr/jnr-constants jnr/jnr-ffi jnr/jnr-posix junit lucene/lucene-core \ + objectweb-asm/asm-commons objectweb-asm/asm objectweb-asm/asm-util \ + stringtemplate4/ST4 + %install # jar install -d -m 755 %{buildroot}%{_javadir} -install -m 644 dist/%{name}.jar \ - %{buildroot}%{_javadir}/%{name}.jar +install -m 644 dist/%{name}.jar %{buildroot}%{_javadir}/%{name}.jar # pom install -d -m 755 %{buildroot}%{_mavenpomdir} -install -m 644 build/maven/pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom +install -m 644 build/maven/%{name}-%{version}.pom %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom %add_maven_depmap JPP-%{name}.pom %{name}.jar -a org.python:jython-standalone,jython:jython # javadoc @@ -221,112 +145,49 @@ install -d -m 755 %{buildroot}%{_javadocdir}/%{name} cp -pr dist/Doc/javadoc/* %{buildroot}%{_javadocdir}/%{name} %fdupes -s %{buildroot}%{_javadocdir}/%{name} -# data +# jython home dir install -d -m 755 %{buildroot}%{_datadir}/%{name} -# these are not supposed to be distributed -find dist/Lib -type d -name test | xargs rm -rf +ln -s %{_javadir}/%{name}.jar %{buildroot}%{_datadir}/%{name} +cp -pr dist/javalib %{buildroot}%{_datadir}/%{name} +rm dist/bin/jython_regrtest.bat +cp -pr dist/bin %{buildroot}%{_datadir}/%{name} +install -m 644 dist/registry %{buildroot}%{_datadir}/%{name} +# libs without tests +rm -rf dist/Lib/{distutils/tests,email/test,json/tests,test,unittest/test} cp -pr dist/Lib %{buildroot}%{_datadir}/%{name} -cp -pr dist/Tools %{buildroot}%{_datadir}/%{name} -# demo -cp -pr dist/Demo %{buildroot}%{_datadir}/%{name} -fdupes -s %{buildroot}%{_datadir}/%{name}/Demo -fdupes -s %{buildroot}%{_datadir}/%{name}/{Lib,Tools} -# manual -rm -rf dist/Doc/javadoc -mv dist/Doc %{name}-manual-%{version} -%fdupes -s %{name}-manual-%{version} +fdupes -s %{buildroot}%{_datadir}/%{name}/Lib + +# demo +cp -pr Demo %{buildroot}%{_datadir}/%{name} +fdupes -s %{buildroot}%{_datadir}/%{name}/Demo + +# javadoc +install -d -m 755 %{buildroot}%{_datadir}/%{name}/Doc +ln -s %{_javadocdir}/%{name} %{buildroot}%{_datadir}/%{name}/Doc/javadoc -# registry -install -m 644 registry %{buildroot}%{_datadir}/%{name} # scripts install -d %{buildroot}%{_bindir} +ln -s %{_datadir}/%{name}/bin/jython %{buildroot}%{_bindir} -cat > %{buildroot}%{_bindir}/%{name} << EOF -#!/bin/sh -# -# %{name} script -# JPackage Project (http://jpackage.sourceforge.net) -# -# Source functions library -. %{_datadir}/java-utils/java-functions - -# Source system prefs -if [ -f %{_sysconfdir}/%{name}.conf ] ; then - . %{_sysconfdir}/%{name}.conf -fi - -# Source user prefs -if [ -f \$HOME/.%{name}rc ] ; then - . \$HOME/.%{name}rc -fi - -# Arch-specific location of dependency -case \$(uname -m) in - x86_64 | ia64 | s390x | ppc64 | sparc64 ) - JYTHONLIBDIR="%{_libdir}" ;; - * ) - JYTHONLIBDIR="%{_prefix}/lib" ;; -esac - -# Configuration -MAIN_CLASS=org.python.util.%{name} -BASE_FLAGS=-Dpython.home=%{_datadir}/%{name} -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" - -# Set parameters -set_jvm -CLASSPATH=$CLASSPATH:\$JYTHONLIBDIR/libreadline-java/libreadline-java.jar -set_classpath \$BASE_JARS -set_flags \$BASE_FLAGS -set_options \$BASE_OPTIONS - -# Let's start -run "\$@" -EOF - -cat > %{buildroot}%{_bindir}/%{name}c << EOF -#!/bin/sh -# -# %{name}c script -# JPackage Project (http://jpackage.sourceforge.net) - -%{_bindir}/%{name} %{_datadir}/%{name}/Tools/%{name}c/%{name}c.py "\$@" -EOF - -%files -%license LICENSE.txt +%files -f .mfiles %doc ACKNOWLEDGMENTS NEWS README.txt +%license LICENSE.txt %attr(0755,root,root) %{_bindir}/%{name} -%attr(0755,root,root) %{_bindir}/%{name}c -%{_javadir}/* -%{_mavenpomdir}/* %dir %{_datadir}/%{name} +%{_datadir}/%{name}/bin +%{_datadir}/%{name}/javalib +%{_datadir}/%{name}/jython.jar %{_datadir}/%{name}/Lib -%{_datadir}/%{name}/Tools %{_datadir}/%{name}/registry -%if %{defined _maven_repository} -%{_mavendepmapfragdir}/%{name} -%else -%{_datadir}/maven-metadata/%{name}.xml* -%endif %files javadoc %license LICENSE.txt %{_javadocdir}/%{name} - -%files manual -%license LICENSE.txt -%doc README.txt -%doc %{name}-manual-%{version} +%{_datadir}/%{name}/Doc %files demo %license LICENSE.txt -%doc ACKNOWLEDGMENTS NEWS README.txt %{_datadir}/%{name}/Demo %changelog