Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37823890
en ru br
Репозитории ALT
5.1: 2.2.1-alt5_0.1.Release_2_2_1.1.2jpp5
4.1: 2.2-alt4_0.rc2.1jpp1.7
4.0: 2.2-alt4_0.rc2.1jpp1.7
www.altlinux.org/Changes

Группа :: Разработка/Java
Пакет: jython

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

BuildRequires(pre): j2se-jdbc = 1.4.2
BuildRequires: jline
# recommends
Requires: jline libreadline-java
AutoReq: yes, nopython
BuildRequires: /proc
BuildRequires: jpackage-1.4-compat
# Copyright (c) 2000-2007, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the JPackage Project nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

%define gcj_support 0

%{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}

%define cpython_version 2.4
%define cpythondir      python%{cpython_version}
%define pyxml_version   0.8.3
%define namedversion    2.2-rc2

Name:           jython
Version:        2.2
Release:        alt4_0.rc2.1jpp1.7
Epoch:          0
Summary:        Jython is an implementation of Python written in pure Java.
License:        Modified CNRI Open Source License
URL:            http://www.jython.org/
Source0:        jython-2.2-rc2-src.tar.gz
# svn export http://jython.svn.sourceforge.net/svnroot/jython/tags/Release_2_2rc2/jython/ jython-2.2-rc2-src
Source1:        jython-2.2-rc2.pom

Patch0:         jython-2.2-rc2-build_xml.patch
#rap#Patch0:         %{name}-cachedir.patch
Requires: jpackage-utils >= 0:1.7.2
Requires: jakarta-oro
Requires: servlet
BuildRequires: ant >= 0:1.6
BuildRequires: ht2html
BuildRequires: libreadline-java
BuildRequires: mysql-connector-java
BuildRequires: jakarta-oro
BuildRequires: python >= 0:%{cpython_version}
BuildRequires: python-module-PyXML
BuildRequires: servlet
Group:          Development/Java

Requires(post): jpackage-utils >= 0:1.7.2
Requires(postun): jpackage-utils >= 0:1.7.2
%if ! %{gcj_support}
BuildArch:      noarch
%endif
%if %{gcj_support}
BuildRequires: gnu-crypto
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif

%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
AutoReq: yes, nopython
#AutoProv: yes, nopython

%description demo
Demonstrations and samples for %{name}.

%prep
%setup -q -n %{name}-%{version}-rc2-src
%patch0 -b .sav
# remove all binary libs
for j in $(find . -name "*.jar"); do
   mv $j $j.no
done

%build
export CLASSPATH=$(build-classpath libreadline-java oro servlet)
MYSQLJDBC=
MYSQLJDBC=$(build-classpath mysql-connector-java) || :
[ -n "$MYSQLJDBC" ] && CLASSPATH=$CLASSPATH:$MYSQLJDBC

cat > ant.properties <<EOT
# - define the home for javacc (only used for parser grammar)
javaccHome=%{_javadir}
# - define the home of the corresponding CPython version
python.home=/usr/lib/python%pyver
# - javax.servlet
servlet.jar=%{_javadir}/servlet.jar
# - org.gnu.readline
readline.jar=%{_javadir}/libreadline-java.jar
# - jline
jline.jar=%{_javadir}/jline.jar
# ht2html
ht2html.dir=%{_datadir}/ht2html
# python.exe
python.exe=%{_bindir}/python

# - zxJDBC

# (for mysql, see www.mysql.com/downloads/api-jdbc-stable.html)
# (for postgres, see http://jdbc.postgresql.org/)
mysql.jar=%{_javadir}/mysql-connector-java.jar
postgresql.jar=%{_javadir}/postgresql-jdbc2.jar
#oracle.jar=
#informix.jar=

# - option for javac (build.compiler=modern is a global option to use standard jdk 1.3/1.4/1.5)

#build.compiler=modern
#jdk.target.version=1.4
#debug=false
#optimize=off
#deprecation=off
EOT

ant copy-dist

%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)

%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}
%add_to_maven_depmap org.python %{name} %{version} JPP %{name}

# poms

install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
install -pm 644 %{SOURCE1} \
   $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{name}.pom

# 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}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# 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 "\$ at "
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 "\$ at "
EOF

rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/Lib/UserDict.py

%if %{gcj_support}
export CLASSPATH=$(build-classpath gnu-crypto)
%{_bindir}/aot-compile-rpm --exclude %{_datadir}/%{name}/Demo/jreload
%endif

mkdir -p $RPM_BUILD_ROOT`dirname /etc/jython.conf`
touch $RPM_BUILD_ROOT/etc/jython.conf

mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/jython/cachedir/packages
ln -s $(relative %{_localstatedir}/jython/cachedir %{_datadir}/jython/) $RPM_BUILD_ROOT%{_datadir}/jython/

%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}

%postun javadoc
if [ "$1" = "0" ]; then
   rm -f %{_javadocdir}/%{name}
fi

%post
%update_maven_depmap
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
 %{_bindir}/rebuild-gcj-db
fi
%endif

echo "creating jython cache..."
echo | /usr/bin/jython

%preun
# cleanup
if [ "$1" -eq 0 ]
then
   rm %{_localstatedir}/jython/cachedir/packages/*.{pkc,idx}
   find /usr/share/jython/Lib -name "*py.class" -delete
fi || :

%postun
%update_maven_depmap
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
 %{_bindir}/rebuild-gcj-db
fi
%endif

%files
%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
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif
%config(noreplace,missingok) /etc/jython.conf

%{_localstatedir}/jython
# is it worth ghosting?
#%ghost %{_localstatedir}/jython/cachedir/packages
%{_datadir}/jython/cachedir

%files manual
%doc dist/Doc/*.html dist/Doc/images

%files javadoc
%{_javadocdir}/%{name}-%{version}
%ghost %{_javadocdir}/%{name}

%files demo
%{_datadir}/%{name}/Demo

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin