%global bootstrap 1 %global e_osgi org.eclipse.osgi %global e_osgi_v 3.6.0.v20100517 %global e_core org.eclipse.jdt.core %global e_core_v 3.6.0.v_A58 Name: tycho Version: 0.10.0 Release: 2%{?dist} 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/ # git clone git://github.com/sonatype/sonatype-tycho # git archive --prefix="tycho-0.10.0/" --format=tar tycho-0.10.0 | xz > tycho-0.10.0.tar.xz Source0: %{name}-%{version}.tar.xz # 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} Source3: maven-repo.tar.bz2 %endif Patch0: 0001-Remove-tycho-testing-harness.patch BuildArch: noarch BuildRequires: jpackage-utils BuildRequires: java-devel BuildRequires: maven BuildRequires: maven-compiler-plugin 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 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 %setup -q %patch0 -p1 -b .harness # 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 mkdir -p tycho-bootstrap-maven-plugin/src/main/java/org/fedoraproject pushd tycho-bootstrap-maven-plugin/src/main/java/org/fedoraproject cp %{SOURCE1} . popd # remove dependency on non-existent jars from deltapack sed -i '/equinox.security.\(macosx\|win32\)/d' \ tycho-p2/tycho-p2-runtime/tycho-p2-runtime.product %if %{bootstrap} tar xf %{SOURCE3} %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}/ # maven resolver doesn't know how to resolve from directories other than _javadir pushd .m2/org/sonatype/tycho ln -sf %{_libdir}/eclipse/plugins/org.eclipse.osgi_*.jar \ %{e_osgi}/%{e_osgi_v}/%{e_osgi}-%{e_osgi_v}.jar ln -sf %{_libdir}/eclipse/dropins/jdt/plugins/org.eclipse.jdt.core_*.jar \ %{e_core}/%{e_core_v}/%{e_core}-%{e_core_v}.jar popd %build export TYCHO_TARGET_PLATFORM=%{_libdir}/eclipse # not needed when bootstrap is 0, but we build it anyway mvn-rpmbuild -Dmaven.test.skip=true \ -Dmaven.local.depmap.file=%{SOURCE2} \ -Pbootstrap-1 \ -Dtycho.targetPlatform=$TYCHO_TARGET_PLATFORM install mvn-rpmbuild -Dmaven.test.skip=true \ -Dmaven.local.depmap.file=%{SOURCE2} \ -Pbootstrap-2 \ -Dtycho.targetPlatform=$TYCHO_TARGET_PLATFORM install javadoc:aggregate %install mkdir -p $RPM_BUILD_ROOT%{_javadir}/%{name} install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir} for mod in maven-osgi-{compiler,packaging,source}-plugin maven-tycho-plugin \ target-platform-configuration tycho-bootstrap-maven-plugin \ tycho-compiler-jdt tycho-equinox tycho-maven-plugin \ tycho-osgi-components tycho-release/tycho-{enforcer-rules,versions-plugin} \ tycho-p2/org.sonatype.tycho.{noopsecurity,p2{,.impl,.maven.repository,.publisher}}\ tycho-p2/tycho-p2-{director-plugin,facade,plugin,publisher-plugin,runtime} \ tycho-surefire/{maven-osgi-test-plugin,org.sonatype.tycho.surefire.{junit,junit4,osgibooter}};do echo $mod aid=`basename $mod` suff=".jar" if [ "$aid" == "tycho-p2-runtime" ];then suff=".zip" fi install -pm 644 $mod/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-$aid.pom install -m 644 $mod/target/$aid-%{version}$suff %{buildroot}%{_javadir}/%{name}/$aid$suff %add_to_maven_depmap org.sonatype.tycho $aid %{version} JPP/%{name} $aid done for pommod in tycho-p2 tycho-surefire;do install -pm 644 $pommod/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-$pommod.pom %add_to_maven_depmap org.sonatype.tycho $pommod %{version} JPP/%{name} $pommod done install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-main.pom %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 %defattr(-,root,root,-) %{_mavenpomdir}/* %{_mavendepmapfragdir}/%{name} %{_javadir}/%{name}/ %doc README.md %files javadoc %defattr(-,root,root,-) %{_javadocdir}/%{name} %changelog * Tue May 3 2011 Stanislav Ochotnicky - 0.10.0-2 - Add README and make build more silent * Tue Mar 29 2011 Stanislav Ochotnicky - 0.10.0-1 - First bootstrapped version