Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1585835
 поиск   регистрация   авторизация 
 
Группа :: Разработка/Java
Пакет: xalan-j

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

%define dist_version 2_6_0
%define jaxp_altlevel 120

Name: xalan-j
Version: 2.6.0
Release: alt0.M24.1

%def_disable xsltc
%def_disable demo

Summary: Java XSLT processor
Group: Development/Java
License: Apache
Url: http://xml.apache.org/xalan-j/

Packager: Mikhail Zabaluev <mhz at altlinux.ru>

Provides: jaxp_transform_impl = 1.2

Requires: xml-commons-apis java-common >= 1.2
Requires: jaxp_parser_impl j2se >= 1.4.2

Source: http://xml.apache.org/dist/xalan-j/%{name}_%{dist_version}-src.tar.bz2
Patch0: %name-2.6.0-manifest.patch

BuildArch: noarch

BuildPreReq: /proc
BuildPreReq: j2se1.4-sun-devel ant java-common >= 1.2 rpm-build-java
BuildPreReq: xml-commons-apis libalternatives-devel
BuildPreReq: xerces-j
# Don't BuildRequire system stylebook as it BuildRequires xalan-j
BuildPreReq: xvfb-run

%if_enabled xsltc
BuildPreReq: jakarta-bcel
BuildPreReq: jakarta-regexp
#BuildRequires: jlex
#BuildRequires: java_cup
%endif # enabled xsltc

%if_enabled demo
BuildPreReq: servlet
Requires: servlet
%endif

%description
Xalan is an XSLT processor for transforming XML documents into HTML,
text, or other XML document types. It implements the W3C Recommendations
for XSL Transformations (XSLT) and the XML Path Language (XPath). It can
be used from the command line, in an applet or a servlet, or as a module
in other program.

%if_enabled xsltc
%package xsltc
Summary: XSLT compiler
Group: Development/Java
Requires: jakarta-bcel jakarta-regexp jaxp_parser_impl
Requires: java-common >=1.2
#Requires: java_cup jlex

%description xsltc
The XSLT Compiler is a Java-based tool for compiling XSLT stylesheets into
lightweight and portable Java byte codes called translets.
%endif # enabled xsltc

%package manual
Summary: Manual for %name
Group: Development/Java
Requires: %name = %version-%release

%description manual
Documentation for Xalan-J, a Java XSLT processor.

%package javadoc
Summary: Javadoc for %name
Group: Development/Java
Requires: java-common >= 1.2

%description javadoc
Javadoc-generated API documentation for Xalan-J, a Java XSLT processor.

%if_enabled demo
%package demo
Summary: Demo for %name
Group: Development/Java
Requires: servlet
Requires: %name = %version-%release

%description demo
Demonstrations and samples for Xalan-J, a Java XSLT processor.
%endif # enabled demo

%prep
%setup -q -n %{name}_%{dist_version}
%patch0 -p1
# remove all binary libs
#find . -name "*.jar" ! -name "xalan2jdoc.jar" ! -name "stylebook-1.0-b3_xalan-2.jar" -exec rm -f {} \;

%build

%__rm bin/xml-apis.jar
%__ln_s %_javadir/xml-commons-apis.jar bin/xml-apis.jar

%__rm bin/xercesImpl.jar
%__ln_s %_javadir/jaxp_parser_impl.jar bin/xercesImpl.jar

xvfb-run %__ant \
 xalan-interpretive.jar\
 javadocs.nojardepends \
 docs.nojardepends

%if_enabled xsltc

%__rm bin/regexp.jar
%__ln_s %_javadir/jakarta-regexp.jar bin/regexp.jar

%__rm bin/BCEL.jar
%__ln_s %_javadir/jakarta-bcel.jar bin/BCEL.jar

%__ant \
 xsltc.unbundledjar \
 xsltc.docs
%endif

%if_enabled demo
%__ant \
 samples \
 servlet
%endif

%install

%__mkdir_p %buildroot%_javadir
%__mkdir_p %buildroot%_docdir/%name-%version/docs
%__mkdir_p %buildroot%_javadocdir/%name
%__mkdir_p %buildroot%_altdir

# jars

%__install -m 644 build/xalan.jar %buildroot%_javadir/%name.jar

%if_enabled xsltc
%__install -m 644 build/xsltc.jar %buildroot%_javadir/xsltc.jar
%endif

# manual

%__cp -r build/docs/* %buildroot%_docdir/%name-%version/docs

# javadoc

%__mv %buildroot%_docdir/%name-%version/docs/apidocs/* %buildroot%_javadocdir/%name/
rmdir %buildroot%_docdir/%name-%version/docs/apidocs
%__ln_s %_javadocdir/%name %buildroot%_docdir/%name-%version/docs/apidocs

# license

%__install -m 644 LICENSE NOTICE %buildroot%_docdir/%name-%version

# alternative

%__cat <<EOF >%buildroot%_altdir/%name
<group name="candidate">
<option name="link">%_javadir/jaxp_transform_impl.jar</option>
<option name="real">%_javadir/%name.jar</option>
<option name="weight">%jaxp_altlevel</option>
</group>
EOF

%if_enabled demo
# demo
%__mkdir_p %buildroot%_datadir/%name/samples

%__install -m 644 build/xalansamples.jar %buildroot%_datadir/%name/samples/%name-samples.jar
%__install -m 644 build/xalanservlet.war %buildroot%_datadir/%name/samples/%name-servlet.war
%__cp -r samples %buildroot%_datadir/%name
%endif # enabled demo

%post
%register_alternatives %name -- jaxp_transform_impl

%preun
%unregister_alternatives %name

%files
%dir %_docdir/%name-%version/
%_docdir/%name-%version/LICENSE
%_docdir/%name-%version/NOTICE
%_javadir/%name.jar
%_altdir/%name

%if_enabled xsltc
%files xsltc
%_javadir/xsltc.jar
%endif # enabled xsltc

%files manual
%_docdir/%name-%version/docs

%files javadoc
%_javadocdir/%name

%if_enabled demo
%files demo
%_datadir/%name
%endif # enabled demo

%changelog

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

 
design & coding: Vladimir Lettiev aka crux © 2004-2005