f837e3e
# Copyright (c) 2000-2005, JPackage Project
f837e3e
# All rights reserved.
f837e3e
#
f837e3e
# Redistribution and use in source and binary forms, with or without
f837e3e
# modification, are permitted provided that the following conditions
f837e3e
# are met:
f837e3e
#
f837e3e
# 1. Redistributions of source code must retain the above copyright
f837e3e
#    notice, this list of conditions and the following disclaimer.
f837e3e
# 2. Redistributions in binary form must reproduce the above copyright
f837e3e
#    notice, this list of conditions and the following disclaimer in the
f837e3e
#    documentation and/or other materials provided with the
f837e3e
#    distribution.
f837e3e
# 3. Neither the name of the JPackage Project nor the names of its
f837e3e
#    contributors may be used to endorse or promote products derived
f837e3e
#    from this software without specific prior written permission.
f837e3e
#
f837e3e
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
f837e3e
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
f837e3e
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
f837e3e
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
f837e3e
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
f837e3e
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
f837e3e
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
f837e3e
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
f837e3e
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
f837e3e
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
f837e3e
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
f837e3e
#
f837e3e
f837e3e
%define _with_gcj_support 1
f837e3e
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
f837e3e
f837e3e
%define maven_settings_file %{_builddir}/%{name}/settings.xml
f837e3e
%define namedversion 1.0-beta-3
f837e3e
f837e3e
Name:           maven-scm
f837e3e
Version:        1.0
4f23a82
Release:        0.2.b3.1jpp.3%{?dist}
f837e3e
Epoch:          0
f837e3e
Summary:        Common API for doing SCM operations
f837e3e
License:        Apache Software License
f837e3e
Group:          Development/Java
f837e3e
URL:            http://maven.apache.org/scm
f837e3e
f837e3e
Source0:        %{name}-%{version}-beta-3.tar.gz
f837e3e
# svn export 
f837e3e
#   http://svn.apache.org/repos/asf/maven/scm/tags/maven-scm-1.0-beta-3/
f837e3e
#   maven-scm/
f837e3e
# tar czf maven-scm-1.0-beta-3.tar.gz maven-scm/
f837e3e
Source1:        %{name}-jpp-depmap.xml
f837e3e
Source2:        %{name}-mapdeps.xsl
f837e3e
Source3:        %{name}-add-plexusutils-dep.xml
f837e3e
f837e3e
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
f837e3e
f837e3e
%if ! %{gcj_support}
f837e3e
BuildArch:      noarch
49354bd
%else
49354bd
ExcludeArch:    ppc64
f837e3e
%endif
49354bd
f837e3e
BuildRequires:  jpackage-utils >= 0:1.6
f837e3e
BuildRequires:  maven2 >= 2.0.4-6
f837e3e
BuildRequires:  maven2-plugin-compiler
f837e3e
BuildRequires:  maven2-plugin-install
f837e3e
BuildRequires:  maven2-plugin-jar
f837e3e
BuildRequires:  maven2-plugin-javadoc
f837e3e
BuildRequires:  maven2-plugin-plugin
f837e3e
BuildRequires:  maven2-plugin-release
f837e3e
BuildRequires:  maven2-plugin-resources
f837e3e
BuildRequires:  maven2-plugin-surefire
f837e3e
BuildRequires:  maven2-common-poms >= 1.0-3
f837e3e
BuildRequires:  modello >= 1.0-0.a8
f837e3e
BuildRequires:  modello-maven-plugin >= 1.0-0.a8
f837e3e
BuildRequires:  plexus-utils >= 1.2
f837e3e
BuildRequires:  saxon-scripts
f837e3e
f837e3e
Requires:       junit >= 3.8.2
f837e3e
Requires:       jakarta-commons-collections >= 3.1
f837e3e
Requires:       modello >= 1.0-0.a8
f837e3e
Requires:       modello-maven-plugin >= 1.0-0.a8
f837e3e
Requires:       oro >= 2.0.8
f837e3e
Requires:       plexus-utils >= 1.2
f837e3e
Requires:       velocity >= 1.4
f837e3e
f837e3e
%if %{gcj_support}
f837e3e
BuildRequires:          java-gcj-compat-devel
f837e3e
Requires(post):         java-gcj-compat
f837e3e
Requires(postun):       java-gcj-compat
f837e3e
%endif
f837e3e
f837e3e
Requires(post):    jpackage-utils >= 0:1.7.2
f837e3e
Requires(postun):  jpackage-utils >= 0:1.7.2
f837e3e
f837e3e
%description
f837e3e
Maven SCM supports Maven 2.x plugins (e.g. maven-release-plugin) and other
f837e3e
tools (e.g. Continum) in providing them a common API for doing SCM operations.
f837e3e
f837e3e
%package test
f837e3e
Summary:        Tests for %{name}
f837e3e
Group:          Development/Java
f837e3e
Requires:       maven-scm = %{epoch}:%{version}-%{release}
f837e3e
f837e3e
%if %{gcj_support}
f837e3e
BuildRequires:          java-gcj-compat-devel
f837e3e
Requires(post):         java-gcj-compat
f837e3e
Requires(postun):       java-gcj-compat
f837e3e
%endif
f837e3e
f837e3e
%description test
f837e3e
Tests for %{name}.
f837e3e
f837e3e
%package javadoc
f837e3e
Summary:        Javadoc for %{name}
f837e3e
Group:          Development/Documentation
f837e3e
Requires(pre):  /bin/rm,/bin/ls
f837e3e
Requires(post): /bin/rm
f837e3e
f837e3e
%description javadoc
f837e3e
Javadoc for %{name}.
f837e3e
f837e3e
%prep
f837e3e
%setup -q -n %{name}
f837e3e
f837e3e
#FIXME: Bazaar tests fail since the executable is no available. Disable 
f837e3e
#       the tests.
f837e3e
rm -rf maven-scm-providers/maven-scm-provider-bazaar/src/test
f837e3e
f837e3e
%build
f837e3e
f837e3e
(cd maven-scm-api
f837e3e
cp -p pom.xml pom.xml.noplexusutils.xml
f837e3e
saxon -o pom.xml pom.xml.noplexusutils.xml %{SOURCE2} map=%{SOURCE3}
f837e3e
)
f837e3e
f837e3e
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
f837e3e
mkdir -p $MAVEN_REPO_LOCAL
f837e3e
f837e3e
mvn-jpp \
f837e3e
        -e \
f837e3e
        -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
f837e3e
        -Dmaven.test.failure.ignore=true \
f837e3e
        install javadoc:javadoc
f837e3e
f837e3e
%install
f837e3e
rm -rf $RPM_BUILD_ROOT
f837e3e
# jars/poms
f837e3e
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
f837e3e
install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/maven2/poms
f837e3e
f837e3e
# remove test files, they are used for build time testing
f837e3e
#find  -type f -name "*cvstest*" -exec rm -f '{}' \; \
f837e3e
#-o -type f -name "*svntest*" -exec rm -f '{}' \;
f837e3e
f837e3e
for jar in `find . -type f -name "*.jar" | grep -E "target/.*.jar$"`; do
f837e3e
        newname=`basename $jar | sed -e s:^maven-scm-::g`
f837e3e
        install -pm 644 $jar \
f837e3e
          $RPM_BUILD_ROOT%{_javadir}/%{name}/$newname
f837e3e
done
f837e3e
f837e3e
(cd $RPM_BUILD_ROOT%{_javadir}/%{name} && for jar in *-%{namedversion}*; \
f837e3e
  do ln -sf ${jar} `echo $jar| sed  "s|-%{namedversion}||g"`; done)
f837e3e
f837e3e
#poms (exclude the svn/cvstest poms. They are unnecessary)
f837e3e
# ignore 
f837e3e
#  1) poms in target/ (they are either copies, or temps)
f837e3e
#  2) poms in src/test/ (they are poms needed for tests only)
f837e3e
for i in `find . -name pom.xml | grep -v \\\./pom.xml | \
f837e3e
   grep -v target | grep -v src/test`; do
f837e3e
        artifactname=`basename \`dirname $i\``
f837e3e
        jarname=`echo $artifactname | sed -e s:^maven-scm-::g`
f837e3e
        cp -p $i $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.$artifactname.pom
f837e3e
        %add_to_maven_depmap org.apache.maven.scm $artifactname %{namedversion} JPP/%{name} $jarname
f837e3e
done
f837e3e
cp -p pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.maven-scm-scm.pom
f837e3e
%add_to_maven_depmap org.apache.maven.scm maven-scm %{namedversion} JPP/maven-scm scm
f837e3e
f837e3e
# javadoc
f837e3e
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
f837e3e
f837e3e
for docsdir in `find -name apidocs`; do
f837e3e
        subdir=`echo $docsdir | \
f837e3e
          awk -F / '{print $(NF-3)}' | sed -e s:^maven-scm-::g`
f837e3e
        install -dm 755 \
f837e3e
          $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/$subdir
f837e3e
        cp -pr $docsdir/* \
f837e3e
          $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/$subdir
f837e3e
done
f837e3e
f837e3e
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
f837e3e
f837e3e
%if %{gcj_support}
f837e3e
%{_bindir}/aot-compile-rpm
f837e3e
%endif
f837e3e
f837e3e
%clean
f837e3e
rm -rf $RPM_BUILD_ROOT
f837e3e
f837e3e
%post
f837e3e
%if %{gcj_support}
f837e3e
if [ -x %{_bindir}/rebuild-gcj-db ]
f837e3e
then
f837e3e
  %{_bindir}/rebuild-gcj-db
f837e3e
fi
f837e3e
%endif
f837e3e
%update_maven_depmap
f837e3e
f837e3e
%postun
f837e3e
%if %{gcj_support}
f837e3e
if [ -x %{_bindir}/rebuild-gcj-db ]
f837e3e
then
f837e3e
  %{_bindir}/rebuild-gcj-db
f837e3e
fi
f837e3e
%endif
f837e3e
%update_maven_depmap
f837e3e
f837e3e
%if %{gcj_support}
f837e3e
%post test
f837e3e
if [ -x %{_bindir}/rebuild-gcj-db ]
f837e3e
then
f837e3e
  %{_bindir}/rebuild-gcj-db
f837e3e
fi
f837e3e
%endif
f837e3e
f837e3e
%if %{gcj_support}
f837e3e
%postun test
f837e3e
if [ -x %{_bindir}/rebuild-gcj-db ]
f837e3e
then
f837e3e
  %{_bindir}/rebuild-gcj-db
f837e3e
fi
f837e3e
%endif
f837e3e
f837e3e
%files
f837e3e
%defattr(-,root,root,-)
f837e3e
%dir %{_javadir}
f837e3e
%dir %{_javadir}/%{name}
f837e3e
%{_datadir}/maven2
f837e3e
%{_javadir}/%{name}/api*
f837e3e
%{_javadir}/%{name}/client*
f837e3e
%{_javadir}/%{name}/manager-plexus*
f837e3e
%{_javadir}/%{name}/plugin*
f837e3e
%{_javadir}/%{name}/provider-bazaar*
f837e3e
%{_javadir}/%{name}/provider-clearcase*
f837e3e
%{_javadir}/%{name}/provider-local*
f837e3e
%{_javadir}/%{name}/provider-perforce*
f837e3e
%{_javadir}/%{name}/provider-cvs-commons*
f837e3e
%{_javadir}/%{name}/provider-cvsexe*
f837e3e
%{_javadir}/%{name}/provider-svn-commons*
f837e3e
%{_javadir}/%{name}/provider-svnexe*
f837e3e
%{_javadir}/%{name}/provider-starteam*
f837e3e
%{_javadir}/%{name}/provider-vss*
f837e3e
%{_mavendepmapfragdir}
f837e3e
%doc LICENSE.txt NOTICE.txt
f837e3e
f837e3e
%if %{gcj_support}
f837e3e
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/api-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/client-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/manager-plexus-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/plugin-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-bazaar-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-clearcase-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-cvs-commons-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-cvsexe-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-local-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-perforce-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-starteam-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-svn-commons-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-svnexe-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-vss-1.0-beta-3.jar.*
f837e3e
%endif
f837e3e
f837e3e
%files test
f837e3e
%defattr(-,root,root,-)
f837e3e
%{_javadir}/%{name}/provider-cvstest*
f837e3e
%{_javadir}/%{name}/provider-svntest*
f837e3e
%{_javadir}/%{name}/test*
f837e3e
f837e3e
%if %{gcj_support}
f837e3e
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-cvstest-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/test-1.0-beta-3.jar.*
f837e3e
%attr(-,root,root) %{_libdir}/gcj/%{name}/provider-svntest-1.0-beta-3.jar.*
f837e3e
%endif
f837e3e
f837e3e
%files javadoc
f837e3e
%defattr(-,root,root,-)
f837e3e
%{_javadocdir}/*
f837e3e
f837e3e
%changelog
4f23a82
* Thu Feb 28 2008 Deepak Bhole <dbhole@redhat.com> 1.0-0.2.b3.1jpp.3
4f23a82
- Rebuild
7493525
49354bd
* Fri Sep 21 2007 Deepak Bhole <dbhole@redhat.com> 0:1.0-0.1.b3.2jpp.2
49354bd
- Rebuild with excludearch for ppc64
49354bd
f837e3e
* Tue Feb 27 2007 Tania Bento <tbento@redhat.com> 0:1.0-0.1.b3.2jpp.1
f837e3e
- Fixed %%Release.
f837e3e
- Fixed %%BuildRoot.
f837e3e
- Removed %%Vendor.
f837e3e
- Removed %%Distribution.
f837e3e
- Removed %%post and %%postun sections for javadoc.
f837e3e
- Fixed instructions on how to generate source drop.
f837e3e
- Marked documentation files as %%doc in %%files section.
f837e3e
- Fixed %%Summary.
f837e3e
- Fixed %%description.
f837e3e
f837e3e
* Tue Oct 17 2006 Deepak Bhole <dbhole@redhat.com> - 0:1.0-0.b3.2jpp
f837e3e
- Update for maven 9jpp.
f837e3e
f837e3e
* Tue Sep 18 2006 Deepak Bhole <dbhole@redhat.com> - 0:1.0-0.b3.1jpp
f837e3e
- Initial build