-
Notifications
You must be signed in to change notification settings - Fork 194
Installation
If you want to run MetaCPAN locally (why not?), here are a few tips to get you started:
You can download ElasticSearch at http://www.elasticsearch.org/download/. Make sure you download the latest version. After you unzip it, run the following command:
bin/elasticsearchIf you are unable to access http://localhost:9200 (give it a few seconds) you should kill the elasticsearch process and run it in foreground to see the debug output
bin/elasticsearch -fIf you get a "Can't start up: not enough memory" error when trying to start ElasticSearch, you likely need to update your JRE. On Ubuntu:
# fixes "not enough memory" errors
sudo apt-get install openjdk-6-jreIf you haven't installed cpanminus already, see https://metacpan.org/module/App::cpanminus
git clone https://github.com/CPAN-API/cpan-api.git
cd cpan-api
git submodule init
git submodule updateCreate a new file metacpan_server_local.conf having following content:
cpan /full/path/to/cpan
dzil authordeps | cpanm
dzil listdeps | cpanmprove -lv t/
The test suite has to pass all tests.
bin/metacpan mapping --delete--delete will drop all indices first to clear the index from test data.
bin/metacpan release /path/to/cpan/authors/id/You should note that you can index either your CPAN mirror or a minicpan mirror. You can even index just parts of a mirror:
bin/metacpan release /path/to/cpan/authors/id/{A,B}bin/metacpan latestbin/metacpan author --cpan /path/to/cpan/Note that minicpan doesn't provide the 00whois.xml file which is used to generate the index; you will have to download it manually (it is in the authors/ directory) in order to index authors.
wget -O /path/to/cpan/authors/00whois.xml cpan.cpantesters.org/authors/00whois.xml
It also doesn't include author.json files, so that data will also be missing unless you get it from somewhere else.
Start API server on port 5000
plackupThis will start a single-threaded test server. If you need extra performance, use starman instead.
For a full list of options:
bin/metacpan release --helpEV may seem to take forever to install because the test suite hangs, so you may have to install it without first running the test suite:
cpanm --notest EV