title: How can I create an RPM from a module and recursively create separate independent RPMs for the dependencies?
body: <p>Given a module how can I create an rpm of not just the module, but all the module's dependencies?</p>
  
  <p>Start by creating a test module</p>
  
  <pre><code>$ module-starter --author "Evan Carroll" --email "me@evancarroll.com" --module Foo::Bar
  Added to MANIFEST: Changes
  Added to MANIFEST: ignore.txt
  Added to MANIFEST: lib/Foo/Bar.pm
  Added to MANIFEST: Makefile.PL
  Added to MANIFEST: MANIFEST
  Added to MANIFEST: README
  Added to MANIFEST: t/00-load.t
  Added to MANIFEST: t/manifest.t
  Added to MANIFEST: t/pod-coverage.t
  Added to MANIFEST: t/pod.t
  Added to MANIFEST: xt/boilerplate.t
  Created starter directories and files
  </code></pre>
  
  <p>Now I edit the <code>Makefile.pl</code>, and add <a href="https://metacpan.org/release/Mojolicious" rel="noreferrer"><code>Mojolicious</code></a> as a prereq.</p>
  
  <pre><code>...
  PREREQ_PM =&gt; {                                                         
        'Mojolicious' =&gt; '0'
  ....
  </code></pre>
  
  <p>Now I can run</p>
  
  <pre><code>perl Makefile.PL
  make dist
  </code></pre>
  
  <p>But running,</p>
  
  <pre><code>$ sudo cpantorpm -y /tmp/yum /tmp/Foo-Bar/Foo-Bar-0.01.tar.gz 
  </code></pre>
  
  <p>I get this,</p>
  
  <pre><code>error: Failed build dependencies:
          perl &gt;= 5.006 is needed by perl-Foo-Bar-0.01-1.noarch
          perl(ExtUtils::MakeMaker) is needed by perl-Foo-Bar-0.01-1.noarch
          perl(Mojolicious) is needed by perl-Foo-Bar-0.01-1.noarch
  </code></pre>
  
  <p>That makes sense, but I want it to create RPMs for these requirements. I would like <code>Foo::Bar</code> to require an rpm that is also generated from cpan that represents Mojolicious, and for a build system to output two RPMs (one rpm for <code>Foo::Bar</code> which requires the also-provided <code>Mojolicious</code> RPM).</p>