pkg://jython-2.2-0.a0.1jpp.src.rpm:2140747/jython.spec
info downloads
%{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.1jpp
%define section free
Name: %{name}
Version: %{version}
Release: %{release}
Epoch: 0
Summary: Java source interpreter
License: Modified CNRI Open Source License
URL: http://www.jython.org/
Source0: %{name}-cvs.tar.bz2
Source1: python-release22-maint-cvs.tar.bz2
Patch0: %{name}-cachedir.patch
Requires: jpackage-utils >= 0:1.5
Requires: oro
Requires: servlet
BuildRequires: ant
BuildRequires: ht2html
BuildRequires: libreadline-java
BuildRequires: mysql-connector-java
BuildRequires: oro
BuildRequires: python = 0:%{cpython_version}
BuildRequires: PyXML = 0:%{pyxml_version}
BuildRequires: servlet
Group: Development/Java
Buildarch: noarch
Buildroot: %{_tmppath}/%{name}-%{version}-buildroot
Distribution: JPackage
Vendor: JPackage Project
%description
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 manual
Summary: Manual for %{name}
Group: Development/Java
%description manual
Documentation for %{name}.
%package javadoc
Summary: Javadoc for %{name}
Group: Development/Java
%description javadoc
Javadoc for %{name}.
%package demo
Summary: Demo for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
Group: Development/Java
%description demo
Demonstrations and samples for %{name}.
%prep
rm -rf $RPM_BUILD_ROOT
%setup -q -n %{name}
%setup -q -n %{name} -T -D -a 1
%patch0 -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)
rm -rf org/apache
perl -p -i -e 's|execon|apply|g' build.xml
#ant -Dpython.lib=/usr/lib/python%pyver -DPyXmlHome=/usr/lib/python%pyver copy-dist
ant -Dpython.lib=./python/dist/src/Lib -DPyXmlHome=/usr/lib/python%pyver copy-dist
ant -Dpython.home=%{_bindir} -Dht2html.dir=%{_datadir}/ht2html doc
ant javadoc
%install
# jar
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 dist/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%{version}/}; done)
# manual
rm -f Doc/Makefile
rm -rf Doc/api
# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr dist/Doc/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
# data
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
# these are not supposed to be distributed
find dist/Lib -type d -name test | xargs rm -rf
cp -pr dist/Lib $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -pr dist/Tools $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -pr dist/Demo $RPM_BUILD_ROOT%{_datadir}/%{name}
# registry
install -m 644 registry $RPM_BUILD_ROOT%{_datadir}/%{name}
# scripts
install -d $RPM_BUILD_ROOT%{_bindir}
cat > $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
# 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
# Set parameters
set_jvm
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
%files
%defattr(-,root,root)
%doc ACKNOWLEDGMENTS NEWS LICENSE.txt README.txt
%attr(0755,root,root) %{_bindir}/%{name}
%attr(0755,root,root) %{_bindir}/%{name}c
%{_javadir}/*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/Lib
%{_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}
%files demo
%defattr(-,root,root)
%{_datadir}/%{name}/Demo
%changelog
* Sun Feb 15 2004 David Walluck <david@anti-microsoft.org> 0:2.2-0.a0.1jpp
- 2.2a0 (CVS)
- add URL tag
- add Distribution tag
- change cachedir patch to use ~/.jython instead of ~/tmp
- remove sys.platform patch
- use included python 2.2 files
- mysql support is back
* Fri Apr 11 2003 David Walluck <david@anti-microsoft.org> 0:2.1-5jpp
- rebuild for JPackage 1.5
- remove mm.mysql support
* Sun Jan 26 2003 David Walluck <david@anti-microsoft.org> 2.1-4jpp
- add PyXML modules from 0.8.2
- make BuildRequires a bit more strict
* Wed Jan 22 2003 David Walluck <david@anti-microsoft.org> 2.1-3jpp
- CVS 20030122
- remove javacc dependency (it's non-free, not needed, and the build is broken)
- add python modules (BuildRequires: python)
- add PyXML modules (BuildRequires: PyXML)
- add HTML documentation (BuildRequires: ht2html)
- optional JavaReadline support (BuildRequires: libreadline-java)
- optional MySQL support (BuildRequires: mm.mysql)
- optional PostgreSQL support is not available at this time due to strange jars
- add jython script
- add jythonc script
- add registry
- Patch0: fix cachedir creation in cwd
- Patch1: fix sys.platform (site.py expects format: <os.name>-<os.arch>)
- remove oro class files from jython and require the oro RPM instead
- change Url tag
* Mon Mar 18 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 2.1-2jpp
- generic servlet support
* Wed Mar 06 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 2.1-1jpp
- 2.1
- section macro
* Thu Jan 17 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 2.0-2jpp
- versioned dir for javadoc
- no dependencies for manual and javadoc packages
- stricter dependency for demo package
* Tue Dec 18 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net> 2.0-1jpp
- first JPackage release