Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Distributing non-Perl script in a Perl distribution?

by sundialsvc4 (Abbot)
on Aug 06, 2015 at 01:35 UTC ( #1137603=note: print w/replies, xml ) Need Help??

in reply to Distributing non-Perl script in a Perl distribution?

It would be helpful if you could explicitly state what you mean by “a Perl distribution.”   To whom are you “distributing” ... exactly what ... exactly how?   Are you speaking of “building a new CPAN contribution?”   Do you need to consider the possibility of this “distribution” being installed on a Windows system?   A mainframe?

  • Comment on Re: Distributing non-Perl script in a Perl distribution?

Replies are listed 'Best First'.
Re^2: Distributing non-Perl script in a Perl distribution?
by perlancar (Pilgrim) on Aug 07, 2015 at 22:52 UTC

    Yup, I was talking about a CPAN distribution, and installing a shell script (or Python script, or some other non-Perl script) via MakeMaker. I'm wondering a quick-hack solution of adding Makefile parameters/targets like this:

    SHELL_EXE_FILES = bin-sh/somescript
    PYTHON_EXE_FILES = bin-py/somescript2
    $(INST_SCRIPT)/somescript :: bin-sh/somescript ...
        $(NOECHO) $(RM_F) $(INST_SCRIPT)/somescript
        $(CP) bin-sh/somescript $(INST_SCRIPT)/somescript
        $(FIXIN) bin-sh/somescript $(INST_SCRIPT)/somescript
        -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/somescript
    $(INST_SCRIPT)/somescript2 :: bin-py/somescript2 ...
        $(NOECHO) $(RM_F) $(INST_SCRIPT)/somescript2
        $(CP) bin-py/somescript2 $(INST_SCRIPT)/somescript2
        $(FIXIN) bin-py/somescript2 $(INST_SCRIPT)/somescript2
        -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/somescript2

    The non-Perl scripts will be installed like Perl scripts, except they won't get a manpage (or they could, if we put a POD either inside the script or somewhere else, inside the script if the language supports something equivalent to Perl's __END__), and in the fixin step the appropriate shebang will be chosen.

      See and PL_FILES

      $ module-starter --module Goner --email email --author author --verbos +e --eumm Created Goner Created Goner\lib Created Goner\lib\ Created Goner\t Created Goner\t\pod-coverage.t Created Goner\t\pod.t Created Goner\t\manifest.t Created Goner\t\boilerplate.t Created Goner\t\00-load.t Created Goner\ignore.txt Created Goner\Makefile.PL Created Goner\Changes Created Goner\README Added to MANIFEST: Changes Added to MANIFEST: ignore.txt Added to MANIFEST: lib/ Added to MANIFEST: Makefile.PL Added to MANIFEST: MANIFEST Added to MANIFEST: README Added to MANIFEST: t/00-load.t Added to MANIFEST: t/boilerplate.t Added to MANIFEST: t/manifest.t Added to MANIFEST: t/pod-coverage.t Added to MANIFEST: t/pod.t Created Goner\MANIFEST Created starter directories and files $ cd Goner $ md bin $ echo #!/usr/bin/python -- > bin\ $ echo #!/usr/bin/bash -- > bin\ $ echo @echo off -- > bin\ba.bat $ perl -i.bak -pe " s{^(.*?NAME.*)}{$1 EXE_FILES => [glob q{bin/*}], } +;" Makefile.PL $ perl Makefile.PL INSTALL_BASE=thebase Checking if your kit is complete... Looks good Generating a dmake-style Makefile Writing Makefile for Goner Writing MYMETA.yml and MYMETA.json $ dmake install cp lib/ blib\lib\ "C:\citrusperl\bin\perl.exe" -MExtUtils::Command -e cp -- bin/ bl +ib\script\ pl2bat.bat blib\script\ "C:\citrusperl\bin\perl.exe" -MExtUtils::Command -e cp -- bin/ba.bat b +lib\script\ba.bat pl2bat.bat blib\script\ba.bat "C:\citrusperl\bin\perl.exe" -MExtUtils::Command -e cp -- bin/ bl +ib\script\ pl2bat.bat blib\script\ Installing thebase\lib\perl5\ Installing thebase\bin\ba.bat Installing thebase\bin\ Installing thebase\bin\ Installing thebase\bin\ Installing thebase\bin\ Appending installation info to thebase\lib\perl5\MSWin32-x86-multi-thr +ead/perllocal.pod

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1137603]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2019-04-23 13:55 GMT
Find Nodes?
    Voting Booth?
    I am most likely to install a new module from CPAN if:

    Results (118 votes). Check out past polls.