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.
    @echo off set PERLDIR=C:\Perl set PPM=%PERLDIR%\bin\ppm3.bat echo * Installing prerequisites for Crypt::OpenPGP... echo * Adding theoryx5 to your list of PPM repositories call %PPM% rep add theoryx5 http://theoryx5.uwinnipeg.ca/ppms call %PPM% rep up 3 call %PPM% rep up 2 echo [Core Features] echo - Data::Buffer (from theoryx5) call %PPM% install Data-Buffer pause echo - MIME::Base64 (from theoryx5) echo Assuming that this is already here. Execute: echo %PPM% install MIME::Base64 echo if this is not the case. pause echo - Math::Pari (from theoryx5) call %PPM% install Math-Pari pause echo - Compress::Zlib (from theoryx5) call %PPM% install Compress-Zlib pause echo - LWP::UserAgent (from ActiveState) echo Assuming that this is already here. Execute: echo %PPM% install LWP echo if this is not the case. pause echo - URI::Escape (from ActiveState) echo Assuming that this is already here. Execute: echo %PPM% install URI-Escape echo if this is not the case. pause echo - Crypt::DSA (from theoryx5) call %PPM% install Crypt-DSA pause echo - Crypt::RSA (from theoryx5) call %PPM% install Crypt-RSA pause echo [PGP2 Compatibility (Minimum)] echo - Crypt::IDEA (from theoryx5) call %PPM% install Crypt-IDEA pause echo - Digest::MD5 (from ActiveState) echo Assuming that this is already here. Execute: echo %PPM% install Digest-MD5 echo if this is not the case. pause echo [PGP5 Compatibility (Minimum)] echo - Crypt::DES_EDE3 (from theoryx5) call %PPM% install Crypt-DES_EDE3 pause echo - Digest::SHA1 (from ActiveState) echo Assuming that this is already here. Execute: echo %PPM% install Digest-SHA1 echo if this is not the case. pause echo [GnuPG Compatibility (Minimum)] echo - Crypt::Rijndael (from theoryx5) call %PPM% install Crypt-Rijndael pause echo - Crypt::CAST5_PP (from local zip) echo Please unzip Crypt-CAST5_PP-1.02.zip into %PERLDIR% pause echo - Crypt::RIPEMD160 (from local zip) echo Please unzip Crypt-RIPEMD160-0.04.zip into %PERLDIR% pause echo [Support for all ciphers] echo - Crypt::IDEA (from theoryx5) echo Installed echo - Crypt::DES_EDE3 (from theoryx5) echo Installed echo - Crypt::CAST5_PP (from local zip) echo Installed echo - Crypt::Blowfish (from theoryx5) call %PPM% install Crypt-Blowfish pause echo - Crypt::Twofish (from local zip) echo Please unzip Crypt-Twofish-2.12.zip into %PERLDIR% pause echo - Crypt::Rijndael (from theoryx5) echo Installed echo [Support for all digests] echo - Digest::MD5 (from ActiveState) echo Installed echo - Digest::SHA1 (from ActiveState) echo Installed echo - Crypt::RIPEMD160 (from local zip) echo Installed echo [FINALLY] echo - Crypt::OpenPGP (from local zip) echo Please unzip Crypt-OpenPGP-1.03.zip into %PERLDIR% pause echo [Installation Completed]
    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

In reply to Re: Installing Modules in Windows by DaveH
in thread Installing Modules in Windows by Gorby

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.