I have simple perl script and I want to make install script which install dependencies (perl modules) and copy my file.perl to /usr/share/path asking about password if necessary. I found that there are some solutions for installing perl modules (Makefile.PL, Build.PL etc.). But my script isn't module. How should I attempt it?
Makefile.PL/ExtUtils::MakeMaker support a EXE_FILES parm for perl script, you can see how App::Ack do this or check this tutorial. Just set the prefix to your directory and it should do the work for you.
Related
Installing with the cpan cli tool modules - they are not found at script execution time basically as part of the #INC directories. I am using cygwin.
/home/myuser/.local/share/.cpan/build/Email-Sender-1.300031-0/lib/Email/Sender/Simple.pm
/home/myuser/.local/share/.cpan/build/Email-Simple-2.216-0/lib/Email/Simple.pm
I could now reference each single lib directory (they differ with each module installation) using the PERL5LIB Variable which is dull and boring. Am I doing something wrong? I want to install Perl Modules with cpan and use them afterwards without care where they are located...
All the module installation failed because the 'make' utility was not installed.
Now the cpan modules get installed and can be used within my scripts.
I have two Perl versions installations on my PC, 5.12.3 and 5.16.3. To install the P4Perl API, I needed to set in Path the location of Perl 5.16.3(otherwise I was getting a P4Perl API installer error) and after succesfully running the installation, I searched for the P4.pm module and noticed that the installation of the P4.pm module was done in the folder of the 5.12.3 installation.
As you can see in the title, the installation was done for Perl 5.16
But if I search for the P4.pm, it is located in the 5123 folder ( which is coresponding to Perl 5.12.3
Even more, when I try to run a simple script which only imports the P4.pm module:
-with Perl 5.16.3 it complains about the missing P4.pm module
-with Perl 5.12.3 it complains about the missing perl516.dll which I can find with Everything in the installation of Perl 5.16.3.
After this, I thought to move the content which was installed in 5.12.3 installation to the 5.16.3 installation, just as #Gerhard suggested. And now it works. Does anyone knows why it messes up at installation?
Even though, the files exist physically.
Copy the Directories of the module files to the <PATH_TO_PERL>/lib and <PATH_TO_PERL>/site/lib to solve the issue.
Perl modules almost always exists as /lib/DIR/DIR/Module.pm
for instance C:\perl64\lib\Date\Simple\date.pm
If the files exists on their own, the there is a problem with the module installation itself. Or, Somewhere there is a path reference to your old perl version directory.
To see which perl path is used by default, do:
perl -e "print $^X"
Hope that helps a bit.
I am looking for a way to auto install a missing perl module when my script runs. I would like to use cpan plus since it "seems" to available on both Windows and Linux but maybe I could have a way to drop down to standard cpan if cpan plus is not installed.
So how could one go about this? There is of course the cpan plus / cpan modules but are those able to integrated into a script?
Check this module: Carton Carton in CPAN, so first you installed all modules for your script, then you will make special dependency file under Carton and as result using this special file in other PC to install all dependency for you script. Please read description of this module in CPAN.
I hope it will help you.
I have been using telnet to issue test commands to my Jabberd2 server. It is a clunky method, so I downloaded the sendxmpp package included with my build of Cygwin. When I issue the command sendxmpp -h I get the following error(minus the #INC path dump): can't locate Authen/SASL.pm in #INC BEGIN failed--compilation aborted at /usr/bin/sendxmpp line 21.
I think the problem is ldap related, however I have installed all of the perl and ldap modules available.
Does anyone know how to fix this error?
Are there additional configuration steps needed to get ldap working
with perl in the Cygwin environment?
Is there a better way to issue xmpp commands to Jabberd from the
command line?
Looks like you're missing the Authen::SASL module. If it's not part of the sendxmpp package, try installing it with cpan -i Authen::SASL. If it IS available, make sure sendxmpp (which may very well be a perl script) finds it, by modifying the inc/lib directory. If Authen::SASL is supposed to be installed and available systemwide, try executing perl -MAuthen::SASL. If that triggers an error, perl can't find it. If it just "hangs" there (waiting for input), perl did find the module, and sendxmpp should work.
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?
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.
In the Makefile.am that's where your perl scripts reside, add the line
dist_bin_SCRIPTS = your_perl_program