iovation / rpmcpan

Create Modern Perl and CPAN RPMs
10 stars 3 forks source link

Documentation for bootstrapping? #3

Open hartzell opened 9 years ago

hartzell commented 9 years ago

Getting rpmcpan up into the air has been a bit of an awkward dance. I wonder if there's a better way, or if not then if a bit of docs would help.

I started with a simple virtualbox VM based on NREL's Centos 6.6 box.

After a bit of trial and error, I've learned to install these (some are things I need for my trimmed etc/dists.json):

sudo yum install perl-devel libxml2-devel expat-devel git rpm-build gcc=c++

Then I cloned my fork of the iovation rpmcpan repository.

When I tried to run bin/rpmcpan I was missing a double handful of prerequisites.

So I built a copy of cpanm for the system perl and used that to install the prereqs.

That let things run up until the point that rpmcpan relaunches itself using the perl that it built. That perl trips over the prereqs I built for the system perl and seems to need its own copy of them.

So I ended up building a cpanm and a set of prereqs for the new perl and that has let me proceed to assembling a set of rpms for the various distros I need.

In short, it looks like this:

sudo yum -y install perl-devel libxml2-devel expat-devel git rpm-build gcc-c++
git clone ...
curl https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm | perl - -l local.system App::cpanminus
env PERL5LIB=`pwd`/local.system/lib/perl5 PATH=`pwd`/local.system/bin:$PATH cpanm -l local.system < rpmcpan-prereqs
sudo env PERL5LIB=`pwd`/local.system/lib/perl5 PATH=`pwd`/local.system/bin:$PATH ./bin/rpmcpan --version 5.18.4 --prefix=/opt/perl518 -v
#dies here
curl https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm | /opt/perl518/bin/perl - -l local.opt App::cpanminus
env PERL5LIB=`pwd`/local.opt/lib/perl5 PATH=`pwd`/local.opt/bin:/opt/perl518/bin:$PATH cpanm -l local.opt < rpmcpan-prereqs
sudo env PERL5LIB=`pwd`/local.opt/lib/perl5 PATH=`pwd`/local.opt/bin:/opt/perl518/bin:$PATH ./bin/rpmcpan --version 5.18.4 --prefix=/opt/perl518 -v
  1. How did you get the initial build (using the system perl to run rpmcpan) to work? Did you load a bunch of system perl module rpms?
  2. How did it happen that the system was able to restart with the freshly built perl w/out freaking out?

Thanks!

theory commented 9 years ago
  1. Yes.
  2. I thought I was relying only on core modules, though HTTP::Tiny, in particular, was a fairly recent addition. If there are CPAN-only dependencies, we should find another way to deal with them, or to install them before anything else.
theory commented 9 years ago

So, do you need libxml2-devel and expat-devel because you're building XML distributions? If so, you can include them in requiresor build_requires, as appropriate, like I do for DBD::ODBC here.

hartzell commented 9 years ago

Yes, I need them for the packages I'm building (my end result is a set of freshly minted postgresql rpms that depend on a set of freshly minted perl-5.18.4 rpms with a set of freshly minted CPAN distro rpms to support a plperl/plperlu-using application).

The handful of stuff that I use yum to install was from my early smack-it-with-a-big hammer phase, I could probably fine tune it.

I'll check the list of prereqs I was using cpanm to install and see how I can trim that (it's on a machine that I don't have access to at the moment).

The dist file for my fork of rpmcpan is here.

I think that the only tricky thing that I didn't steal from you was the B-C patch.

g.

theory commented 9 years ago

You can put those into the requires and prereqs keys for the distributions that need them, like I've done for DBD::ODBC here. You'd do something like:

"XML-Parser": { "build_requires": ["expat-devel"] },
"XML-LibXML": { "build_requires": ["libxml2-devel"] },
theory commented 9 years ago

Oh, I see you already have those. So for basics, I think we need to document that these are required:

rpm-build gcc=c++

I don't think git is required, though, except to clone this repo, of course. :-)