Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Installing Modules in Windows

by Gorby (Monk)
on Jul 20, 2004 at 04:26 UTC ( [id://375793]=perlquestion: print w/replies, xml ) Need Help??

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

Hello Wise Monks,

I'd like to install the following module on my Windows XP and Windows 2000 server computers:

Crypt::OpenPGP

The only way I know to install modules is using ppm under windows. My problem is that the above module does not appear as one of the choices after I do a search from within ppm. How then can I install this module? Is there another way to install modules under windows aside from ppm?

Thanks in advance.

Gorby

Replies are listed 'Best First'.
Re: Installing Modules in Windows
by DaveH (Monk) on Jul 20, 2004 at 06:52 UTC

    Hi.

    This is a fantastic module, and it is very useful once you manage to get it to work! The only drawback (if you can call it that -- code reuse being a "Good Thing" after all) is that it has about 15 dependant modules which you must install before you get the privilege of actually using it. You don't *need* all of them, but I didn't want to risk not having a feature I might need, and then having to go through the installation headache again. ;-)

    Currently, these module dependencies are:

    MIME::Base64
    Data::Buffer
    Math::Pari
    Compress::Zlib
    Crypt::DES_EDE3 (for 3DES)
    Crypt::IDEA (for IDEA)
    Crypt::Blowfish (for Blowfish)
    Crypt::Twofish (for Twofish)
    Crypt::Rijndael (for Rijndael)
    Crypt::CAST5_PP (for CAST5)
    Digest::MD5 (for MD5)
    Digest::SHA1 (for SHA-1)
    Crypt::RIPEMD160 (for RIPE-MD/160)
    Crypt::RSA (for RSA encryption/decryption and signatures)
    Crypt::DSA (for DSA signatures)
    

    Normally, this would not be an issue, however it does mostly rely on crypto modules which aren't in the ActiveState ppm3 repository due to Canadian export restrictions on crypto software.

    More info here: http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/Repository

    Many of the required modules can be found in Randy Kobes' PPM repository at http://theoryx5.uwinnipeg.ca/ppms.

    Unfortunately, to get FULL support for all the features of this module, there is currently no alternative but to "Build It Yourself". I already have built some of the modules myself, but I don't really want to make my versions available, since they work for me on a specific version of Perl, but wouldn't necessarily work for anyone else. They weren't built using VC6, so they are very likely to simply crash Perl or just fail to load. YMMV.

    To build them yourself, and if you don't have access to a Visual C compiler (which I'm assuming you don't, since why would you be looking for ppms otherwise), you need to do a few things. [Note: this approach worked for me to build the few missing modules I needed for Crypt::OpenPGP. I have found that this method works best when you are using pure XS (i.e. with all the C code distributed with the module), it is unlikely to work at all if the module relies on a shared or static library (.dll).]

    1. Download nmake. This is pretty much essential for building any CPAN modules on Windows with ActiveState Perl. I simply unpacked nmake to C:\Perl\bin. Get it here: ftp://ftp.microsoft.com/softlib/mslfiles/nmake15.exe
    2. Download MinGW GCC from here: http://www.mingw.org/download.shtml. This is the best chance you'll have at building XS modules without using VC6. Note: cygwin GCC won't work with ActiveState Perl. Ensure that gcc.exe and others are in your PATH environment varaible.
    3. Download ExtUtils::FakeConfig and install (with your new nmake) in the usual CPAN way:
      perl Makefile.PL
      nmake
      nmake test
      nmake install
      
      This module allows you to build ActiveState modules with MinGW more easily. Once this module is installed, open up C:\Perl\site\lib\Config_m.pm, and change the config line:
      make='dmake'
      
      into:
      make='nmake'
      
      ExtUtils::FakeConfig should now be ready for use.
    4. Next, you will actually need to build and install the "missing" crypto modules. These are the modules for which no ppm is easily available, either from Theoryx5 or ActiveState repositories. At the time I built this module, the missing modules were: To install these compiled modules, download the module distrbutions from CPAN, then in the unpacked directories, type the following to invoke ExtUtils::FakeConfig:
      perl -MConfig_m Makefile.PL
      nmake
      nmake test
      nmake install
      
      This should work whether the module is XS or not.
    5. Next you will need to install the required PPM modules. Below is a Windows .bat file which I wrote to automate the process somewhat. Where the batch file says 'unzip this module into ...', this was because I created zip files for each of the XS modules I was installing. Feel free to do this any way you please or to alter the batch file to suit your needs.
    6. Finally, install Crypt::OpenPGP. Hopefully, all the tests should run without error, since you have installed all the dependencies above.

    After all this, you should be done! :-) Perhaps some kind soul with Visual C++ 6 (the same version as Perl is built with) would take pity, and build ppm version of the missing modules? Perl folk are a generous lot, so you never know...

    Of course, after all this effort, you may like to ask yourself: why not just shell out to gpg.exe? ;-) I'll leave the answer to that to you...

    I hope that this helps.

    Cheers,

    -- Dave :-)


    $q=[split+qr,,,q,~swmi,.$,],+s.$.Em~w^,,.,s,.,$&&$$q[pos],eg,print
Re: Installing Modules in Windows
by BrowserUk (Patriarch) on Jul 20, 2004 at 05:39 UTC

    Many CPAN modules that aren't available via PPM from the Active State repository, are available from other PPM repositories.

    You can use google to try and locate individuals and then install using explicit instructions as tachyon showed.

    You can also add the names of one or more extra repositories to PPM so that a PPM search module::name will search at all the repositories to tell it about.

    One problem is that the instructions for adding extra repositories that I've found displayed at many of the other sites are out of date. The say something like:

    P:\test>ppm PPM - Programmer's Package Manager version 3.1. Copyright (c) 2001 ActiveState Corp. All Rights Reserved. ActiveState is a devision of Sophos. Entering interactive shell. Using Term::ReadLine::Stub as readline lib +rary. Type 'help' to get started. ppm> set rep winnipeg http://theoryx5.uwinnipeg.ca/ppms Unknown or ambiguous setting 'rep'. See 'help settings'. ppm>

    and if you follow the prompt and type "help settings", it tells you exactly nothing about repositories.

    The way to do it now is

    c:\> ppm ppm> rep add winnipeg http://theoryx5.uwinnipeg.ca/ppms ppm> rep Repositories: [1] Jenda [2] winnipeg [3] ActiveState PPM2 Repository [4] ActiveState Package Repository [5] Roth [6] bioperl ppm> rep describe 2 Describing Active Repository 2: Name: winnipeg Location: http://theoryx5.uwinnipeg.ca/ppms Type: Webpage ppm> ppm> search IPC::Run Searching in Active Repositories 1. IPC-Run [0.77] system() and background procs w/ piping, redirs, +ptys (Unix, Win32) 2. IPC-Run [0.78] system() and background procs w/ piping, redirs, +ptys (Unix, Win32) 3. IPC-Run3 [0.01] Run a subprocess in batch mode (a la system) on U +nix, Win32, etc. ppm> describe 2 ==================== Package 2: Name: IPC-Run Version: 0.78 Author: Barrie Slaymaker (barries@slaysys.com) Title: IPC-Run Abstract: system() and background procs w/ piping, redirs, ptys (Unix, + Win32) Location: ActiveState PPM2 Repository Available Platforms: 1. MSWin32-x86-multi-thread-5.8 ==================== ppm> install 2 Package 2: Note: Package 'IPC-Run' is already installed. ==================== Install 'IPC-Run' version 0.78 in ActivePerl 5.8.3.809. ==================== Downloaded 99775 bytes. Extracting 17/17: blib/arch/auto/IPC/Run/.exists Successfully installed IPC-Run version 0.78 in ActivePerl 5.8.3.809. ppm>

    See "help rep" at the PPM prompt for (much) more.

    Unfortunately, Crypt::OpenPGP doesn't appear to be available for 5.8 on any of the repositories I have set up.

    Addendum: I found this which basically repeats the information above, but also has the longest list of PPM repositories I've yet seen.

    Unfortunately none of them has Crypt::OpenPGP for 5.8 either.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon
Re: Installing Modules in Windows
by tachyon (Chancellor) on Jul 20, 2004 at 04:45 UTC
    A Guide to Installing Modules will help. Crypt::OpenPGP is pure perl so should not cause you any grief. Also for cryptographic ppms in general (activestate does not support them any more) go to http://theoryx5.uwinnipeg.ca/ and select the link for 8xx or 6xx. Then (privided they have what you are after) you just do:
    C:\>ppm install http://theoryx5.uwinnipeg.ca/ppms(or 5.8 path)/Crypt-W +hatever.ppd

    cheers

    tachyon

Re: Installing Modules in Windows
by gaal (Parson) on Jul 20, 2004 at 04:34 UTC
    Yes, you may use CPAN.pm even on ActivePerl. In this case, installation should work without a hitch since you're installing a pure Perl module.

    If you need to install modules with XS or other components that need a c compiler, you'll need a c compiler :-)

    If you do that a lot, it might be simpler for you to install Cygwin, which comes with gcc and the rest of the GNU c toolchain.

Re: Installing Modules in Windows
by johnnywang (Priest) on Jul 20, 2004 at 07:47 UTC
    somehow nobody above mentioned the CPAN module that is used to install most packages direclty from CPAN, thought I'd add it here.

    Usually you invoke the CPAN shell as:

    perl -MCPAN -e shell
    then simply type:
    install Crypt::OpenPGP
    In this particular case, it has many dependencies, it will ask you whether you want to install those, just say yes.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://375793]
Approved by castaway
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-26 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found