Accepting request 1095810 from Java:packages

2.7.3

OBS-URL: https://build.opensuse.org/request/show/1095810
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/jython?expand=0&rev=31
This commit is contained in:
Dominique Leuenberger 2023-06-30 17:59:34 +00:00 committed by Git OBS Bridge
commit d914335f86
17 changed files with 436 additions and 528 deletions

17
_service Normal file
View File

@ -0,0 +1,17 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://github.com/jython/jython.git</param>
<param name="revision">v2.7.3</param>
<param name="match-tag">v*</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="exclude">**/*.jar</param>
<param name="exclude">**/*.zip</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled"/>
</services>

View File

@ -1,35 +0,0 @@
#!/bin/sh
# Generate a source drop for jython from SVN
# Usage message
usage="usage: $0 <project_name> <svn_root> <svn_tag>"
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

3
jython-2.7.3.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8bbcc0f202babdcb0845c6755ac7ab2f59c9443bebbf532a9f4f577207062ff5
size 12406520

143
jython-build.patch Normal file
View File

@ -0,0 +1,143 @@
--- a/build.xml
+++ b/build.xml
@@ -242,44 +242,14 @@ informix.jar = ../support/jdbc-4.10.12.jar
<filelist files="${informix.location} ${oracle.location}" />
<!-- Further database and Java EE-related JARs -->
- <filelist dir="${extlibs.dir}">
- <file name="servlet-api-2.5.jar" />
- <file name="mysql-connector-java-5.1.42-bin.jar" />
- <file name="postgresql-42.1.1.jre7.jar" />
- </filelist>
+ <fileset dir="${extlibs.dir}">
+ <include name="**/*"/>
+ </fileset>
- <!-- Other JARs (alphabetical) -->
- <filelist dir="${extlibs.dir}">
- <file name="antlr-complete-3.5.2.jar" /> <!-- ANTLR 3 until we upgrade parsing -->
- <file name="asm-9.3.jar" />
- <file name="asm-commons-9.3.jar" />
- <file name="asm-util-9.3.jar" />
- <file name="commons-compress-1.21.jar"/>
- <file name="failureaccess-1.0.1.jar" />
- <file name="guava-31.0.1-jre.jar" />
- <file name="icu4j-71.1.jar" />
- <file name="jffi-1.3.9.jar"/>
- <file name="java-sizeof-0.0.5.jar"/>
- <file name="jnr-constants-0.10.3.jar"/>
- <file name="jnr-ffi-2.2.12.jar"/>
- <file name="jnr-netdb-1.2.0.jar"/>
- <file name="jnr-posix-3.1.15.jar"/>
- <file name="jline-2.14.5.jar"/>
- <file name="netty-buffer-4.1.73.Final.jar"/>
- <file name="netty-codec-4.1.73.Final.jar"/>
- <file name="netty-common-4.1.73.Final.jar"/>
- <file name="netty-handler-4.1.73.Final.jar"/>
- <file name="netty-resolver-4.1.73.Final.jar"/>
- <file name="netty-transport-4.1.73.Final.jar"/>
- </filelist>
</path>
<path id="test.classpath">
<path refid="main.classpath"/>
- <filelist dir="${extlibs.dir}">
- <!-- Pin to 4.10 until dependency on hamcrest classes resolved. -->
- <file name="junit-4.10.jar" />
- </filelist>
<pathelement location="${exposed.dir}" />
<pathelement location="${compile.dir}" />
<pathelement location="${test.compile.dir}" />
@@ -835,80 +805,13 @@ The text for an official release would continue like ...
</target>
<target name="jar-complete" depends="jar, pycompile">
- <taskdef name="jarjar" classname="org.pantsbuild.jarjar.JarJarTask">
+ <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask">
<classpath>
- <pathelement path="extlibs/jarjar-1.7.2.jar" />
<path refid="main.classpath" />
</classpath>
</taskdef>
<jarjar destfile="${dist.dir}/${jython.deploy.jar}" update="${jar.update}">
<zipfileset src="${dist.dir}/${jython.dev.jar}"/>
- <!-- pin to Antlr 3 until we upgrade parsing -->
- <zipfileset src="extlibs/antlr-runtime-3.5.2.jar"/>
- <rule pattern="org.antlr.runtime.**" result="org.python.antlr.runtime.@1"/>
- <zipfileset src="extlibs/asm-9.3.jar" excludes="module-info.class"/>
- <zipfileset src="extlibs/asm-commons-9.3.jar" excludes="module-info.class"/>
- <zipfileset src="extlibs/asm-util-9.3.jar" excludes="module-info.class"/>
- <rule pattern="org.objectweb.asm.**" result="org.python.objectweb.asm.@1"/>
- <zipfileset src="extlibs/bcpkix-jdk18on-1.71.jar" excludes="META-INF/**"/>
- <zipfileset src="extlibs/bcprov-jdk18on-1.71.jar" excludes="META-INF/**"/>
- <rule pattern="org.bouncycastle.**" result="org.python.bouncycastle.@1"/>
- <zipfileset src="extlibs/commons-compress-1.21.jar"/>
- <rule pattern="org.apache.commons.compress.**" result="org.python.apache.commons.compress.@1"/>
- <zipfileset src="extlibs/failureaccess-1.0.1.jar"/>
- <zipfileset src="extlibs/guava-31.0.1-jre.jar"/>
- <rule pattern="com.google.**" result="org.python.google.@1"/>
- <zipfileset src="extlibs/icu4j-71.1.jar"/>
- <rule pattern="com.ibm.icu.**" result="org.python.icu.@1"/>
- <zipfileset src="extlibs/netty-buffer-4.1.73.Final.jar" excludes="META-INF/**"/>
- <rule pattern="io.netty.**" result="org.python.netty.@1"/>
- <zipfileset src="extlibs/netty-codec-4.1.73.Final.jar" excludes="META-INF/**"/>
- <rule pattern="io.netty.**" result="org.python.netty.@1"/>
- <zipfileset src="extlibs/netty-common-4.1.73.Final.jar" excludes="META-INF/**"/>
- <rule pattern="io.netty.**" result="org.python.netty.@1"/>
- <zipfileset src="extlibs/netty-handler-4.1.73.Final.jar" excludes="META-INF/**"/>
- <rule pattern="io.netty.**" result="org.python.netty.@1"/>
- <zipfileset src="extlibs/netty-resolver-4.1.73.Final.jar" excludes="META-INF/**"/>
- <rule pattern="io.netty.**" result="org.python.netty.@1"/>
- <zipfileset src="extlibs/netty-transport-4.1.73.Final.jar" excludes="META-INF/**"/>
- <rule pattern="io.netty.**" result="org.python.netty.@1"/>
- <zipfileset src="${extlibs.dir}/java-sizeof-0.0.5.jar"/>
- <rule pattern="com.carrotsearch.sizeof.**" result="org.python.sizeof.@1"/>
- <!-- these stub jars are pre-built in https://github.com/jnr/jffi/tree/master/archive
- and rarely if ever change -->
- <zipfileset src="extlibs/jffi-aarch64-Linux.jar"/>
- <zipfileset src="extlibs/jffi-arm-Linux.jar"/>
- <zipfileset src="extlibs/jffi-Darwin.jar"/>
- <zipfileset src="extlibs/jffi-i386-FreeBSD.jar"/>
- <zipfileset src="extlibs/jffi-i386-Linux.jar"/>
- <zipfileset src="extlibs/jffi-i386-OpenBSD.jar"/>
- <zipfileset src="extlibs/jffi-i386-SunOS.jar"/>
- <zipfileset src="extlibs/jffi-i386-Windows.jar"/>
- <zipfileset src="extlibs/jffi-ppc64le-Linux.jar"/>
- <zipfileset src="extlibs/jffi-ppc-AIX.jar"/>
- <zipfileset src="extlibs/jffi-ppc-Linux.jar"/>
- <zipfileset src="extlibs/jffi-ppc64-Linux.jar"/>
- <zipfileset src="extlibs/jffi-s390x-Linux.jar"/>
- <zipfileset src="extlibs/jffi-sparc-SunOS.jar"/>
- <zipfileset src="extlibs/jffi-sparcv9-SunOS.jar"/>
- <zipfileset src="extlibs/jffi-x86_64-FreeBSD.jar"/>
- <zipfileset src="extlibs/jffi-x86_64-Linux.jar"/>
- <zipfileset src="extlibs/jffi-x86_64-OpenBSD.jar"/>
- <zipfileset src="extlibs/jffi-x86_64-SunOS.jar"/>
- <zipfileset src="extlibs/jffi-x86_64-Windows.jar"/>
- <!-- remainder of JNR, JFFI -->
- <zipfileset src="extlibs/jffi-1.3.9.jar"/>
- <zipfileset src="${extlibs.dir}/jnr-constants-0.10.3.jar"/>
- <zipfileset src="${extlibs.dir}/jnr-ffi-2.2.12.jar"/>
- <zipfileset src="${extlibs.dir}/jnr-netdb-1.2.0.jar"/>
- <zipfileset src="${extlibs.dir}/jnr-posix-3.1.15.jar"/>
- <zipfileset src="extlibs/xercesImpl-2.12.2.jar" excludes="META-INF/services/*"/>
- <rule pattern="org.apache.xml.**" result="org.python.apache.xml.@1"/>
- <rule pattern="org.apache.xerces.**" result="org.python.apache.xerces.@1"/>
- <rule pattern="org.apache.wml.**" result="org.python.apache.wml.@1"/>
- <rule pattern="org.apache.html.**" result="org.python.apache.html.@1"/>
- <zipfileset src="extlibs/jline-2.14.5.jar"/>
- <rule pattern="jline.**" result="org.python.jline.@1"/>
<manifest>
<attribute name="Main-Class" value="org.python.util.jython" />
<attribute name="Built-By" value="${user.name}" />
--- 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;

View File

@ -1,68 +0,0 @@
From 85a88bcffe2d61d143b4f8c545bd28b152d8d05b Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lubo.rintel@gooddata.com>
Date: Wed, 3 Apr 2013 18:31:40 +0200
Subject: [PATCH 3/3] Use cache dir for classes too
Instead of attempting to write them next to source files.
Java 6 API does not allow for setting sane permissions (i.e. same as
those of a source file) and relying on defaults is a security hazard
which can lead to information disclosure, or, in case of a too relaxed
umask, arbitrary code execution.
Also, this will likely improve performance for non-privileged users
which can not write to their distribution's packaged jython tree.
---
src/org/python/core/PySystemState.java | 6 ++++++
src/org/python/core/imp.java | 12 ++++++++++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/org/python/core/PySystemState.java b/src/org/python/core/PySystemState.java
index 9de34e3..a124228 100644
--- a/src/org/python/core/PySystemState.java
+++ b/src/org/python/core/PySystemState.java
@@ -539,6 +539,12 @@ public class PySystemState extends PyObject
public static PackageManager packageManager;
public static File cachedir;
+ public static File classCache() {
+ if (cachedir == null)
+ return null;
+ return new File(cachedir, "classes");
+ }
+
public static boolean isPackageCacheEnabled() {
return cachedir != null;
}
diff --git a/src/org/python/core/imp.java b/src/org/python/core/imp.java
index a9868dd..67c33d6 100644
--- a/src/org/python/core/imp.java
+++ b/src/org/python/core/imp.java
@@ -117,8 +117,15 @@ public class imp {
}
private static String makeCompiledFilename(String filename) {
- return filename.substring(0, filename.length() - 3)
- + "$py.class";
+ String basename = filename.substring(0, filename.length() - 3)
+ + "$py.class";
+ File cache = Py.getSystemState().classCache();
+
+ if (cache == null) {
+ return basename;
+ } else {
+ return new File(cache, basename).getPath();
+ }
}
/**
@@ -144,6 +151,7 @@ public class imp {
}
FileOutputStream fop = null;
try {
+ new File(compiledFilename).getParentFile().mkdirs();
fop = new FileOutputStream(compiledFilename);
fop.write(compiledSource);
fop.close();
--
1.8.3.1

View File

@ -1,18 +1,19 @@
diff -ur jython-svn-Release_2_2beta1/src/org/python/core/PySystemState.java jython-svn-Release_2_2beta1.patched/src/org/python/core/PySystemState.java
--- jython-svn-Release_2_2beta1/src/org/python/core/PySystemState.java 2007-02-07 02:19:53.000000000 -0500
+++ jython-svn-Release_2_2beta1/src/org/python/core/PySystemState.java 2007-03-23 09:41:27.000000000 -0400
@@ -534,7 +534,13 @@
diff --git a/src/org/python/core/PySystemState.java b/src/org/python/core/PySystemState.java
index 1fb701d..ee9b38f 100644
--- a/src/org/python/core/PySystemState.java
+++ b/src/org/python/core/PySystemState.java
@@ -1278,9 +1278,11 @@ public class PySystemState extends PyObject
}
cachedir = new File(props.getProperty(PYTHON_CACHEDIR, CACHEDIR_DEFAULT_NAME));
if (!cachedir.isAbsolute()) {
- cachedir = new File(PySystemState.prefix, cachedir.getPath());
- String prefixString = props.getProperty("user.dir", "");
- cachedir = new File(prefixString, cachedir.getPath());
- cachedir = cachedir.getAbsoluteFile();
+ File jythondir = new File(System.getProperty("user.home"), ".jython-cache");
+
+ if (!jythondir.isDirectory()) {
+ jythondir.mkdirs();
+ }
+
+ cachedir = new File(jythondir, cachedir.getPath());
}
logger.log(Level.CONFIG, "cache at {0}", cachedir);
}

View File

@ -1,31 +0,0 @@
From 517883617472d53c3346ad419f0af42a7dd83705 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lubo.rintel@gooddata.com>
Date: Wed, 3 Apr 2013 18:24:46 +0200
Subject: [PATCH 1/3] Make cache not accessible by anyone else
Sensitive information might be being cached or umask can be too relaxed,
allowing writes.
---
src/org/python/core/CachedJarsPackageManager.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/org/python/core/CachedJarsPackageManager.java b/src/org/python/core/CachedJarsPackageManager.java
index 6953136..764f2f3 100644
--- a/src/org/python/core/CachedJarsPackageManager.java
+++ b/src/org/python/core/CachedJarsPackageManager.java
@@ -587,6 +587,12 @@ public abstract class CachedJarsPackageManager extends PackageManager {
return false;
}
+ aCachedir1.setReadable(false, false);
+ aCachedir1.setWritable(false, false);
+ aCachedir1.setExecutable(false, false);
+ aCachedir1.setReadable(true, true);
+ aCachedir1.setWritable(true, true);
+ aCachedir1.setExecutable(true, true);
this.cachedir = aCachedir1;
return true;
--
1.8.3.1

View File

@ -1,14 +0,0 @@
--- jython-svn-Release_2_2_1/Lib/test/javatests/AnonInner.java 2006-04-09 18:14:16.000000000 +0200
+++ jython-svn-Release_2_2_1/Lib/test/javatests/AnonInner.java 2017-09-08 11:14:45.116655838 +0200
@@ -9,11 +9,6 @@
public int hashCode() {
return 2000;
}
- //XXX: stuck compareTo to make the compiler happier.
- // hopefully this doesn't mess up the test.
- public int compareTo(Object x) {
- return 0;
- }
};
return d.hashCode();
}

View File

@ -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 @@
<move file="${stage}/${install.name}.jar"
tofile="${install.dir}/${install.name}.jar"/>
- <move file="${stage}/${install.name}-sources.jar"
- tofile="${install.dir}/${install.name}-sources.jar"/>
<checksum algorithm="SHA1" fileext=".sha1">
<fileset dir="${install.dir}" excludes="*.sha1,*.md5,*.tmp"/>
@@ -114,7 +112,7 @@
<!--
Performs Maven build staging
-->
- <target name="stage" depends="validate-pom">
+ <target name="stage">
<property name="stage" value="${build}/"/>
<mkdir dir="${stage}"/>
@@ -135,23 +133,6 @@
</jar>
</target>
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 @@
</filterset>
</copy>
- <!--
- Performs POM Schema validation.
- -->
- <target name="validate-pom">
- <xmlvalidate failonerror="true" file="maven/pom.xml">
- <attribute name="http://xml.org/sax/features/validation"
- value="true"/>
- <attribute name="http://apache.org/xml/features/validation/schema"
- value="true"/>
- <attribute name="http://xml.org/sax/features/namespaces"
- value="true"/>
- <property
- name="http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"
- value="maven/maven-v4_0_0.xsd"/>
- </xmlvalidate>
- </target>
-
<target name="build-jython" depends="clean">
<ant antfile="build.xml" target="developer-build"/>
</target>
- <!-- Sign everything. -->
- <sign-all stageDir="@{stageDir}" artifactId="@{artifactId}" version="@{version}" />
-
<!-- JAR-up the entire contents of the staging directory. -->
<jar jarfile="${pubs.dir}/@{basename}-bundle.jar">
<fileset dir="@{stageDir}" />
@@ -175,9 +172,6 @@
<attribute name="stageDir" default="${build.maven}" />
<attribute name="basename" default="@{artifactId}-@{version}" />
<sequential>
- <!-- Validate the POM -->
- <validate-pom file="@{fromdir}/@{basename}.pom" />
-
<!-- Clean the staging directory. -->
<delete dir="@{stageDir}" />
<mkdir dir="@{stageDir}" />
@@ -190,9 +184,6 @@
</fileset>
</copy>
- <!-- Sign everything. -->
- <sign-all stageDir="@{stageDir}" artifactId="@{artifactId}" version="@{version}" />
-
<!-- JAR-up the entire contents of the staging directory. -->
<jar jarfile="${pubs.dir}/@{basename}-bundle.jar">
<fileset dir="@{stageDir}" />
@@ -200,61 +191,11 @@
</sequential>
</macrodef>
- <!-- Add detached signature for single artifact in staging directory. -->
- <macrodef name="sign-detached">
- <attribute name="file" />
- <attribute name="stageDir" />
- <sequential>
- <!-- Generate a detached signature for each artifact in the bundle. -->
- <exec executable="gpg" dir="@{stageDir}">
- <arg value="-ab" />
- <arg value="@{file}" />
- </exec>
- </sequential>
- </macrodef>
-
- <!-- Add detached signatures for group of artifacts in staging directory. -->
- <macrodef name="sign-all">
- <attribute name="artifactId" />
- <attribute name="version" />
- <attribute name="stageDir" />
- <attribute name="basename" default="@{artifactId}-@{version}" />
- <sequential>
- <sign-detached stageDir="@{stageDir}" file="@{basename}.pom" />
- <sign-detached stageDir="@{stageDir}" file="@{basename}.jar" />
- <sign-detached stageDir="@{stageDir}" file="@{basename}-sources.jar" />
- <sign-detached stageDir="@{stageDir}" file="@{basename}-javadoc.jar" />
- </sequential>
- </macrodef>
-
- <!-- Validate a Maven POM . -->
- <macrodef name="validate-pom">
- <attribute name="file" />
- <sequential>
- <xmlvalidate failonerror="true" file="@{file}">
- <attribute name="http://xml.org/sax/features/validation" value="true" />
- <attribute name="http://apache.org/xml/features/validation/schema" value="true" />
- <attribute name="http://xml.org/sax/features/namespaces" value="true" />
- <property name="http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation" value="maven/maven-v4_0_0.xsd" />
- </xmlvalidate>
- </sequential>
- </macrodef>
-
- <!-- Validate the POM template. -->
- <target name="validate-template-pom">
- <validate-pom file="maven/pom-template.xml"/>
- </target>
-
- <!-- Validate the base POM produced by Gradle task generatePomFileForMainPublication. -->
- <target name="validate-gradle-pom" depends="version">
- <validate-pom file="${gradle.base}/publications/main/pom-default.xml"/>
- </target>
-
<target name="build-jython" if="do.build">
<ant antfile="build.xml" target="all-jars" />
</target>
- <target name="prepare" depends="build-jython, validate-template-pom, version">
+ <target name="prepare" depends="build-jython, version">
<local name="artifacts" />
<property name="artifacts" value="${gradle.repo}/${m2.groupDir}/jython-slim/${jython.version}" />
<condition property="gradle.published">
Only in jython-2.7.3/maven: build.xml.orig
Only in jython-2.7.3/maven: build.xml.rej

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:169a2b022faf7362a54591f06585a8f03e88a31df6063d39039f62facbb0854b
size 2546326

View File

@ -0,0 +1,14 @@
--- jython-2.7.3/src/shell/jython.orig 2017-08-11 16:24:32.831309328 +0100
+++ jython-2.7.3/src/shell/jython 2017-08-11 16:23:55.346726416 +0100
@@ -242,6 +242,11 @@
fi
fi
+# Detect absence of tty
+if ! tty -s; then
+ JAVA_OPTS="$JAVA_OPTS -Dpython.launcher.tty=false"
+fi
+
if [ -n "$profile_requested" -o -z "$boot_requested" ] ; then
[ -n "$profile_requested" ] && echo "Running with instrumented profiler"
java_args=("${java_args[@]}" -classpath "$CP$CP_DELIMITER$CLASSPATH")

View File

@ -1,34 +0,0 @@
From 9adf26828ecf5650a86885b344b93242f6617220 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lubo.rintel@gooddata.com>
Date: Wed, 3 Apr 2013 18:32:14 +0200
Subject: [PATCH 2/3] Avoid code duplication with makeCompiledFilename()
---
src/org/python/core/imp.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/org/python/core/imp.java b/src/org/python/core/imp.java
index a902079..a9868dd 100644
--- a/src/org/python/core/imp.java
+++ b/src/org/python/core/imp.java
@@ -424,7 +424,7 @@ public class imp {
int nlen = name.length();
String sourceName = "__init__.py";
- String compiledName = "__init__$py.class";
+ String compiledName = makeCompiledFilename(sourceName);
String directoryName = defaultEmptyPathDirectory(entry.toString());
// First check for packages
@@ -437,7 +437,7 @@ public class imp {
if (!pkg) {
Py.writeDebug(IMPORT_LOG, "trying source " + dir.getPath());
sourceName = name + ".py";
- compiledName = name + "$py.class";
+ compiledName = makeCompiledFilename(sourceName);
sourceFile = new File(directoryName, sourceName);
compiledFile = new File(directoryName, compiledName);
} else {
--
1.8.3.1

View File

@ -1,11 +0,0 @@
--- jython-svn-Release_2_2_1/src/org/python/parser/TreeBuilder.java 2007-06-30 10:57:09.000000000 +0200
+++ jython-svn-Release_2_2_1/src/org/python/parser/TreeBuilder.java 2017-09-08 11:05:27.462211440 +0200
@@ -111,7 +111,7 @@
case JJTSINGLE_INPUT:
return new Interactive(makeStmts(arity));
case JJTFILE_INPUT:
- return new Module(makeStmts(arity));
+ return new org.python.parser.ast.Module(makeStmts(arity));
case JJTEVAL_INPUT:
return new Expression(makeExpr());

View File

@ -1,40 +0,0 @@
Index: jython-svn-Release_2_2_1/build.xml
===================================================================
--- jython-svn-Release_2_2_1.orig/build.xml 2007-10-13 20:44:01.000000000 +0200
+++ jython-svn-Release_2_2_1/build.xml 2011-03-11 13:44:32.516562588 +0100
@@ -551,7 +551,7 @@
<!-- build the .html files using the ht2html tool -->
- <target name="doc" depends="compile" if="full-build">
+ <target name="doc" depends="compile">
<fail unless="ht2html.dir" message="ht2html.dir is not set" />
<copy todir="${dist.dir}/Doc" preservelastmodified="true">
<fileset dir="Doc" includes="*.ht, **/*.gif" />
@@ -572,7 +572,7 @@
<!-- javadoc -->
- <target name="javadoc" depends="compile" if="full-build">
+ <target name="javadoc" depends="compile">
<javadoc sourcepath="${source.dir}"
destdir="${apidoc.dir}"
source="${jdk.source.version}"
@@ -588,7 +588,7 @@
<!-- copy for full distribution -->
- <target name="copy-full" if="full-build">
+ <target name="copy-full">
<!-- Misc files -->
<echo>copy misc files from ${jython.base.dir}</echo>
<copy todir="${dist.dir}" preservelastmodified="true">
@@ -599,7 +599,7 @@
<!-- copy the CPython license -->
<echo>copy CPython LICENSE from ${svn.checkout.dir}/python</echo>
- <copy file="${svn.checkout.dir}/python/LICENSE" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" />
+ <copy file="LICENSE.txt" tofile="${dist.dir}/LICENSE_CPython.txt" preservelastmodified="true" />
<!-- sources: todir has to correspond with installer/**/JarInstaller.java -->
<echo>copy sources from ${jython.base.dir}</echo>

View File

@ -1,13 +0,0 @@
--- jython-svn-Release_2_2_1/build.xml 2007-10-13 20:44:01.000000000 +0200
+++ jython-svn-Release_2_2_1/build.xml 2017-09-08 11:01:08.947884132 +0200
@@ -174,8 +174,8 @@
<property file="${basedir}/ant.properties" />
<property name="build.compiler" value="modern" />
- <property name="jdk.target.version" value="1.4" />
- <property name="jdk.source.version" value="1.4" />
+ <property name="jdk.target.version" value="1.8" />
+ <property name="jdk.source.version" value="1.8" />
<property name="deprecation" value="off" />
<property name="debug" value="off" />
<property name="optimize" value="on" />

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Wed Jun 28 10:40:43 UTC 2023 - Pedro Monreal <pmonreal@suse.com>
- Update to 2.7.3: [bsc#1186065]
* See full changelog in the NEWS file.
* Fetch sources by source _service in order to exclude
the different binary jar files
* Add jython-fix-tty-detection.patch
* Rebase patches:
- jython-dont-validate-pom.patch
- jython-build.patch
- jython-cachedir.patch
* Remove patches fixed upstream:
- jython-makeCompiledFilename.patch
- jython-module.patch
- jython-nofullbuildpath.patch
- jython-cacheperms.patch
- jython-compareto.patch
- jython-sourcetarget.patch
- jython-cached-classes.patch
-------------------------------------------------------------------
Sun Mar 20 12:20:10 UTC 2022 - Fridrich Strba <fstrba@suse.com>

View File

@ -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,55 +19,58 @@
%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
Patch2: %{name}-cachedir.patch
Patch3: %{name}-fix-tty-detection.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: jansi
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
BuildArch: noarch
BuildRequires: stringtemplate4
Requires: antlr3-java
Requires: antlr3-tool
Requires: apache-commons-compress
Requires: glassfish-servlet-api
Requires: guava
Requires: jansi
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
%description
Jython is an implementation of the high-level, dynamic, object-oriented
@ -88,132 +91,90 @@ 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
Provides: jython-manual = %{version}
Obsoletes: jython-manual < %{version}
BuildArch: noarch
%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
Group: Development/Libraries/Java
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%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}
%patch0 -p1
%patch1 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%autosetup -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 \
jansi/jansi \
jarjar \
jline/jline \
jnr/jnr-constants \
jnr/jnr-ffi \
jnr/jnr-posix \
junit \
lucene/lucene-core \
objectweb-asm/asm \
objectweb-asm/asm-commons \
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 \
jansi/jansi \
jarjar \
jline/jline \
jnr/jnr-constants \
jnr/jnr-ffi \
jnr/jnr-posix \
junit \
lucene/lucene-core \
objectweb-asm/asm \
objectweb-asm/asm-commons \
objectweb-asm/asm-util \
stringtemplate4/ST4
# remove shebangs from python files
find dist -type f -name '*.py' | xargs sed -i "s:#!\s*/usr.*::"
# fix env-script-interpreter
sed -i 's/env bash/bash/' dist/bin/%{name}{,.py}
%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 +182,54 @@ install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr dist/Doc/javadoc/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
# data
install -d -m 755 %{buildroot}%{_datadir}/%{name}
# these are not supposed to be distributed
find dist/Lib -type d -name test | xargs rm -rf
# jython home dir
install -d -m 755 %{buildroot}%{_libdir}/%{name}
ln -s %{_javadir}/%{name}.jar %{buildroot}%{_libdir}/%{name}
ln -s %{_javadir}/%{name}.jar %{buildroot}%{_libdir}/%{name}/%{name}-dev.jar
cp -pr dist/javalib %{buildroot}%{_libdir}/%{name}
rm dist/bin/jython_regrtest.bat
rm dist/bin/jython.exe
cp -pr dist/bin %{buildroot}%{_libdir}/%{name}
install -m 644 dist/registry %{buildroot}%{_libdir}/%{name}
# libs without tests
rm -rf dist/Lib/{distutils/tests,email/test,json/tests,test,unittest/test}
cp -pr dist/Lib %{buildroot}%{_libdir}/%{name}
%fdupes -s %{buildroot}%{_libdir}/%{name}/Lib
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}
install -d -m 755 %{buildroot}%{_datadir}/%{name}
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 %{_libdir}/%{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}/Lib
%{_datadir}/%{name}/Tools
%{_datadir}/%{name}/registry
%if %{defined _maven_repository}
%{_mavendepmapfragdir}/%{name}
%else
%{_datadir}/maven-metadata/%{name}.xml*
%endif
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/bin
%{_libdir}/%{name}/javalib
%{_libdir}/%{name}/jython.jar
%{_libdir}/%{name}/jython-dev.jar
%{_libdir}/%{name}/Lib
%{_libdir}/%{name}/registry
%files javadoc
%license LICENSE.txt
%{_javadocdir}/%{name}
%files manual
%license LICENSE.txt
%doc README.txt
%doc %{name}-manual-%{version}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/Doc
%files demo
%license LICENSE.txt
%doc ACKNOWLEDGMENTS NEWS README.txt
%{_datadir}/%{name}/Demo
%changelog