Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37725000
en ru br
Репозитории ALT
S:2.0.0-alt1_2jpp11
5.1: 1.0-alt3_0.a17.1jpp5
4.1: 1.0-alt2_0.a15.1jpp1.7
4.0: 1.0-alt2_0.a15.1jpp1.7
www.altlinux.org/Changes

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

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

Packager: Igor Vlasenko <viy at altlinux.ru>
BuildRequires: saxpath
BuildRequires: /proc
BuildRequires: jpackage-compat
%define version 1.0
%define name modello
# Copyright (c) 2000-2008, 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}


%define repo_dir    .m2/repository

%define namedversion 1.0-alpha-17
%define maven_settings_file %{_builddir}/%{name}-%{namedversion}/settings.xml

Name:           modello
Version:        1.0
Release:        alt3_0.a17.1jpp5
Epoch:          0
Summary:        Modello Data Model toolkit
License:        Open Source
Group:          Development/Java
URL:            http://modello.codehaus.org/
Source0:        %{name}-%{namedversion}.tar.gz
# svn export svn://svn.modello.codehaus.org/modello/tags/modello-1.0-alpha-17

Source1:        modello.script

Source2:        %{name}-jpp-depmap.xml
Source3:        %{name}-autogenerated-files.tar.gz

#Patch0:         modello-plugins-pom_xml.patch

Patch1:         modello-plugin-jpox-pom_xml.patch
#Patch0:                 modello-hibernateold-artifactid-fix.patch
Patch2:         modello-plugin-jpox-JPoxJdoMappingModelloGeneratorPrefixedTest.patch
Patch3:         modello-plugin-jpox-JPoxJdoMappingModelloGeneratorTest.patch
#Patch4:         modello-plugin-stax-StaxVerifierParts.patch
#Patch5:         modello-plugin-stax-StaxVerifierVersionInField.patch
#Patch6:         modello-plugin-stax-StaxVerifierVersionInNamespace.patch
Patch7:         modello-plugin-stax-StaxVerifierVersionReaderDelegate.patch
#Patch8:         modello-plugin-stax-StaxVerifierWrongVersionNamespace.patch
#Patch9:         modello-plugin-stax-StaxVerifierWrongVersion.patch
Patch10:        modello-plugin-converters-ConvertersVerifier.patch
#Patch11:        modello-plugin-xpp3-Xpp3Verifier.patch
#Patch12:        modello-maven-plugin-pom_xml.patch
Patch13:        modello-build-all-plugins.patch
# the following patch is required for plexus-container-default = 1.0-alpha-8
#Patch14:        modello-old-plexus-container.patch
Patch15:        modello-ObjStateFactoryModelloGenerator.patch
Patch16:        modello-LdapSchemaModelloGenerator.patch
Patch17:        modello-LdapSchemaGeneratorTest.patch
Patch18:        modello-site_xml.patch
#Patch19:        modello-plugin-plexus-registry-pom.patch
#Patch20:        modello-db-keywords-pom.patch
Patch21:        modello-plugin-velocity-VelocityGenerator.patch
Patch22:        modello-ObjStateFactoryModelloGeneratorTest.patch

Patch99:        modello-temp-AbstractVelocityModelloGenerator.patch


%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif
%if ! %{gcj_support}
BuildArch:      noarch
%endif

BuildRequires: jpackage-utils >= 0:1.7.3
BuildRequires: ant >= 0:1.6.5
BuildRequires: jmock
%if %{with_maven}
BuildRequires: maven2 >= 2.0.7
BuildRequires: maven2-plugin-ant
BuildRequires: maven2-plugin-assembly
BuildRequires: maven2-plugin-compiler
BuildRequires: maven2-plugin-install
BuildRequires: maven2-plugin-jar
BuildRequires: maven2-plugin-javadoc
BuildRequires: maven2-plugin-plugin
BuildRequires: maven2-plugin-project-info-reports
BuildRequires: maven-release
BuildRequires: maven2-plugin-resources
BuildRequires: maven2-plugin-site
BuildRequires: maven-surefire-plugin
BuildRequires: maven-surefire-junit
BuildRequires: maven2-default-skin
%endif
BuildRequires: apache-jdo-2.0-api
BuildRequires: bcel
BuildRequires: derby
BuildRequires: dtdparser
BuildRequires: excalibur-avalon-framework
BuildRequires: geronimo-jta-1.0.1B-api
BuildRequires: jakarta-slide-webdavclient
BuildRequires: jaxen
BuildRequires: jetty5
BuildRequires: jpox-core >= 0:1.1.1
BuildRequires: jpox-enhancer >= 0:1.1.1
BuildRequires: log4j
BuildRequires: plexus-classworlds
BuildRequires: plexus-containers-component-api
BuildRequires: plexus-containers-container-default
BuildRequires: plexus-container-default
BuildRequires: plexus-registry
BuildRequires: plexus-utils
BuildRequires: plexus-velocity
BuildRequires: servletapi5
BuildRequires: stax_1_0_api
BuildRequires: stax-utils
BuildRequires: velocity
BuildRequires: wstx

Requires: dtdparser
Requires: jaxen
Requires: jpox-core >= 0:1.1.1-2jpp
Requires: jpox-enhancer >= 0:1.1.1-2jpp
Requires: log4j
Requires: plexus-classworlds
Requires: plexus-containers-component-api
Requires: plexus-containers-container-default
Requires: plexus-container-default
Requires: plexus-registry
Requires: plexus-utils
Requires: plexus-velocity
Requires: stax_1_0_api
Requires: stax-utils
Requires: velocity
Requires: wstx

Requires(post): jpackage-utils >= 0:1.7.3
Requires(postun): jpackage-utils >= 0:1.7.3

%description
Modello is a Data Model toolkit in use by the Maven 2 Project.
What it does.
It all starts with the DataModel.
Once a DataModel is defined, the toolkit can be used to
generate any of the following at compile time.
* Java Pojos of the DataModel.
* Java Pojos to XML Writer. (provided via xpp3, stax, jdom
 or dom4j)
* XML to Java Pojos Reader. (provided via xpp3, stax or
 dom4j)
* XDOC documentation of the DataModel.
* XML Schema to validate the DataModel.
* Java Model to Prevayler Store (actually this plugin is in
 the sandbox).
* Java Model to JPOX Store.
* Java Model to JPOX Mapping.

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

%description javadoc
%{summary}.

%if %{with_maven}
%package maven-plugin
Summary:        Maven2 plugin for %{name}
Group:          Development/Java

%description maven-plugin
%{summary}.

%package manual
Summary:        Documents for %{name}
Group:          Development/Documentation

%description manual
%{summary}.

%endif

%prep
%setup -q -n %{name}-%{namedversion}
#%patch0 -b .sav0
%patch1 -b .sav1
%patch2 -b .sav2
%patch3 -b .sav3
#%patch4 -b .sav4
#%patch5 -b .sav5
#%patch6 -b .sav6
%patch7 -b .sav7
#%patch8 -b .sav8
#%patch9 -b .sav9
%patch10 -b .sav10
#%patch11 -b .sav11
#%patch12 -b .sav12
%patch13 -b .sav13
#%patch14 -b .sav14
%patch15 -b .sav15
%patch16 -b .sav16
%patch17 -b .sav17
%patch18 -b .sav18
#%patch19 -b .sav19
#%patch20 -b .sav20
%patch21 -b .sav21
%patch22 -b .sav22

%patch99 -b .sav99

gzip -dc %{SOURCE3} | tar xf -

find . -name release-pom.xml -exec rm -f '{}' \;

for i in modello-plugins-sandbox/modello-plugin-ldap/src/test/java/org/codehaus/modello/plugin/ldap/ObjStateFactoryModelloGeneratorTest.java \
   modello-plugins-sandbox/modello-plugin-ldap/src/test/java/org/codehaus/modello/plugin/ldap/LdapSchemaGeneratorTest.java \
   modello-plugins-sandbox/modello-plugin-ojb/src/test/java/org/codehaus/modello/plugin/ojb/OjbModelloGeneratorTest.java \
   modello-plugins-sandbox/modello-plugin-stash/src/test/java/org/codehaus/modello/plugin/stash/StashModelloGeneratorTest.java \
   modello-plugins-sandbox/modello-plugin-hibernate-store/src/test/java/org/codehaus/modello/plugin/hibernate/HibernateModelloGeneratorTest.java; do
       sed -i -e s:org.codehaus.modello.ModelloGeneratorTest:org.codehaus.modello.AbstractModelloGeneratorTest:g $i
       sed -i -e s:"extends ModelloGeneratorTest":"extends AbstractModelloGeneratorTest":g $i
done


%build
export JAVA_HOME=%{_jvmdir}/java-1.5.0
%if %{with_maven}
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL
mkdir -p modello-site/target/site
mvn-jpp \
       -e \
       -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
       -Dmaven2.jpp.depmap.file=%{SOURCE2} \
       -Dmaven.test.failure.ignore=true \
       ant:ant install javadoc:javadoc

#pushd modello-site

#mvn-jpp \
#        -e \
#        -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
#        -Dmaven2.jpp.depmap.file=%{SOURCE2} \
#        site
#popd

%else
pushd modello-core
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-container-default \
plexus/container-default \
plexus/utils \
)
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins/modello-plugin-xml
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/classworlds \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/utils \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins/modello-plugin-jdom
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
CLASSPATH=$CLASSPATH:../modello-plugin-xml/target/modello-plugin-xml-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins/modello-plugin-xdoc
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/utils \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
CLASSPATH=$CLASSPATH:../modello-plugin-xml/target/modello-plugin-xml-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins/modello-plugin-store
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/utils \
plexus/velocity \
velocity \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins/modello-plugin-stax
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/utils \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
CLASSPATH=$CLASSPATH:../modello-plugin-xml/target/modello-plugin-xml-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins/modello-plugin-xsd
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/utils \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins/modello-plugin-converters
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/utils \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-db-keywords
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/classworlds \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/utils \
)
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins/modello-plugin-jpox
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/utils \
velocity \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
CLASSPATH=$CLASSPATH:../../modello-db-keywords/target/modello-db-keywords-%{namedversion}.jar
CLASSPATH=$CLASSPATH:../modello-plugin-store/target/modello-plugin-store-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins/modello-plugin-xpp3
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
CLASSPATH=$CLASSPATH:../modello-plugin-xml/target/modello-plugin-xml-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins/modello-plugin-dom4j
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
CLASSPATH=$CLASSPATH:../modello-plugin-xml/target/modello-plugin-xml-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins-sandbox/modello-plugin-ojb
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/velocity \
velocity \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
CLASSPATH=$CLASSPATH:../../modello-plugins/modello-plugin-store/target/modello-plugin-store-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins-sandbox/modello-plugin-jdbc
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
velocity \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
CLASSPATH=$CLASSPATH:../../modello-plugins/modello-plugin-store/target/modello-plugin-store-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins-sandbox/modello-plugin-velocity
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/velocity \
velocity \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins-sandbox/modello-plugin-hibernate-store
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/velocity \
velocity \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
CLASSPATH=$CLASSPATH:../../modello-plugins/modello-plugin-store/target/modello-plugin-store-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

pushd modello-plugins-sandbox/modello-plugin-stash
rm -rf src/test/java/*
export CLASSPATH=$(build-classpath \
plexus/containers-component-api \
plexus/containers-container-default \
plexus/velocity \
velocity \
)
CLASSPATH=$CLASSPATH:../../modello-core/target/modello-core-%{namedversion}.jar
ant -Dbuild.sysclasspath=only jar javadoc
popd

%endif

%install

# poms

install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
for i in `find . -name pom.xml | grep -v \\\./pom.xml`; do
   cp $i $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.`basename \`dirname $i\``.pom
done

# Depmap fragments

for i in `find . -name pom.xml | grep -v \\\./pom.xml | grep -v modello-plugins-sandbox`; do
   # i is in format ..../artifactid/pom.xml
   artifactname=`basename \`dirname $i\` | sed -e s:^modello-::g`

   %add_to_maven_depmap org.codehaus.modello modello-$artifactname %{namedversion} JPP/%{name} $artifactname
done

# sandbox plugins are a different version

for i in `find . -name pom.xml | grep modello-plugins-sandbox`; do
   # i is in format ..../artifactid/pom.xml
   artifactname=`basename \`dirname $i\` | sed -e s:^modello-::g`

   %add_to_maven_depmap org.codehaus.modello modello-$artifactname %{namedversion} JPP/%{name} $artifactname
done

cp pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.modello-modello.pom
%add_to_maven_depmap org.codehaus.modello modello %{namedversion} JPP/%{name} modello

# script

install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}

# jars

install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
for jar in $(find -type f -name "*.jar" | grep -E target/.*.jar); do
   install -m 644 $jar $RPM_BUILD_ROOT%{_javadir}/%{name}/`basename $jar | sed -e s:modello-::g`
done

(cd $RPM_BUILD_ROOT%{_javadir}/%{name} && for jar in *-%{namedversion}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{namedversion}||g"`; done)

# Do it again for sandbox plugins, which have a different version

(cd $RPM_BUILD_ROOT%{_javadir}/%{name} && for jar in *-1.0-alpha-4-SNAPSHOT*; do ln -sf ${jar} `echo $jar| sed  "s|-1.0-alpha-4-SNAPSHOT||g"`; done)

# Do it once more for the prevayler plugin, which has a different version

(cd $RPM_BUILD_ROOT%{_javadir}/%{name} && for jar in *-1.0-alpha-12-SNAPSHOT*; do ln -sf ${jar} `echo $jar| sed  "s|-1.0-alpha-12-SNAPSHOT||g"`; done)

# javadoc

install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
for target in $(find . -type d -name target); do
 if [ -d $target/site/apidocs ]; then
   install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/`basename \`dirname $target\` | sed -e s:modello-::g`
   cp -pr $target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/`basename \`dirname $target\` | sed -e s:modello-::g`
 fi
done
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink

%if %{with_maven}
install -d -m 755 $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
cp -pr %{name}-site/target/site $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
%endif

%if %{gcj_support}
%{_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

%files
%dir %{_javadir}/%{name}
%{_javadir}/%{name}/core*
%{_javadir}/%{name}/db-keywords*
%{_javadir}/%{name}/plugin*
%if %{with_maven}
%{_javadir}/%{name}/test*
%endif
%attr(755,root,root) %{_bindir}/*
%{_mavendepmapfragdir}
%{_datadir}/maven2
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/core-*.jar.*
%{_libdir}/gcj/%{name}/maven-plugin-*.jar.*
%{_libdir}/gcj/%{name}/plugin-*.jar.*
%if %{with_maven}
%{_libdir}/gcj/%{name}/test-*.jar.*
%endif
%endif


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

%if %{with_maven}
%files maven-plugin
%{_javadir}/%{name}/maven-plugin*
%if %{gcj_support}
%{_libdir}/gcj/%{name}/maven-plugin-*.jar.*
%endif

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

%changelog

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

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