diamantis has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks, After the hard work of creating a GUI with perl/Tk I have to create an installation script for it. I thought that a good way would be to write an sh script checking the existence of perl, tk (and their versions) as well as some other programs. The script could also copy the .pl file to /usr/local/bin, and its .pm and help files at a different directory.The problem is that I do not know how to do these steps and whether they are the appropriate. One further problem is that I have a very limited amount of time for completing this task :(. Any suggestions??? Thank you very much!

update: Forgot to mention some information:

1) script working on Linux

2) I do not necessary need a binary version, just a way to check if some libraries and programs exist in the users system.

Replies are listed 'Best First'.
Re: creating an installation script
by GrandFather (Saint) on Jun 10, 2007 at 21:14 UTC

    What OS?

    Have you looked at PAR?


    DWIM is Perl's answer to Gödel
Re: creating an installation script
by naikonta (Curate) on Jun 11, 2007 at 08:52 UTC
    just a way to check if some libraries and programs exist in the users system
    You may want to check sdist. It's like h2xs for generating module skeleton but it's designed for generating skeleton for a standalone program. From there, you can modify the generated Makefile.PL to include module requirements.

    If you never use h2xs or don't know how to modify a Makefile.PL, read the ExtUtils::MakeMaker and look for PREREQ_PM. I don't know, however, whether sdist also provides a way to check if programs exist. I never use it for a long long time. When trying sdist then, I didn't have this requirement.

    But, I believe that sdist is not the only way. PAR, as suggested by GrandFather, allows you to include prerequisite modules in your program distribution. Check it to see how far it suits your needs.


    Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Re: creating an installation script
by nferraz (Monk) on Jun 11, 2007 at 17:45 UTC

    What you want to achieve is something like this:

    perl Makefile.PL make make test make install

    The good news is that you probably have everything you may need. Just read ExtUtils::MakeMaker::Tutorial

    I also suggest that you install Module::Starter and use it to start a sample project; take a look on the generated code and see how easy it is to write a Makefile.PL and basic tests.

      Is ExtUtils::MakeMaker appropriate for packaging a complete application or only for modules?

      I wish to make an easy to use installation script for a perl/tk GUI frontend that is comprised of a .pl file, a .pm, some data files and it needs some external programs.

      I currently have some problems installing sdist, par and pp (some error while making), so I was not able to try them yet.