Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make an installable Perl program with makefile/autoconf?

I have software written in Perl, now I want to release it and I want it to be an installation package like the other GNU software, which can be installed by typing:

./configure; make; make install

I noticed that in autoconf's package, most of the code is written in Perl and the Perl scripts are generated by running "make". That's exactly what I want to do. How would I go about doing that?

=== Added

Thank you for your nice answer! But what I wrote is not a module, it's actually a set of scripts which will do something in a pipe, the only thing I need to setup is the locations of some program I used in the Perl scripts. Is there any suggestion on this?

like image 328
sohutu Avatar asked Mar 31 '11 23:03

sohutu


1 Answers

The process used by ExtUtils::MakeMaker and Module::Install is very similar.

perl Makefile.PL
make
make test
make install

If you're set on using the specific command chain you posted, you can place the following in file configure:

#!/bin/sh
perl Makefile.PL

If you're not set on using the specific command chain you posted, there's also Module::Build.

perl Build.PL
./Build
./Build test
./Build install

I use Module::Build personally.

like image 111
ikegami Avatar answered Oct 03 '22 18:10

ikegami