Blob Blame History Raw
# Copyright (c) 2000-2005, 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.
#

%global maven_settings_file %{_builddir}/%{name}/settings.xml
%global namedversion 1.4

Name:           maven-scm
Version:        1.4
Release:        4%{?dist}
Epoch:          0
Summary:        Common API for doing SCM operations
License:        ASL 2.0
Group:          Development/Libraries
URL:            http://maven.apache.org/scm

# svn export 
#   http://svn.apache.org/repos/asf//maven/scm/tags/maven-scm-1.4/ maven-scm-1.4/
# tar cJf maven-scm-1.4.tar.xz maven-scm-1.4/
Source0:        %{name}-%{namedversion}.tar.xz
Source1:        %{name}-jpp-depmap.xml

# remove dependency on mockito per accurev provider tests
Patch0:         001_maven-scm_remove-mockito-test-dep.patch
# fix package name in svn provider
Patch1:         002_maven-scm_fix-svn-provider-build.patch
# fix a missing cast (plexus-container-default version mismatch?)
Patch3:         004_maven-scm_fix-svn-provider-java.patch
# fix modello configuration in vss provider pom and the cast as above
Patch4:         005_maven-scm_fix-vss-provider-pom.patch
Patch5:         006_maven-scm_fix-vss-provider-java.patch


BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch

BuildRequires:  jpackage-utils >= 0:1.6
BuildRequires:  maven2 >= 2.0.6
BuildRequires:  maven-compiler-plugin
BuildRequires:  maven-install-plugin
BuildRequires:  maven-jar-plugin
BuildRequires:  maven-javadoc-plugin
BuildRequires:  maven-plugin-plugin
BuildRequires:  maven-resources-plugin
BuildRequires:  maven-assembly-plugin
BuildRequires:  maven-site-plugin
BuildRequires:  maven-invoker-plugin
BuildRequires:  maven-shared-invoker
BuildRequires:  maven-surefire-maven-plugin
BuildRequires:  maven-surefire-provider-junit
BuildRequires:  maven-surefire-provider-junit4
BuildRequires:  maven2-common-poms >= 0:1.0-21
BuildRequires:  modello >= 1.1
BuildRequires:  netbeans-cvsclient
BuildRequires:  plexus-utils >= 1.5.6
BuildRequires:  saxon-scripts
BuildRequires:  maven-plugin-testing-harness
BuildRequires:  maven-doxia-sitetools
BuildRequires:  plexus-interpolation
BuildRequires:  bzr
BuildRequires:  plexus-maven-plugin
BuildRequires:  plexus-classworlds

Requires:       junit >= 3.8.2
Requires:       jakarta-commons-collections >= 3.1
Requires:       modello >= 1.0-0.a8
Requires:       netbeans-cvsclient >= 6.9
Requires:       jakarta-oro >= 2.0.8
Requires:       plexus-utils >= 1.2
Requires:       velocity >= 1.4

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

%description
Maven SCM supports Maven 2.x plugins (e.g. maven-release-plugin) and other
tools (e.g. Continum) in providing them a common API for doing SCM operations.

%package test
Summary:        Tests for %{name}
Group:          Development/Tools
Requires:       maven-scm = %{epoch}:%{version}-%{release}

%description test
Tests for %{name}.

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

%description javadoc
Javadoc for %{name}.

%prep
%setup -q 
%patch0 -p1
%patch1 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1

# We dont have mockito, needed for accurev tests, disable for now
find maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev -type f -name "*Test*" -exec rm -f '{}' \;

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

%build
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mvn-jpp \
        -e  \
        -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
        -Dmaven.test.failure.ignore=true \
        -Dmaven2.jpp.depmap.file=%{SOURCE1} \
        install javadoc:aggregate

%install
rm -rf $RPM_BUILD_ROOT
# jars/poms
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/maven2/poms

# remove test files, they are used for build time testing
#find  -type f -name "*cvstest*" -exec rm -f '{}' \; \
#-o -type f -name "*svntest*" -exec rm -f '{}' \;

for jar in `find . -type f -name "*.jar" | grep -E "target/.*.jar$"`; do
        newname=`basename $jar | sed -e s:^maven-scm-::g`
        install -pm 644 $jar \
          $RPM_BUILD_ROOT%{_javadir}/%{name}/$newname
done

#poms (exclude the svn/cvstest poms. They are unnecessary)
# ignore 
#  1) poms in target/ (they are either copies, or temps)
#  2) poms in src/test/ (they are poms needed for tests only)
for i in `find . -name pom.xml | grep -v \\\./pom.xml | \
   grep -v target | grep -v src/test`; do
        artifactname=`basename \`dirname $i\``
        jarname=`echo $artifactname | sed -e s:^maven-scm-::g`
        cp -p $i $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.$artifactname.pom
        %add_to_maven_depmap org.apache.maven.scm $artifactname %{namedversion} JPP/%{name} $jarname
done
cp -p pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.maven-scm-scm.pom
%add_to_maven_depmap org.apache.maven.scm maven-scm %{namedversion} JPP/maven-scm scm

%add_to_maven_depmap org.apache.maven.plugins maven-scm-plugin %{namedversion} JPP/maven-scm plugin

# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}

%post
%update_maven_depmap

%postun
%update_maven_depmap

%files
%defattr(-,root,root,-)
%dir %{_javadir}/%{name}
%{_javadir}/%{name}/api*
%{_javadir}/%{name}/client*
%{_javadir}/%{name}/manager-plexus*
%{_javadir}/%{name}/plugin*
%{_javadir}/%{name}/provider-*
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*

%files test
%defattr(-,root,root,-)
%{_javadir}/%{name}/provider-cvstest*
%{_javadir}/%{name}/provider-svntest*
%{_javadir}/%{name}/test*

%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/*

%changelog
* Mon Jan 3 2011 Alexander Kurtakov <akurtako@redhat.com> 0:1.4-4
- Drop tomcat BRs.
- No more versioned jar and javadoc.

* Wed Sep 08 2010 Guido Grazioli <guido.grazioli@gmail.com> 0:1.4-2
- Fix BR
- Remove unused patch

* Tue Sep 07 2010 Guido Grazioli <guido.grazioli@gmail.com> 0:1.4-1
- Update to upstream 1.4 (#626455)
- Require netbeans-cvsclient instead of netbeans-ide (#572165)

* Mon May 10 2010 Guido Grazioli <guido.grazioli@gmail.com> 0:1.2-6
- Link netbeans-lib-cvsclient jar in the right place.
- Switch to xz compression.
- Sanitize files owned.
- Use %%global.

* Mon Feb 8 2010 Alexander Kurtakov <akurtako@redhat.com> 0:1.2-5
- Fix BR/Rs for netbeans-ide[version] to netbeans-ide rename.

* Thu Sep 17 2009 Alexander Kurtakov <akurtako@redhat.com> 0:1.2-4
- Fix maven-scm-plugin depmap.

* Sat Sep 12 2009 Alexander Kurtakov <akurtako@redhat.com> 0:1.2-3
- BR maven-surefire-provider-junit.
- BR plexus-maven-plugin.
- BR maven2-plugin-assembly.

* Sat Sep 12 2009 Alexander Kurtakov <akurtako@redhat.com> 0:1.2-2
- Add doxia-sitetools BR.

* Sat Sep 12 2009 Alexander Kurtakov <akurtako@redhat.com> 0:1.2-1
- Update to upstream 1.2.

* Tue Sep 01 2009 Andrew Overholt <overholt@redhat.com> 1.0-0.5.rc1.2
- Bump release

* Tue Sep 01 2009 Andrew Overholt <overholt@redhat.com> 1.0-0.5.rc1.1
- Add tomcat5, tomcat5-servlet-2.4-api,
  maven-shared-plugin-testing-harness, and tomcat5-jsp-2.0-api BRs

* Mon Aug 31 2009 Andrew Overholt <overholt@redhat.com> 1.0-0.5.rc1
- 1.0 RC1 (courtesy Deepak Bhole)
- Remove gcj support
- Add netbeans-ide11 requirement
- Change name on surefire plugin BR

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.0-0.4.b3.1.7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Mar 23 2009 Deepak Bhole <dbhole@redhat.com> - 0:1.0-0.3.b3.1.7
- Remove ppc64 arch exclusion

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.0-0.3.b3.1.6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Wed Jul  9 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 1.0-0.2.b3.1.6
- drop repotag

* Thu Jun 26 2008 Deepak Bhole <dbhole@redhat.com> 1.0-0.2.b3.1jpp.5
- Fix mapping for the scm plugin

* Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> 1.0-0.2.b3.1jpp.4
- fix license tag

* Thu Feb 28 2008 Deepak Bhole <dbhole@redhat.com> 1.0-0.2.b3.1jpp.3
- Rebuild

* Fri Sep 21 2007 Deepak Bhole <dbhole@redhat.com> 0:1.0-0.1.b3.2jpp.2
- Rebuild with excludearch for ppc64

* Tue Feb 27 2007 Tania Bento <tbento@redhat.com> 0:1.0-0.1.b3.2jpp.1
- Fixed %%Release.
- Fixed %%BuildRoot.
- Removed %%Vendor.
- Removed %%Distribution.
- Removed %%post and %%postun sections for javadoc.
- Fixed instructions on how to generate source drop.
- Marked documentation files as %%doc in %%files section.
- Fixed %%Summary.
- Fixed %%description.

* Tue Oct 17 2006 Deepak Bhole <dbhole@redhat.com> - 0:1.0-0.b3.2jpp
- Update for maven 9jpp.

* Tue Sep 18 2006 Deepak Bhole <dbhole@redhat.com> - 0:1.0-0.b3.1jpp
- Initial build