I wrote a few Perl libraries(.pm) and Perlscripts(.pl) on Ubuntu and I need to distribute them to my colleagues in my office. Those scripts and libraries require third party libraries. I want to make it very simple.
Infomation about me.
- I know how to create a Perl script.
- I know how to create bash file.
- I have no experience in creating MAKE file, rpm, Deb etc.
I’d recommend using
Module::Starterto set up a template for each module. Once it’s installed, you can callmodule-starterfrom the command line, eg:or, if you want a distribution with multiple modules:
Then, just overwrite the
.pmfiles with your modules, include any unit tests that you want to run (the default tests basically check the syntax of the module along with the pod syntax). A basic installation of the modules is then done via(technically,
make testis optional, but it’s highly recommended).Now, if these modules rely on other CPAN modules, then you can use the module
CPANto install them, eg:So, you can distribute a zip/tarball/etc with the folders and files that
module-starterstarted (and that you modified) along with the above script to install any CPAN dependencies, and call it, say,cpan_install.pl. If you want, you can then wrap everything up in a final script called, say,install.plthat does all of these things.