in reply to Creating a local CPAN server

There's no need to reverse engineer CPAN. A module called CPAN::Mini provides you with everything needed to host a CPAN repository. Once you have the CPAN repo set up, which takes 5/10 minutes, you can then "inject" your own content into it using CPAN::Mini::Inject.

Replies are listed 'Best First'.
Re^2: Creating a local CPAN server
by neilwatson (Priest) on May 04, 2006 at 15:19 UTC
    CPAN::Mini requires a download of about 500MB to setup.

    Neil Watson
    watson-wilson.ca

      That's true, it takes up around 500MB of disk space. However, it's well worth its price per MB. Where are we now, 25/50 cents per GIG?
Re^2: Creating a local CPAN server
by neilwatson (Priest) on May 04, 2006 at 17:11 UTC
    While CPAN::Mini does work (although it is not really that mini). CPAN::Mini::Inject will not install:
    root@tor-svn01 ~/.cpan/build/CPAN-Mini-Inject-0.18 $ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00.load..........# Testing CPAN::Mini::Inject 0.18 t/00.load..........ok t/add..............ok t/inject...........ok t/loadcfg..........ok t/new..............ok t/parsecfg.........ok t/pod-coverage.....skipped all skipped: Test::Pod::Coverage 0.08 required for testing POD + coverage t/pod..............skipped all skipped: Test::Pod 1.00 required for testing POD t/readlist.........ok t/testremote.......ok t/update_mirror....ok 1/8Can't open file index.html: at t/lib/CPANSer +ver.pm line 14, <DATA> line 16. unable to contact the remote mirror at t/update_mirror.t line 31 # Looks like you planned 8 tests but only ran 1. t/update_mirror....dubious Test returned status 7 (wstat 1792, 0x700) DIED. FAILED tests 2-8 Failed 7/8 tests, 12.50% okay t/writelist........ok t/zz.exceptions....skipped all skipped: Test Exceptions required to test croaks Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/update_mirror.t 7 1792 8 7 87.50% 2-8 3 tests skipped. Failed 1/13 test scripts, 92.31% okay. 7/39 subtests failed, 82.05% ok +ay. make: *** [test_dynamic] Error 29
    There is no index.html file any where in the tar ball.

    Neil Watson
    watson-wilson.ca

      I don't recall having this problem. However, I'd probably skip that test and force the install. Once the module is installed it's just a matter of running something like this to inject your module.
      my $repo = CPAN::Mini::Inject->new; $repo->parsecfg( '/home/httpd/html/cpan/.cpancfg' ); $repo->add( module => $app_name, authorid => $app_owner, version => $app_version, file => "$app_dir/$app_file" ); $repo->writelist; $repo->inject;
Re^2: Creating a local CPAN server
by blazar (Canon) on May 04, 2006 at 16:19 UTC

    I had already heard about CPAN::Mini. However taking into account the following discussion in this thread, one gathers the idea that however cheap disk space is becoming now, it is not that "mini" after all.

    Is it possible that one cannot easily setup an infrastructure a' la CPAN only for "local" stuff... CPAN::Micro, any?!?

      CPAN::Mini allows you to filter out content. So I suppose you could filter out everything and then just put your stuff to the repository. The down side is that it's not very convenient to switch your CPAN shell from one repository to another.
        Is it? I thought it would just search each repository in turn. For example if I put my local one first, then if I search a "local module" it will be searched. If I search a real CPAN module, then it won't be find on the local repository and CPAN.pm will switch to the next one. Which repository to put first depends on which kind of module one will need more often...