churchyard / rpms / maven

Forked from rpms/maven 5 years ago
Clone
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Name:           maven
Stanislav Ochotnicky 91ffb10
Version:        3.0
Stanislav Ochotnicky 91ffb10
Release:        3%{?dist}
Stanislav Ochotnicky 91ffb10
Summary:        Java project management and project comprehension tool
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Group:          Development/Tools
Stanislav Ochotnicky 91ffb10
License:        ASL 2.0 and MIT and BSD
Stanislav Ochotnicky 91ffb10
URL:            http://maven.apache.org/
Stanislav Ochotnicky 91ffb10
Source0:        http://www.apache.org/dyn/closer.cgi/maven/source/apache-%{name}-%{version}-src.tar.gz
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# 2xx for created non-buildable sources
Stanislav Ochotnicky 91ffb10
Source200:    %{name}-script
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# Patch1XX could be upstreamed probably
Stanislav Ochotnicky 91ffb10
# Patch15X are already upstream
Stanislav Ochotnicky 91ffb10
Patch150:         0001-Add-plexus-default-container-dep.patch
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Stanislav Ochotnicky 91ffb10
BuildArch:      noarch
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
BuildRequires:  maven2
Stanislav Ochotnicky 91ffb10
BuildRequires:  maven-assembly-plugin
Stanislav Ochotnicky 91ffb10
BuildRequires:  maven-compiler-plugin
Stanislav Ochotnicky 91ffb10
BuildRequires:  maven-install-plugin
Stanislav Ochotnicky 91ffb10
BuildRequires:  maven-jar-plugin
Stanislav Ochotnicky 91ffb10
BuildRequires:  maven-javadoc-plugin
Stanislav Ochotnicky 91ffb10
BuildRequires:  maven-resources-plugin
Stanislav Ochotnicky 91ffb10
BuildRequires:  maven-site-plugin
Stanislav Ochotnicky 91ffb10
BuildRequires:  maven-surefire-plugin
Stanislav Ochotnicky 91ffb10
BuildRequires:  maven-surefire-provider-junit4
Stanislav Ochotnicky 91ffb10
BuildRequires:  buildnumber-maven-plugin
Stanislav Ochotnicky 91ffb10
BuildRequires:  plexus-containers-component-metadata >= 1.5.4-4
Stanislav Ochotnicky 91ffb10
BuildRequires:  plexus-containers-container-default
Stanislav Ochotnicky 91ffb10
BuildRequires:  animal-sniffer >= 1.6-5
Stanislav Ochotnicky 91ffb10
BuildRequires:  mojo-parent
Stanislav Ochotnicky 91ffb10
BuildRequires:  atinject
Stanislav Ochotnicky 91ffb10
BuildRequires:  aether
Stanislav Ochotnicky 91ffb10
BuildRequires:  sisu
Stanislav Ochotnicky 91ffb10
BuildRequires:  google-guice
Stanislav Ochotnicky 91ffb10
BuildRequires:  hamcrest
Stanislav Ochotnicky 91ffb10
BuildRequires:  apache-commons-parent
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Requires:       java >= 1:1.6.0
Stanislav Ochotnicky 91ffb10
Requires:       plexus-classworlds
Stanislav Ochotnicky 91ffb10
Requires:       apache-commons-cli
Stanislav Ochotnicky 91ffb10
Requires:       guava
Stanislav Ochotnicky 91ffb10
Requires:       hamcrest
Stanislav Ochotnicky 91ffb10
Requires:       nekohtml
Stanislav Ochotnicky 91ffb10
Requires:       plexus-cipher
Stanislav Ochotnicky 91ffb10
Requires:       plexus-containers-component-annotations
Stanislav Ochotnicky 91ffb10
Requires:       plexus-containers-container-default
Stanislav Ochotnicky 91ffb10
Requires:       plexus-interpolation
Stanislav Ochotnicky 91ffb10
Requires:       plexus-sec-dispatcher
Stanislav Ochotnicky 91ffb10
Requires:       plexus-utils
Stanislav Ochotnicky 91ffb10
Requires:       xbean
Stanislav Ochotnicky 91ffb10
Requires:       xerces-j2
Stanislav Ochotnicky 91ffb10
Requires:       maven-wagon
Stanislav Ochotnicky 91ffb10
Requires:       aether
Stanislav Ochotnicky 91ffb10
Requires:       sisu
Stanislav Ochotnicky 91ffb10
Requires:       google-guice
Stanislav Ochotnicky 91ffb10
Requires:       atinject
Stanislav Ochotnicky 91ffb10
Requires:       animal-sniffer >= 1.6-5
Stanislav Ochotnicky 91ffb10
Requires:       mojo-parent
Stanislav Ochotnicky 91ffb10
Requires:       hamcrest
Stanislav Ochotnicky 91ffb10
Requires:       apache-commons-parent
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Requires(post): jpackage-utils
Stanislav Ochotnicky 91ffb10
Requires(postun): jpackage-utils
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
%description
Stanislav Ochotnicky 91ffb10
Maven is a software project management and comprehension tool. Based on the
Stanislav Ochotnicky 91ffb10
concept of a project object model (POM), Maven can manage a project's build,
Stanislav Ochotnicky 91ffb10
reporting and documentation from a central piece of information.
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
%package javadoc
Stanislav Ochotnicky 91ffb10
Summary:   API documentation for %{name}
Stanislav Ochotnicky 91ffb10
Group:     Documentation
Stanislav Ochotnicky 91ffb10
Requires:  jpackage-utils
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
%description javadoc
Stanislav Ochotnicky 91ffb10
%{summary}.
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
%prep
Stanislav Ochotnicky 91ffb10
%setup -q -n apache-%{name}-%{version}
Stanislav Ochotnicky 91ffb10
%patch150 -p1
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# not really used during build, but a precaution
Stanislav Ochotnicky 91ffb10
rm maven-ant-tasks-*.jar
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# these fail only with patch 201. No idea why (since that is activated
Stanislav Ochotnicky 91ffb10
# only with maven2.jpp.mode=true
Stanislav Ochotnicky 91ffb10
rm maven-core/src/test/java/org/apache/maven/MavenLifecycleParticipantTest.java
Stanislav Ochotnicky 91ffb10
rm maven-core/src/test/java/org/apache/maven/execution/ProjectSorterTest.java
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# fix line endings
Stanislav Ochotnicky 91ffb10
sed -i 's:\r::' *.txt
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# fix for animal-sniffer (we don't generate 1.5 signatures)
Stanislav Ochotnicky 91ffb10
sed -i 's:check-java-1.5-compat:check-java-1.6-compat:' pom.xml
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
pushd apache-maven
Stanislav Ochotnicky 91ffb10
rm src/bin/*bat
Stanislav Ochotnicky 91ffb10
sed -i 's:\r::' src/conf/settings.xml
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# Update shell scripts to use unversioned classworlds
Stanislav Ochotnicky 91ffb10
sed -i -e s:'-classpath "${M2_HOME}"/boot/plexus-classworlds-\*.jar':'-classpath "${M2_HOME}"/boot/plexus-classworlds.jar':g \
Stanislav Ochotnicky 91ffb10
        src/bin/mvn*
Stanislav Ochotnicky 91ffb10
popd
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
%build
Stanislav Ochotnicky 91ffb10
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
Stanislav Ochotnicky 91ffb10
mkdir -p $MAVEN_REPO_LOCAL
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
mvn-jpp -e \
Stanislav Ochotnicky 91ffb10
        -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
Stanislav Ochotnicky 91ffb10
        install javadoc:aggregate
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
mkdir m2home
Stanislav Ochotnicky 91ffb10
(cd m2home
Stanislav Ochotnicky 91ffb10
tar xvf ../apache-maven/target/*tar.gz
Stanislav Ochotnicky 91ffb10
chmod -x apache-%{name}-%{version}/conf/settings.xml
Stanislav Ochotnicky 91ffb10
)
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
%install
Stanislav Ochotnicky 91ffb10
rm -rf $RPM_BUILD_ROOT
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
export M2_HOME=$(pwd)/m2home/apache-maven-%{version}
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# maven2 directory in /usr/share/java
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# put global m2 config into /etc and symlink it later
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}
Stanislav Ochotnicky 91ffb10
mv $M2_HOME/bin/m2.conf $RPM_BUILD_ROOT%{_sysconfdir}/
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
###########
Stanislav Ochotnicky 91ffb10
# M2_HOME #
Stanislav Ochotnicky 91ffb10
###########
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
###############
Stanislav Ochotnicky 91ffb10
# M2_HOME/bin #
Stanislav Ochotnicky 91ffb10
###############
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/bin
Stanislav Ochotnicky 91ffb10
cp -a $M2_HOME/bin/* $RPM_BUILD_ROOT%{_datadir}/%{name}/bin
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
ln -sf %{_sysconfdir}/m2.conf $RPM_BUILD_ROOT%{_datadir}/%{name}/bin/m2.conf
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
################
Stanislav Ochotnicky 91ffb10
# M2_HOME/boot #
Stanislav Ochotnicky 91ffb10
################
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/boot
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# this dangling symlink will be filled in by Requires
Stanislav Ochotnicky 91ffb10
(cd $RPM_BUILD_ROOT%{_datadir}/%{name}/boot
Stanislav Ochotnicky 91ffb10
  ln -sf `build-classpath plexus/classworlds` plexus-classworlds.jar
Stanislav Ochotnicky 91ffb10
)
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
################
Stanislav Ochotnicky 91ffb10
# M2_HOME/conf #
Stanislav Ochotnicky 91ffb10
################
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/conf
Stanislav Ochotnicky 91ffb10
cp -a $M2_HOME/conf/* $RPM_BUILD_ROOT%{_datadir}/%{name}/conf/
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
###############
Stanislav Ochotnicky 91ffb10
# M2_HOME/lib #
Stanislav Ochotnicky 91ffb10
###############
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/lib
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# jdom is needed for our custom resolving code only
Stanislav Ochotnicky 91ffb10
(cd $RPM_BUILD_ROOT%{_datadir}/%{name}/lib
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
  build-jar-repository -s -p . aether/api aether/connector-wagon aether/impl aether/spi aether/util \
Stanislav Ochotnicky 91ffb10
                               commons-cli guava hamcrest/core nekohtml plexus/plexus-cipher \
Stanislav Ochotnicky 91ffb10
                               plexus/containers-component-annotations plexus/containers-container-default \
Stanislav Ochotnicky 91ffb10
                               plexus/interpolation plexus/plexus-sec-dispatcher plexus/utils \
Stanislav Ochotnicky 91ffb10
                               sisu/sisu-inject-bean sisu/sisu-inject-plexus maven-wagon/file \
Stanislav Ochotnicky 91ffb10
                               maven-wagon/http-lightweight maven-wagon/http-shared maven-wagon/provider-api \
Stanislav Ochotnicky 91ffb10
                               xbean/xbean-reflect xerces-j2 jdom
Stanislav Ochotnicky 91ffb10
)
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
################
Stanislav Ochotnicky 91ffb10
# M2_HOME/poms #
Stanislav Ochotnicky 91ffb10
#*##############
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/poms
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
########################
Stanislav Ochotnicky 91ffb10
# /etc/maven/fragments #
Stanislav Ochotnicky 91ffb10
########################
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT/%{_sysconfdir}/maven/fragments
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
##############################
Stanislav Ochotnicky 91ffb10
# /usr/share/java repository #
Stanislav Ochotnicky 91ffb10
##############################
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/repository
Stanislav Ochotnicky 91ffb10
ln -s %{_javadir} $RPM_BUILD_ROOT%{_datadir}/%{name}/repository/JPP
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
##################
Stanislav Ochotnicky 91ffb10
# javadir/maven #
Stanislav Ochotnicky 91ffb10
#*################
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
#######################
Stanislav Ochotnicky 91ffb10
# javadir/maven/poms #
Stanislav Ochotnicky 91ffb10
#*#####################
Stanislav Ochotnicky 91ffb10
ln -s %{_datadir}/%{name}/poms $RPM_BUILD_ROOT%{_javadir}/%{name}/poms
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
############
Stanislav Ochotnicky 91ffb10
# /usr/bin #
Stanislav Ochotnicky 91ffb10
############
Stanislav Ochotnicky 91ffb10
install -dm 755 $RPM_BUILD_ROOT%{_bindir}
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# Wrappers
Stanislav Ochotnicky 91ffb10
cp -af %{SOURCE200} $RPM_BUILD_ROOT%{_bindir}/mvn3
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
###################
Stanislav Ochotnicky 91ffb10
# Individual jars #
Stanislav Ochotnicky 91ffb10
###################
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
for module in maven-aether-provider maven-artifact maven-compat \
Stanislav Ochotnicky 91ffb10
              maven-core maven-embedder maven-model \
Stanislav Ochotnicky 91ffb10
              maven-model-builder maven-plugin-api \
Stanislav Ochotnicky 91ffb10
              maven-repository-metadata  maven-settings \
Stanislav Ochotnicky 91ffb10
              maven-settings-builder;do
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
    pushd $module
Stanislav Ochotnicky 91ffb10
    install -m 644 target/$module-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/
Stanislav Ochotnicky 91ffb10
    ln -s $module-%version.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/$module.jar
Stanislav Ochotnicky 91ffb10
    ln -s %{_javadir}/%{name}/$module-%{version}.jar \
Stanislav Ochotnicky 91ffb10
          $RPM_BUILD_ROOT%{_datadir}/%{name}/lib/$module-%{version}.jar
Stanislav Ochotnicky 91ffb10
    install -m 644 pom.xml $RPM_BUILD_ROOT%{_datadir}/%{name}/poms/JPP.%{name}-$module.pom
Stanislav Ochotnicky 91ffb10
    %add_to_maven_depmap org.apache.maven $module %{version} JPP/%{name} $module
Stanislav Ochotnicky 91ffb10
    popd
Stanislav Ochotnicky 91ffb10
done
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
# maven pom
Stanislav Ochotnicky 91ffb10
install -m 644 pom.xml $RPM_BUILD_ROOT%{_datadir}/%{name}/poms/JPP.%{name}-maven.pom
Stanislav Ochotnicky 91ffb10
%add_to_maven_depmap org.apache.maven maven %{version} JPP/%{name} maven
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
%clean
Stanislav Ochotnicky 91ffb10
rm -rf $RPM_BUILD_ROOT
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
%post
Stanislav Ochotnicky 91ffb10
%update_maven_depmap
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
%postun
Stanislav Ochotnicky 91ffb10
%update_maven_depmap
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
%files
Stanislav Ochotnicky 91ffb10
%defattr(-,root,root,-)
Stanislav Ochotnicky 91ffb10
%doc LICENSE.txt NOTICE.txt README.txt
Stanislav Ochotnicky 91ffb10
%attr(0755,root,root) %{_bindir}/mvn3
Stanislav Ochotnicky 91ffb10
%dir %{_datadir}/%{name}
Stanislav Ochotnicky 91ffb10
%dir %{_datadir}/%{name}/bin
Stanislav Ochotnicky 91ffb10
%attr(0755,root,root) %{_datadir}/%{name}/bin/mvn
Stanislav Ochotnicky 91ffb10
%attr(0755,root,root) %{_datadir}/%{name}/bin/mvnyjp
Stanislav Ochotnicky 91ffb10
%attr(0755,root,root) %{_datadir}/%{name}/bin/mvnDebug
Stanislav Ochotnicky 91ffb10
%{_datadir}/%{name}/bin/*.conf
Stanislav Ochotnicky 91ffb10
%config(noreplace) %{_sysconfdir}/m2.conf
Stanislav Ochotnicky 91ffb10
%{_datadir}/%{name}/boot
Stanislav Ochotnicky 91ffb10
%{_datadir}/%{name}/conf
Stanislav Ochotnicky 91ffb10
%{_datadir}/%{name}/lib
Stanislav Ochotnicky 91ffb10
%{_datadir}/%{name}/poms
Stanislav Ochotnicky 91ffb10
%{_datadir}/%{name}/repository
Stanislav Ochotnicky 91ffb10
%config %{_mavendepmapfragdir}/%{name}
Stanislav Ochotnicky 91ffb10
%{_javadir}/%{name}
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
%changelog
Stanislav Ochotnicky 91ffb10
* Wed Dec  1 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-3
Stanislav Ochotnicky 91ffb10
- Remove maven-ant-tasks jar in prep
Stanislav Ochotnicky 91ffb10
- Make fragment file as %%config
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
* Tue Nov 16 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-2
Stanislav Ochotnicky 91ffb10
- Added apache-commons-parent to BR after commons changes
Stanislav Ochotnicky 91ffb10
Stanislav Ochotnicky 91ffb10
* Tue Oct 12 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-1
Stanislav Ochotnicky 91ffb10
- Initial package with vanilla maven (no jpp mode yet)