Is it good practice to just copy Perl modules via RPM?

A few applications on our RHEL6 servers depend on a few Perl modules being present. I would like to add these Perl modules as part of the Kickstart process when turning up new hosts. As opposed to kicking off CPAN, which is slow, I decided to just package these Perl modules in an RPM that simply dumps them to the appropriate location and creates any necessary directories in Perl's lib directory.

Is this bad practice since I'm not truly "installing" them but rather just copying them?


Solution 1:

Installing from RPM on an RPM based distribution will be the best way to manage packages and configuration. It has a relatively steep learning curve so consider yourself ahead of the game if you are already producing RPMs for these modules.

You may want to have a look in EPEL, and make sure you are not duplicating effort. There are already a number of Perl modules in there. It might save you from reinventing the wheel...

Solution 2:

If I fully understand what you're doing, then no, this isn't bad practice. When CPAN "installs" a module, it is actually just copying them, so there's no real difference between the two. If the RPM carries the files to be installed as payload, then this is the same thing the Red Hat provided perl modules do, so it's perfectly acceptable. If the RPM issues a 'cp' or 'wget' type command to drop files into place in the %post section, I would seriously suggest not doing that. The only thing I would caution against in the first case is making one RPM per module, not one RPM with multiple modules.

Solution 3:

If you didn't miss any dependencies of Perl Modules, it is not bad. But I think in your context, you should creat a rpm package for Perl modules, push it to your local repo and make your servers use this repo to install Perl Modules.

Here is an instruction to creat rpm package for Perl Modules.