title: How to create RPM spec for a metapackage which depends on all the subpackages in the same spec file
body: <p>I find my question is a bit complicated to ask in one phrase in the title, so I'll explain the problem in more detail below:</p>
  
  <p>I have an application which has always operated on one server. It is running a web server, the DB and another service all in the one server. This application is installed and upgraded with an RPM, which so far has worked well.</p>
  
  <p>The application now requires to be separated so the 3 services can run in separate servers. But it is still necessary to keep the option of all services in one server.</p>
  
  <p>In order to do that I started modifying the RPM spec file by separating each service into a subpackage. My tests so far show that installing each subpackage separately works fine.</p>
  
  <p>However, when I try to upgrade existing versions of the original application using the new meta-package (which depends on the subpackages) I find that yum will still install all the subpackages even if one of them fails. </p>
  
  <p>I think this is because yum checks the dependencies before the packages are actually installed, so it says "Dependencies Resolved" and then if one of the subpackages fails to be installed, it still installs the others. This is not very good because I don't want to have the meta-package partially installed/upgraded. </p>
  
  <p>BTW, the spec file is basically making the metapackage dependent on all the subpackages and it's obsoleting the original package.</p>
  
  <p>Hope this is not too confusing. </p>
  
  <p>I would like some advice on whether there is anything that can be added to the spec file to make it not install, or even uninstall a subpackage when another one has failed to be installed (when the metapackage is installed/upgraded). Or, is it better to keep two separate spec files? Is there any other alternative?</p>
  
  <p>Thanks very much in advance.</p>