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-cached-classes.patch b/jython-cached-classes.patch deleted file mode 100644 index 3dd8045..0000000 --- a/jython-cached-classes.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 85a88bcffe2d61d143b4f8c545bd28b152d8d05b Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -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 - 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-cacheperms.patch b/jython-cacheperms.patch deleted file mode 100644 index ee0865a..0000000 --- a/jython-cacheperms.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 517883617472d53c3346ad419f0af42a7dd83705 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -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 - diff --git a/jython-compareto.patch b/jython-compareto.patch deleted file mode 100644 index 4e11ec6..0000000 --- a/jython-compareto.patch +++ /dev/null @@ -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(); - } 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-fix-tty-detection.patch b/jython-fix-tty-detection.patch new file mode 100644 index 0000000..f4ebb23 --- /dev/null +++ b/jython-fix-tty-detection.patch @@ -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") diff --git a/jython-makeCompiledFilename.patch b/jython-makeCompiledFilename.patch deleted file mode 100644 index d0b5215..0000000 --- a/jython-makeCompiledFilename.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 9adf26828ecf5650a86885b344b93242f6617220 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -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 - diff --git a/jython-module.patch b/jython-module.patch deleted file mode 100644 index 9d6eb3a..0000000 --- a/jython-module.patch +++ /dev/null @@ -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()); - diff --git a/jython-nofullbuildpath.patch b/jython-nofullbuildpath.patch deleted file mode 100644 index 4ac1ef2..0000000 --- a/jython-nofullbuildpath.patch +++ /dev/null @@ -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 @@ - - - -- -+ - - - -@@ -572,7 +572,7 @@ - - - -- -+ - -- -+ - - copy misc files from ${jython.base.dir} - -@@ -599,7 +599,7 @@ - - - copy CPython LICENSE from ${svn.checkout.dir}/python -- -+ - - - copy sources from ${jython.base.dir} diff --git a/jython-sourcetarget.patch b/jython-sourcetarget.patch deleted file mode 100644 index 5b4e1a0..0000000 --- a/jython-sourcetarget.patch +++ /dev/null @@ -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 @@ - - - -- -- -+ -+ - - - diff --git a/jython.changes b/jython.changes index 465d444..184d55f 100644 --- a/jython.changes +++ b/jython.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Wed Jun 28 10:40:43 UTC 2023 - Pedro Monreal + +- 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 diff --git a/jython.spec b/jython.spec index 80a901a..b2edb85 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,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