diff --git a/eclipse-emf.spec b/eclipse-emf.spec index 13ffadf..63f7b90 100644 --- a/eclipse-emf.spec +++ b/eclipse-emf.spec @@ -2,9 +2,16 @@ %global git_tag 39e89bbc44bb3c2535b713848961e07e0087d754 +# Set this flag to avoid building the tests +# Allows avoiding the emf->xsd->emf dep cycle for bootstrapping +%bcond_without tests +# Set this flag to avoid building everything except for the core bundles +# Allows building into a brand new buildroot before Eclipse is even built +%bcond_with bootstrap + Name: eclipse-emf Version: 2.13.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Eclipse Modeling Framework (EMF) Eclipse plug-in License: EPL @@ -25,8 +32,12 @@ Patch3: remove-unnecessary-imports.patch BuildRequires: tycho BuildRequires: tycho-extras BuildRequires: eclipse-filesystem +%if %{without bootstrap} BuildRequires: eclipse-pde +%if %{with tests} BuildRequires: eclipse-xsd +%endif +%endif BuildArch: noarch @@ -46,6 +57,7 @@ Requires: eclipse-filesystem %description core EMF bundles required by eclipse-platform. +%if %{without bootstrap} %package runtime Summary: Eclipse Modeling Framework (EMF) Eclipse plug-in @@ -57,11 +69,13 @@ produce a set of Java classes for the model, along with a set of adapter classes that enable viewing and command-based editing of the model, and a basic editor. +%if %{with tests} %package tests Summary: Eclipse EMF Tests %description tests Tests for the Eclipse Modeling Framework (EMF) plug-in. +%endif %package sdk Summary: Eclipse EMF SDK @@ -77,6 +91,7 @@ Requires: %{name}-sdk = %{version}-%{release} %description examples Install-able versions of the example projects from the SDKs that demonstrate how to use the Eclipse Modeling Framework (EMF) plug-ins. +%endif %prep %setup -q -n org.eclipse.emf-%{git_tag} @@ -99,6 +114,10 @@ find -maxdepth 2 -type d -name "*.oda*" -exec rm -r {} \; find -maxdepth 2 -type d -name "*.rap*" -exec rm -r {} \; find -maxdepth 2 -type d -name "*.gwt*" -exec rm -r {} \; +%if %{without tests} +rm -rf tests/* +%endif + # Insert pom templates mkdir pom-templates cp -p %{SOURCE1} pom-templates/. @@ -123,6 +142,22 @@ find doc -name pom.xml -exec sed -i -e 's/^ \(.*\)\1.doc< %pom_disable_module 'releng/org.eclipse.emf.build-feature' %pom_disable_module 'releng/org.eclipse.emf.base.build-feature' +%if %{with bootstrap} +# Only build core modules when bootstrapping +%pom_xpath_replace "pom:modules" " +features/org.eclipse.emf.base-feature +features/org.eclipse.emf.common-feature +features/org.eclipse.emf.ecore-feature +features/org.eclipse.emf.license-feature +plugins/org.eclipse.emf.common +plugins/org.eclipse.emf.ecore.change +plugins/org.eclipse.emf.ecore.xmi +plugins/org.eclipse.emf.ecore +" +%mvn_package "::jar:{sources,sources-feature}:" __noinstall +%mvn_package ":org.eclipse.emf.license" __noinstall +%endif + %mvn_package "::pom::" __noinstall %mvn_package "org.eclipse.emf.tests:" tests %mvn_package "::jar:{sources,sources-feature}:" sdk @@ -154,15 +189,23 @@ sed -i -e '/droplets/d' .mfiles %files core -f .mfiles +%if %{without bootstrap} %files runtime -f .mfiles-runtime +%if %{with tests} %files tests -f .mfiles-tests +%endif %files sdk -f .mfiles-sdk %files examples -f .mfiles-examples +%endif %changelog +* Thu Jun 15 2017 Mat Booth - 2.13.0-2 +- Allow conditionally building tests +- Add a bootstrap mode for building in new buildroots + * Thu Jun 15 2017 Mat Booth - 2.13.0-1 - Update to Oxygen release