From ea572771d14a8e5485786f37f36da3cf90a5c269800b3fe825400306de5d25aa Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 27 Jun 2023 15:32:50 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jython?expand=0&rev=37 --- jython-cachedir.patch | 17 +++---- jython-fix-tty-detection.patch | 14 ++++++ jython.spec | 82 ++++++++++++++++++++++++---------- 3 files changed, 81 insertions(+), 32 deletions(-) create mode 100644 jython-fix-tty-detection.patch diff --git a/jython-cachedir.patch b/jython-cachedir.patch index 4d16532..8c932f2 100644 --- a/jython-cachedir.patch +++ b/jython-cachedir.patch @@ -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); } - diff --git a/jython-fix-tty-detection.patch b/jython-fix-tty-detection.patch new file mode 100644 index 0000000..2572aa3 --- /dev/null +++ b/jython-fix-tty-detection.patch @@ -0,0 +1,14 @@ +--- src/shell/jython.orig 2017-08-11 16:24:32.831309328 +0100 ++++ 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") diff --git a/jython.spec b/jython.spec index 4883f4f..7b958f4 100644 --- a/jython.spec +++ b/jython.spec @@ -38,6 +38,7 @@ BuildRequires: apache-commons-compress BuildRequires: fdupes BuildRequires: glassfish-servlet-api BuildRequires: guava +BuildRequires: jansi BuildRequires: jarjar BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local @@ -56,6 +57,7 @@ Requires: antlr3-tool Requires: apache-commons-compress Requires: glassfish-servlet-api Requires: guava +Requires: jansi Requires: jarjar Requires: jffi Requires: jline @@ -67,7 +69,6 @@ Requires: lucene-core Requires: objectweb-asm Requires: stringtemplate4 Obsoletes: %{name}-manual -BuildArch: noarch %description Jython is an implementation of the high-level, dynamic, object-oriented @@ -91,6 +92,7 @@ development and in shipping products. %package javadoc Summary: Javadoc for jython Group: Development/Libraries/Java +BuildArch: noarch %description javadoc API documentation for %{name}. @@ -99,6 +101,7 @@ API documentation for %{name}. Summary: Demonstration and samples for jython Group: Development/Libraries/Java Requires: %{name} = %{version}-%{release} +BuildArch: noarch %description demo Demonstrations and samples for %{name}. @@ -110,10 +113,23 @@ Demonstrations and samples for %{name}. %build 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 \ + 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 %{ant} -Djython.version=%{version} @@ -125,10 +141,23 @@ 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 \ + 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 %install @@ -146,21 +175,24 @@ cp -pr dist/Doc/javadoc/* %{buildroot}%{_javadocdir}/%{name} %fdupes -s %{buildroot}%{_javadocdir}/%{name} # jython home dir -install -d -m 755 %{buildroot}%{_datadir}/%{name} -ln -s %{_javadir}/%{name}.jar %{buildroot}%{_datadir}/%{name} -cp -pr dist/javalib %{buildroot}%{_datadir}/%{name} +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 -cp -pr dist/bin %{buildroot}%{_datadir}/%{name} -install -m 644 dist/registry %{buildroot}%{_datadir}/%{name} +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}%{_datadir}/%{name} -fdupes -s %{buildroot}%{_datadir}/%{name}/Lib +cp -pr dist/Lib %{buildroot}%{_libdir}/%{name} +%fdupes -s %{buildroot}%{_libdir}/%{name}/Lib # demo +install -d -m 755 %{buildroot}%{_datadir}/%{name} cp -pr Demo %{buildroot}%{_datadir}/%{name} -fdupes -s %{buildroot}%{_datadir}/%{name}/Demo +%fdupes -s %{buildroot}%{_datadir}/%{name}/Demo # javadoc install -d -m 755 %{buildroot}%{_datadir}/%{name}/Doc @@ -168,22 +200,24 @@ ln -s %{_javadocdir}/%{name} %{buildroot}%{_datadir}/%{name}/Doc/javadoc # scripts install -d %{buildroot}%{_bindir} -ln -s %{_datadir}/%{name}/bin/jython %{buildroot}%{_bindir} +ln -s %{_libdir}/%{name}/bin/jython %{buildroot}%{_bindir} %files -f .mfiles %doc ACKNOWLEDGMENTS NEWS README.txt %license LICENSE.txt %attr(0755,root,root) %{_bindir}/%{name} -%dir %{_datadir}/%{name} -%{_datadir}/%{name}/bin -%{_datadir}/%{name}/javalib -%{_datadir}/%{name}/jython.jar -%{_datadir}/%{name}/Lib -%{_datadir}/%{name}/registry +%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} +%dir %{_datadir}/%{name} %{_datadir}/%{name}/Doc %files demo