diff --git a/fetch-jython.sh b/fetch-jython.sh new file mode 100644 index 0000000..2142916 --- /dev/null +++ b/fetch-jython.sh @@ -0,0 +1,35 @@ +#!/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-cachedir.patch b/jython-cachedir.patch index d7db804..4d16532 100644 --- a/jython-cachedir.patch +++ b/jython-cachedir.patch @@ -1,11 +1,12 @@ ---- jython-20030113/org/python/core/PySystemState.java~ 2003-01-14 16:44:44.000000000 -0500 -+++ jython-20030113/org/python/core/PySystemState.java 2003-01-14 16:47:55.000000000 -0500 -@@ -459,7 +459,13 @@ +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 @@ } - cachedir = new File(props.getProperty("python.cachedir", "cachedir")); + cachedir = new File(props.getProperty(PYTHON_CACHEDIR, CACHEDIR_DEFAULT_NAME)); if (!cachedir.isAbsolute()) { - cachedir = new File(PySystemState.prefix, cachedir.getPath()); -+ File jythondir = new File(System.getProperty("user.home"), ".jython"); ++ File jythondir = new File(System.getProperty("user.home"), ".jython-cache"); + + if (!jythondir.isDirectory()) { + jythondir.mkdirs(); @@ -14,17 +15,4 @@ + cachedir = new File(jythondir, cachedir.getPath()); } } - ---- jython/org/python/core/PySystemState.java~ 2004-02-16 17:27:22.000000000 -0500 -+++ jython/org/python/core/PySystemState.java 2004-02-16 17:29:05.000000000 -0500 -@@ -311,8 +311,8 @@ - } - try { - addRegistryFile(new File(prefix, "registry")); -- File homeFile = new File(registry.getProperty("user.home"), -- ".jython"); -+ File homeFile = new File(new File(registry.getProperty("user.home"), -+ ".jython"), "registry"); - addRegistryFile(homeFile); - } catch (Exception exc) { - ; + diff --git a/jython-cvs.tar.bz2 b/jython-cvs.tar.bz2 deleted file mode 100644 index 0fad791..0000000 --- a/jython-cvs.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:31098a53f8349cafccdbe20420e35ac5da1f6b92e936c92f8a0c643179fdfa08 -size 727159 diff --git a/jython-fetched-src-Release_2_2_1.tar.bz2 b/jython-fetched-src-Release_2_2_1.tar.bz2 new file mode 100644 index 0000000..89deeec --- /dev/null +++ b/jython-fetched-src-Release_2_2_1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:169a2b022faf7362a54591f06585a8f03e88a31df6063d39039f62facbb0854b +size 2546326 diff --git a/jython-new-xml.diff b/jython-new-xml.diff deleted file mode 100644 index e1920b9..0000000 --- a/jython-new-xml.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: jython/build.xml -=================================================================== ---- jython.orig/build.xml 2003-07-31 08:10:33.000000000 +0200 -+++ jython/build.xml 2011-02-22 11:59:08.815316571 +0100 -@@ -272,7 +272,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.changes b/jython.changes index c3e1ec8..7eaf241 100644 --- a/jython.changes +++ b/jython.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 11 13:01:53 UTC 2011 - mvyskocil@suse.cz + +- Update to 2.2.1 - this obsolete the pyxml patch +- merge with jython-2.2.1-6.fc16.src.rpm + ------------------------------------------------------------------- Tue Feb 22 11:06:57 UTC 2011 - coolo@novell.com diff --git a/jython.spec b/jython.spec index d6cb3d6..45a6e81 100644 --- a/jython.spec +++ b/jython.spec @@ -13,36 +13,51 @@ # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ -# -# norootforbuild +%{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')} +%global cpython_version %{pyver} +%global pyxml_version 0.8.3 +%global svn_tag Release_2_2_1 +%global _python_bytecompile_errors_terminate_build 0 Name: jython -BuildRequires: ant ht2html java2-devel-packages libreadline-java mysql-connector-java oro pyxml servletapi5 -%{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')} -%define name jython -%define version 2.2 -%define cpython_version 2.3 -%define cpythondir python%{cpython_version} -%define pyxml_version 0.8.3 -%define release 0.a0.2jpp -%define section free -Version: 2.2 -Release: 326 -Summary: Java Source Interpreter -License: Other uncritical OpenSource License ; Apache Software License -Url: http://www.jython.org/ -Source0: %{name}-cvs.tar.bz2 -Source1: python-release22-maint-cvs.tar.bz2 -Patch0: %{name}-cachedir.patch -Patch1: jython-new-xml.diff -Requires: jpackage-utils >= 1.5 -Requires: oro -Requires: servlet -Group: Development/Libraries/Java -BuildArch: noarch +Version: 2.2.1 +Release: 1 +Summary: A Java implementation of the Python language +License: ASL 1.1 and BSD and CNRI and JPython and Python +URL: http://www.jython.org/ +Group: Development/Languages/Python +# 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 +Requires: jpackage-utils >= 1.5 +Requires: jakarta-oro +Requires: servletapi5 +Requires: python >= %{cpython_version} +Requires: libreadline-java >= 0.8.0-16 +Requires: mysql-connector-java +Requires: java >= 1.6.0 +BuildRequires: ant +BuildRequires: ht2html +BuildRequires: libreadline-java >= 0.8.0-16 +BuildRequires: mysql-connector-java +BuildRequires: jakarta-oro +BuildRequires: python >= %{cpython_version} +BuildRequires: pyxml >= %{pyxml_version} +BuildRequires: servletapi5 +BuildRequires: java-devel >= 1.6.0 BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch %description Jython is an implementation of the high-level, dynamic, object-oriented @@ -63,10 +78,7 @@ 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 -License: Other uncritical OpenSource License ; Apache Software License Summary: Manual for jython Group: Development/Libraries/Java @@ -94,8 +106,6 @@ development and in shipping products. %package javadoc -License: Other uncritical OpenSource License ; Apache Software License -PreReq: coreutils Summary: Javadoc for jython Group: Development/Libraries/Java @@ -123,7 +133,6 @@ development and in shipping products. %package demo -License: Other uncritical OpenSource License ; Apache Software License Summary: Demonstration and samples for jython Requires: %{name} = %{version}-%{release} Group: Development/Libraries/Java @@ -152,99 +161,117 @@ development and in shipping products. %prep -%setup -q -n %{name} -%setup -q -n %{name} -T -D -a 1 +%setup -q -n %{name}-svn-%{svn_tag} %patch0 -p1 %patch1 -p1 -# remove all binary libs -find . -name "*.jar" -exec rm -f {} \; -# remove all CVS files -for dir in `find . -type d -name CVS`; do rm -rf $dir; done -for file in `find . -type f -name .cvsignore`; do rm -rf $file; done %build -export CLASSPATH=$(build-classpath libreadline-java mysql-connector-java oro servlet) +export CLASSPATH=$(build-classpath mysql-connector-java oro servlet) +# FIXME: fix jpackage-utils to handle multilib correctly +export CLASSPATH=$CLASSPATH:%{_libdir}/libreadline-java/libreadline-java.jar + rm -rf org/apache -if ! grep -q "javac.*source=" build.xml ; then - perl -p -i -e 's| $RPM_BUILD_ROOT%{_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="/usr/lib64" ;; + * ) + JYTHONLIBDIR="/usr/lib" ;; +esac + # Configuration MAIN_CLASS=org.python.util.%{name} BASE_FLAGS=-Dpython.home=%{_datadir}/%{name} -BASE_JARS="%{name} oro servlet" -if [ -f %{_libdir}/libJavaReadline.so ]; then - BASE_FLAGS="\$BASE_FLAGS -Dpython.console=org.python.util.ReadlineConsole" - BASE_FLAGS="\$BASE_FLAGS -Djava.library.path=%{_libdir}" - BASE_FLAGS="\$BASE_FLAGS -Dpython.console.readlinelib=GnuReadline" - BASE_JARS="\$BASE_JARS libreadline-java" -fi -if [ -f %{_javadir}/mysql-connector-java.jar ]; then - BASE_JARS="\$BASE_JARS mysql-connector-java" -fi +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 > $RPM_BUILD_ROOT%{_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 -rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/Lib/UserDict.py %clean rm -rf $RPM_BUILD_ROOT @@ -260,16 +287,20 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/%{name}/Tools %{_datadir}/%{name}/registry -%files manual -%defattr(-,root,root) -%doc dist/Doc/*.html dist/Doc/images - %files javadoc %defattr(-,root,root) -%{_javadocdir}/%{name}-%{version} +%doc LICENSE.txt +%{_javadocdir}/%{name} + +%files manual +%defattr(-,root,root) +%doc LICENSE.txt README.txt +%doc %{name}-manual-%{version} + %files demo %defattr(-,root,root) +%doc ACKNOWLEDGMENTS NEWS LICENSE.txt README.txt %{_datadir}/%{name}/Demo %changelog diff --git a/python-release22-maint-cvs.tar.bz2 b/python-release22-maint-cvs.tar.bz2 deleted file mode 100644 index 162656c..0000000 --- a/python-release22-maint-cvs.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:58208b6e7df7204b87376b332b7942c69958ab7d8dcf162fa34358b6193e4138 -size 1405517