Репозиторий Sisyphus
Последнее обновление: 27 февраля 2021 | Пакетов: 17840 | Посещений: 20354500
en ru br
Репозитории ALT
S:2.0-alt2_22jpp8
5.1: 1.4-alt1_1jpp5
4.1: 1.3-alt1_1jpp1.7
4.0: 1.3-alt1_1jpp1.7
www.altlinux.org/Changes

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

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

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

# If you don't want to build with maven, and use straight ant instead,

# give rpmbuild option '--without maven'

%define with_maven %{!?_without_maven:1}%{?_without_maven:0}
%define without_maven %{?_without_maven:1}%{!?_without_maven:0}


Name:           velocity-tools
Version:        1.3
Release:        alt1_1jpp1.7
Epoch:          0
Summary:        Velocity application building tools
License:        Apache Software License
URL:            http://velocity.apache.org/tools/releases/1.3/
Group:          Development/Java
Source0:         http://www.apache.org/dist/velocity/tools/1.3/velocity-tools-1.3-src.tar.gz
Source1:        %{name}-settings.xml
Source2:        %{name}-jpp-depmap.xml
Source3:        sslext-1.2-0.jar
Source4:        %{name}-site.xml

Patch0: velocity-tools-1.3-download_xml.patch
Patch1: velocity-tools-pom_xml.patch
BuildRequires: ant
BuildRequires: jakarta-commons-beanutils >= 0:1.7.0
BuildRequires: jakarta-commons-collections >= 0:3.2
BuildRequires: jakarta-commons-digester >= 0:1.7
BuildRequires: jakarta-commons-lang >= 0:2.2
BuildRequires: jakarta-commons-logging >= 0:1.1
BuildRequires: jakarta-commons-validator >= 0:1.1.4
BuildRequires: dom4j
BuildRequires: jaxen >= 0:1.1
BuildRequires: jpackage-utils >= 0:1.7.2
BuildRequires: servletapi4
BuildRequires: struts >= 0:1.2.7
# FIXME
#BuildRequires: struts-sslext >= 0:1.2
BuildRequires: velocity >= 0:1.4
BuildRequires: velocity-dvsl
BuildRequires: oro >= 0:2.0.8
%if %{with_maven}
BuildRequires: maven2-plugins >= 2.0.4-10jpp
BuildRequires: maven2-plugin-compiler
BuildRequires: maven2-plugin-install
BuildRequires: maven2-plugin-jar
BuildRequires: maven2-plugin-javadoc
BuildRequires: maven2-plugin-resources
BuildRequires: maven2-plugin-site
BuildRequires: maven2-plugin-surefire
BuildRequires: mojo-maven2-plugin-taglist
BuildRequires: maven2-default-skin
%endif

Requires: jakarta-commons-beanutils
Requires: jakarta-commons-collections
Requires: jakarta-commons-digester
Requires: jakarta-commons-lang
Requires: jakarta-commons-logging
Requires: jakarta-commons-validator
Requires: dom4j
Requires: jaxen >= 0:1.1
Requires: jpackage-utils >= 0:1.7.2
Requires: servletapi4
Requires: struts >= 0:1.2.7
Requires: velocity
Requires: velocity-dvsl
Requires: oro
%if ! %{gcj_support}
BuildArch:      noarch
%endif

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

%description
VelocityTools is a collection of Velocity subprojects with a common
goal of creating tools and infrastructure for building both web and
non-web applications using the Velocity template engine.

%package        manual
Summary:        Manual for %{name}
Group:          Development/Java

%description    manual
Documentation for %{name}.

%package        javadoc
Summary:        Javadoc for %{name}
Group:          Development/Documentation

%description    javadoc
Javadoc for %{name}.

%package        demo
Summary:        Demo for %{name}
Group:          Development/Java
Requires: %{name} = %{epoch}:%{version}-%{release}

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

%prep
%setup -q -c -n %{name}-%{version}
# Remove all binary libs used in compiling the package.
#FIXME Use struts-sslext package
find lib -name "*.jar" -and -not -name sslext-1.2.jar -print | xargs rm -f
%patch0 -b .sav
%patch1 -b .sav
cp %{SOURCE1} settings.xml
mkdir -p src/site
cp %{SOURCE4} src/site/site.xml


# dropping this tool: requires sslext

#rm src/java/org/apache/velocity/tools/struts/SecureLinkTool.java
# dropping this tool: needs struts 1.3
rm src/java/org/apache/velocity/tools/struts/ValidatorTool.java

%if %{with_maven}
mkdir -p .m2/repository/JPP/
cp %{SOURCE3} .m2/repository/JPP/sslext.jar
%else

mkdir -p lib
(cd lib
cp %{SOURCE3} .
ln -sf $(build-classpath commons-beanutils)
ln -sf $(build-classpath commons-collections)
ln -sf $(build-classpath commons-digester)
ln -sf $(build-classpath commons-lang)
ln -sf $(build-classpath commons-logging)
ln -sf $(build-classpath commons-validator)
ln -sf $(build-classpath dom4j)
ln -sf $(build-classpath jaxen)
ln -sf $(build-classpath oro)
ln -sf $(build-classpath servletapi4)
ln -sf $(build-classpath struts)
ln -sf $(build-classpath velocity)
ln -sf $(build-classpath velocity-dvsl)
)
#commons-beanutils-1.7.0.jar
#commons-collections-3.2.jar
#commons-digester-1.8.jar
#commons-lang-2.2.jar
#commons-logging-1.1.jar
#commons-validator-1.3.1.jar
#dom4j-1.1.jar
#oro-2.0.8.jar
#servletapi-2.3.jar
#sslext-1.2-0.jar
#struts-core-1.3.5.jar
#struts-taglib-1.3.5.jar
#struts-tiles-1.3.5.jar
#velocity-1.4.jar
#velocity-dvsl-0.43.jar
%endif

%build
%if %{with_maven}
sed -i -e "s|<url>__JPP_URL_PLACEHOLDER__</url>|<url>file://`pwd`/.m2/repository</url>|g" settings.xml
sed -i -e "s|<url>__JAVADIR_PLACEHOLDER__</url>|<url>file://`pwd`/external_repo</url>|g" settings.xml
sed -i -e "s|<url>__MAVENREPO_DIR_PLACEHOLDER__</url>|<url>file://`pwd`/.m2/repository</url>|g" settings.xml
sed -i -e "s|<url>__MAVENDIR_PLUGIN_PLACEHOLDER__</url>|<url>file:///usr/share/maven2/plugins</url>|g" settings.xml
sed -i -e "s|<url>__ECLIPSEDIR_PLUGIN_PLACEHOLDER__</url>|<url>file:///usr/share/eclipse/plugins</url>|g" settings.xml

export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL

mkdir external_repo
ln -s %{_javadir} external_repo/JPP

mvn-jpp \
       -e \
       -s $(pwd)/settings.xml \
       -Dmaven2.jpp.mode=true \
       -Dmaven2.jpp.depmap.file=%{SOURCE2} \
       -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
       install javadoc:javadoc site
%else
ant -Dskip.jar.loading=true jar.struts jar.view jar.generic javadoc docs
%endif

%install

# jars

install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -p -m 644 dist/%{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
%if ! %{with_maven}
install -p -m 644 dist/%{name}-generic-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-generic-%{version}.jar
install -p -m 644 dist/%{name}-view-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-view-%{version}.jar
%endif
%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)

# pom

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

# javadoc

install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
%if %{with_maven}
cp -pr dist/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
%else
cp -pr docs/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
rm -rf docs/javadoc
%endif
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink

# manual

install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/site
cp LICENSE README.txt WHY_THREE_JARS.txt VLS_README.txt STATUS \
                 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
%if %{with_maven}
cp -pr target/site/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/site
%else
cp -pr docs/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/site
%endif

# demo

install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
cp -pr examples test $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}

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

%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

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

%files
%doc %{_docdir}/%{name}-%{version}/LICENSE
%doc %{_docdir}/%{name}-%{version}/STATUS
%doc %{_docdir}/%{name}-%{version}/*.txt
%{_javadir}/*.jar
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}
%if %{gcj_support}
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif

%files manual
%doc %{_docdir}/%{name}-%{version}/site

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

%files demo
%{_datadir}/%{name}-%{version}

# -----------------------------------------------------------------------------


%changelog

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

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