tycho/tycho.spec

255 lines
9.0 KiB
RPMSpec
Raw Normal View History

2011-10-14 21:07:43 +00:00
%global bootstrap 1
2011-05-06 10:38:49 +00:00
2012-02-09 19:25:34 +00:00
%global sha1 6391f1dafb35cbef48753e89c743ee9664a1c79d
2011-05-06 10:38:49 +00:00
%global e_osgi org.eclipse.osgi
2011-10-14 21:07:43 +00:00
%global e_osgi_v 3.6.2.R36x_v20110210
%global e_osgi_v2 3.8.0.v20110726-1606
2011-05-06 10:38:49 +00:00
%global e_core org.eclipse.jdt.core
2011-10-14 21:07:43 +00:00
%global e_core_v 3.6.2.v_A76_R36x
%global e_core_v2 3.8.0.v_C03
%global eclipsedir %{_libdir}/eclipse
2012-02-09 19:25:34 +00:00
%if %{bootstrap}
%global snap %{nil}
%else
%global snap -SNAPSHOT
%endif
2011-05-06 10:38:49 +00:00
Name: tycho
2012-02-09 19:25:34 +00:00
Version: 0.14.0
Release: 1%{?dist}
2011-05-06 10:38:49 +00:00
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
Group: Development/Libraries
# license file is missing but all files having some licensing information are ASL 2.0
License: ASL 2.0
URL: http://tycho.sonatype.org/
2012-02-09 19:25:34 +00:00
# git clone git://git.eclipse.org/gitroot/tycho/org.eclipse.tycho.git
# git archive --prefix="tycho-0.14.0-6391f1dafb35cbef48753e89c743ee9664a1c79d/" --format=tar 6391f1 | xz > tycho-0.14.0-6391f1dafb35cbef48753e89c743ee9664a1c79d.tar.xz
Source0: %{name}-%{version}-%{sha1}.tar.xz
2011-05-06 10:38:49 +00:00
# this is a workaround for maven-plugin-plugin changes that happened after
# version 2.4.3 (impossible to have empty mojo created as aggregate). This
# should be fixed upstream properly
Source1: EmptyMojo.java
# we need to make sure we are using maven 3 deps
Source2: depmap.xml
%if %{bootstrap}
2011-10-14 21:07:43 +00:00
Source3: maven-repo.tar.xz
2011-05-06 10:38:49 +00:00
%endif
2012-02-09 19:25:34 +00:00
Patch0: %{name}-0001-Remove-tycho-testing-harness.patch
Patch1: %{name}-0002-Fix-Build-Issues.patch
Patch2: %{name}-0003-Jetty8-Update.patch
%if %{bootstrap}
Patch3: %{name}-version.patch
%endif
2011-05-06 10:38:49 +00:00
BuildArch: noarch
BuildRequires: jpackage-utils
BuildRequires: java-devel
BuildRequires: maven
BuildRequires: maven-compiler-plugin
2012-02-09 19:25:34 +00:00
BuildRequires: maven-dependency-plugin
2011-05-06 10:38:49 +00:00
BuildRequires: maven-install-plugin
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-release-plugin
BuildRequires: maven-resources-plugin
BuildRequires: maven-shared-verifier
BuildRequires: maven-shared-osgi
BuildRequires: maven-surefire-plugin
2012-02-09 19:25:34 +00:00
BuildRequires: maven-surefire-provider-junit
BuildRequires: maven-surefire-provider-junit4
2011-05-06 10:38:49 +00:00
BuildRequires: plexus-containers-component-metadata
BuildRequires: eclipse-jdt
BuildRequires: decentxml
%if ! %{bootstrap}
BuildRequires: tycho
%endif
Requires: jpackage-utils
Requires: decentxml
Requires: maven
Requires: eclipse-jdt
Requires(post): jpackage-utils
Requires(postun): jpackage-utils
%description
Tycho is a set of Maven plugins and extensions for building Eclipse
plugins and OSGI bundles with Maven. Eclipse plugins and OSGI bundles
have their own metadata for expressing dependencies, source folder
locations, etc. that are normally found in a Maven POM. Tycho uses
native metadata for Eclipse plugins and OSGi bundles and uses the POM
to configure and drive the build. Tycho supports bundles, fragments,
features, update site projects and RCP applications. Tycho also knows
how to run JUnit test plugins using OSGi runtime and there is also
support for sharing build results using Maven artifact repositories.
Tycho plugins introduce new packaging types and the corresponding
lifecycle bindings that allow Maven to use OSGi and Eclipse metadata
during a Maven build. OSGi rules are used to resolve project
dependencies and package visibility restrictions are honored by the
OSGi-aware JDT-based compiler plugin. Tycho will use OSGi metadata and
OSGi rules to calculate project dependencies dynamically and injects
them into the Maven project model at build time. Tycho supports all
attributes supported by the Eclipse OSGi resolver (Require-Bundle,
Import-Package, Eclipse-GenericRequire, etc). Tycho will use proper
classpath access rules during compilation. Tycho supports all project
types supported by PDE and will use PDE/JDT project metadata where
possible. One important design goal in Tycho is to make sure there is
no duplication of metadata between POM and OSGi metadata.
%package javadoc
Summary: Javadocs for %{name}
Group: Documentation
Requires: jpackage-utils
%description javadoc
This package contains the API documentation for %{name}.
%prep
2012-02-09 19:25:34 +00:00
%setup -q -n %{name}-%{version}-%{sha1}
2011-10-14 21:07:43 +00:00
2012-02-09 19:25:34 +00:00
%patch0 -p1
%patch1 -p1
%patch2 -p1
%if %{bootstrap}
%patch3 -p1
%endif
2011-05-06 10:38:49 +00:00
2012-02-09 19:25:34 +00:00
find tycho-core -iname '*html' -delete
2011-05-06 10:38:49 +00:00
# place empty mojo in place
mkdir -p tycho-maven-plugin/src/main/java/org/fedoraproject
pushd tycho-maven-plugin/src/main/java/org/fedoraproject
cp %{SOURCE1} .
popd
2012-02-09 19:25:34 +00:00
2011-05-06 10:38:49 +00:00
%if %{bootstrap}
tar xf %{SOURCE3}
2012-02-09 19:25:34 +00:00
%else
mkdir -p .m2/org/eclipse/%{name}/%{name}-p2-runtime/%{version}
unzip -d .m2/org/eclipse/%{name}/%{name}-p2-runtime/%{version} %{_javadir}/%{name}/%{name}-p2-runtime.zip
2011-05-06 10:38:49 +00:00
%endif
# prepare directories for eclipse symlinks
mkdir -p .m2/org/sonatype/tycho
mkdir -p .m2/org/sonatype/tycho/%{e_osgi}/%{e_osgi_v}/
mkdir -p .m2/org/sonatype/tycho/%{e_core}/%{e_core_v}/
2011-10-14 21:07:43 +00:00
mkdir -p .m2/org/eclipse/tycho
mkdir -p .m2/org/eclipse/tycho/%{e_osgi}/%{e_osgi_v2}/
mkdir -p .m2/org/eclipse/tycho/%{e_core}/%{e_core_v2}/
2011-05-06 10:38:49 +00:00
# maven resolver doesn't know how to resolve from directories other than _javadir
pushd .m2/org/sonatype/tycho
2011-10-14 21:07:43 +00:00
ln -sf %{eclipsedir}/plugins/org.eclipse.osgi_*.jar \
2011-05-06 10:38:49 +00:00
%{e_osgi}/%{e_osgi_v}/%{e_osgi}-%{e_osgi_v}.jar
2012-02-09 19:25:34 +00:00
ln -sf %{eclipsedir}/plugins/org.eclipse.jdt.core_*.jar \
%{e_core}/%{e_core_v}/%{e_core}-%{e_core_v}.jar || \
2011-10-14 21:07:43 +00:00
ln -sf %{eclipsedir}/dropins/jdt/plugins/org.eclipse.jdt.core_*.jar \
2011-05-06 10:38:49 +00:00
%{e_core}/%{e_core_v}/%{e_core}-%{e_core_v}.jar
popd
2011-10-14 21:07:43 +00:00
pushd .m2/org/eclipse/tycho
ln -sf %{eclipsedir}/plugins/org.eclipse.osgi_*.jar \
%{e_osgi}/%{e_osgi_v2}/%{e_osgi}-%{e_osgi_v2}.jar
2012-02-09 19:25:34 +00:00
ln -sf %{eclipsedir}/plugins/org.eclipse.jdt.core_*.jar \
%{e_core}/%{e_core_v2}/%{e_core}-%{e_core_v2}.jar || \
2011-10-14 21:07:43 +00:00
ln -sf %{eclipsedir}/dropins/jdt/plugins/org.eclipse.jdt.core_*.jar \
%{e_core}/%{e_core_v2}/%{e_core}-%{e_core_v2}.jar
popd
2011-05-06 10:38:49 +00:00
2011-10-14 21:07:43 +00:00
%build
export TYCHO_TARGET_PLATFORM=%{eclipsedir}
mvn-rpmbuild -Dmaven.local.debug=true -X -Dmaven.test.skip=true \
2011-05-06 10:38:49 +00:00
-Dmaven.local.depmap.file=%{SOURCE2} \
-Dtycho.targetPlatform=$TYCHO_TARGET_PLATFORM install javadoc:aggregate
%install
mkdir -p $RPM_BUILD_ROOT%{_javadir}/%{name}
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
2011-10-14 21:07:43 +00:00
for mod in target-platform-configuration tycho-compiler-{jdt,plugin} \
tycho-{core,embedder-api,equinox{,-api,-launching}} \
tycho-{metadata-model,p2/tycho-p2-{director-plugin,facade,plugin,{publisher,repository}-plugin}} \
tycho-{maven,packaging,pomgenerator,source}-plugin tycho-release/tycho-versions-plugin \
2012-02-09 19:25:34 +00:00
tycho-bundles/org* \
2011-10-14 21:07:43 +00:00
tycho-surefire/{tycho-surefire-plugin,org.eclipse.tycho.surefire.{osgibooter,junit,junit4}}; do
2011-05-06 10:38:49 +00:00
echo $mod
aid=`basename $mod`
install -pm 644 $mod/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-$aid.pom
2012-02-09 19:25:34 +00:00
install -m 644 $mod/target/$aid-%{version}%{snap}.jar %{buildroot}%{_javadir}/%{name}/$aid.jar
2011-10-14 21:07:43 +00:00
%add_to_maven_depmap org.eclipse.tycho $aid %{version} JPP/%{name} $aid
2011-05-06 10:38:49 +00:00
%add_to_maven_depmap org.sonatype.tycho $aid %{version} JPP/%{name} $aid
done
2012-02-09 19:25:34 +00:00
for pommod in tycho-p2 tycho-bundles{,/org.eclipse.tycho.p2.resolver.impl} \
2011-10-14 21:07:43 +00:00
tycho-surefire tycho-release \
;do
aid=`basename $pommod`
install -pm 644 $pommod/pom.xml \
$RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-$aid.pom
%add_to_maven_depmap org.eclipse.tycho $aid %{version} JPP/%{name} $aid
%add_to_maven_depmap org.sonatype.tycho $aid %{version} JPP/%{name} $aid
2011-05-06 10:38:49 +00:00
done
2011-10-14 21:07:43 +00:00
# runtime
2012-02-09 19:25:34 +00:00
pushd tycho-bundles/tycho-p2-runtime
2011-10-14 21:07:43 +00:00
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-tycho-p2-runtime.pom
install -m 644 target/tycho-p2-runtime-%{version}*.zip %{buildroot}%{_javadir}/%{name}/tycho-p2-runtime.zip
%add_to_maven_depmap org.eclipse.tycho tycho-p2-runtime %{version} JPP/%{name} tycho-p2-runtime
%add_to_maven_depmap org.sonatype.tycho tycho-p2-runtime %{version} JPP/%{name} tycho-p2-runtime
popd
2011-05-06 10:38:49 +00:00
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-main.pom
2011-10-14 21:07:43 +00:00
%add_to_maven_depmap org.eclipse.tycho %{name} %{version} JPP/%{name} main
2011-05-06 10:38:49 +00:00
%add_to_maven_depmap org.sonatype.tycho %{name} %{version} JPP/%{name} main
# javadoc
install -dm 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}
%post
%update_maven_depmap
%postun
%update_maven_depmap
%files
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/%{name}
%{_javadir}/%{name}/
%doc README.md
%files javadoc
%{_javadocdir}/%{name}
%changelog
2012-02-09 19:25:34 +00:00
* Wed Feb 01 2012 Roland Grunberg <rgrunber@redhat.com> - 0.14.0-1
- Update to 0.14.0.
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
2011-10-14 21:07:43 +00:00
* Fri May 27 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.12.0-0.1.a74b1717
- Update to new version do bootstrap from scratch
2011-05-06 14:48:32 +00:00
* Fri May 6 2011 Alexander Kurtakov <akurtako@redhat.com> 0.10.0-3
- Non-bootstrap build.
2011-05-06 10:38:49 +00:00
* Tue May 3 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.0-2
- Add README and make build more silent
* Tue Mar 29 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.10.0-1
- First bootstrapped version