Installation

nemobis edited this page Jan 24, 2018 · 52 revisions

To get Catmandu running on your system you need to download and install at least the CPAN Catmandu module. Additional modules add support for more input and output formats, databases, and processing options.

To install Catmandu modules select at least Catmandu (and probably Catmandu::MARC, Catmandu::OAI, Catmandu::RDF, Catmandu::XLS)

$ sudo cpanm Catmandu Catmandu::MARC

To install extra Catmandu modules at any point in time, the cpanm command needs to be used.

$ sudo cpanm  Catmandu::OAI
$ sudo cpanm  Catmandu::RDF
$ sudo cpanm  Catmandu::Store::MongoDB
$ sudo cpanm  Catmandu::XLS

To make full usage of the capabilities of Catmandu, database and search engines such as MongoDB, Elasticsearch, Solr, Postgres, MySQL can be installed on the system with the corresponding Catmandu tools. How to install these database on your local system falls outside the scope of this documentation. Please consult the installation guide of the database product for more information. For more information on the available Catmandu packages consult our Distributions list.

Here are some Catmandu installation hints for various platforms.

Debian

Several Catmandu packages are officially included in Debian but not all (see Voting Catmandu packages to be included in Debian and this search of currently available packages).

You can install all packages officially included in Debian:

sudo apt-get update
sudo apt-get install libcatmandu*-perl

Alternatively, you can build newest Catmandu and dependencies from source:

sudo apt-get update
sudo apt-get install cpanminus build-essential libexpat1-dev libssl-dev libxml2-dev libxslt1-dev libgdbm-dev libmodule-install-perl
cpanm Catmandu Catmandu::MARC

Alternatively, you can build newest Catmandu as unofficial packages, using most possible official packages:

sudo apt update
sudo apt install dh-make-perl liblocal-lib-perl apt-file
sudo apt-file update
sudo apt install libtest-fatal-perl libmodule-build-tiny-perl libmoo-perl libmodule-pluggable-perl libcapture-tiny-perl libclass-load-perl libgetopt-long-descriptive-perl libio-tiecombine-perl libstring-rewriteprefix-perl libio-handle-util-perl
cpan2deb --vcs '' MooX::Aliases
cpan2deb --vcs '' Log::Any
cpan2deb --vcs '' App::Cmd
cpan2deb --vcs '' LaTeX::ToUnicode
cpan2deb --vcs '' PICA::Data
cpan2deb --vcs '' LV
cpan2deb --vcs '' MODS::Record
sudo dpkg -i lib*-perl_*.deb
cpan2deb --vcs '' BibTeX::Parser
sudo dpkg -i libbibtex-parser-perl_*.deb
sudo apt install libexporter-tiny-perl
cpan2deb --vcs '' JSON::Path
sudo dpkg -i libjson-path-perl_*.deb
cpan2deb --vcs '' JSON::Hyper
sudo dpkg -i libjson-hyper-perl_*.deb
sudo apt install libhttp-link-parser-perl libautovivification-perl libmatch-simple-perl
cpan2deb --vcs '' JSON::Schema
sudo dpkg -i libjson-schema-perl_*.deb
sudo apt install libjson-xs-perl libtest-exception-perl libtest-deep-perl libfile-slurp-tiny-perl liburi-template-perl libtry-tiny-byclass-perl libdata-util-perl libdata-compare-perl libhash-merge-simple-perl libthrowable-perl libclone-perl libdata-uuid-perl libmarpa-r2-perl libconfig-onion-perl libmodule-info-perl libtext-csv-perl libcgi-expand-perl
dh-make-perl --vcs '' --cpan Catmandu
perl -i -pe 's/libossp-uuid-perl[^,\n]*/libdata-uuid-perl/g' libcatmandu-perl/debian/control
( cd libcatmandu-perl && dpkg-buildpackage -b -us -uc -d )
sudo dpkg -i libcatmandu-perl_*.deb
dh-make-perl --vcs '' --cpan Catmandu::Twitter
perl -i -pe 's/liburi-perl\K[^,\n]*//g' libcatmandu-twitter-perl/debian/control
( cd libcatmandu-twitter-perl && dpkg-buildpackage -b -us -uc -d )
sudo apt install libchi-perl libnet-ldap-perl libdatetime-format-strptime-perl libxml-libxslt-perl libxml-struct-perl libnet-twitter-perl libxml-parser-perl libspreadsheet-xlsx-perl libexcel-writer-xlsx-perl libdevel-repl-perl libio-pty-easy-perl
cpan2deb --recursive --vcs '' Task::Catmandu
sudo apt install 'libcatmandu-*'
sudo dpkg -i libcatmandu-twitter-perl_*.deb
sudo dpkg -i ~/.cpan/build/libcatmandu-*-perl_*.deb

Catmandu::OAI

Alternatively, if you want to install as many packages as possible from the Debian repositories but also to have an additional package like Catmandu::OAI, you need to install packages and build just that module (with any dependency which would conflict if installed from the repositories):

sudo apt-get install build-essential libcatmandu*-perl libexpat1-dev libssl-dev libxml2-dev libxslt1-dev libgdbm-dev libmodule-install-perl dh-make-perl liblocal-lib-perl apt-file libtest-fatal-perl libmodule-build-tiny-perl libmoo-perl libmodule-pluggable-perl libcapture-tiny-perl libclass-load-perl libgetopt-long-descriptive-perl libio-tiecombine-perl libstring-rewriteprefix-perl libio-handle-util-perl libtest-simple-perl libtest-needsdisplay-perl libtest-lwp-useragent-perl cpanminus
sudo cpanm Catmandu::OAI

(Tested in Debian 8 / Jessie and Ubuntu 17.10. Compared to the advice above, we add libtest-simple-perl libtest-needsdisplay-perl libtest-lwp-useragent-perl and avoid libhttp-oai-perl which produces Installed version (3.27) of HTTP::OAI is not in range '4.03'.)

Ubuntu Server 12.04.4 LTS

apt-get install make
apt-get install libmodule-install-perl
apt-get install libyaz-dev
apt-get install libwrap0-dev
apt-get install libxml2-dev zlib1g zlib1g-dev
apt-get install libexpat1-dev
apt-get install libxslt1-dev
apt-get install libssl-dev
apt-get install libgdbm-dev
apt-get install perl-doc
yes | cpan Test::More
yes | cpan YAML
yes | cpan App::cpanminus
/usr/local/bin/cpanm Catmandu Catmandu::MARC

CentOS 6.4

yum groupinstall "Development Tools"
yum install perl-ExtUtils-MakeMaker
yum install perl-CPAN -y
yum install gcc -y
yum install gdbm gdbm-devel -y
yum install openssl-devel -y
yum install tcp_wrappers-devel -y
yum install expat expat-devel -y
yum install libxml2 libxml2-devel libxslt libxslt-devel -y
yes | cpan YAML
yes | cpan App::cpanminus
/usr/local/bin/cpanm Catmandu Catmandu::MARC

CentOS 7

yum group install "Development Tools"
yum install perl-devel perl-YAML perl-CPAN perl-App-cpanminus -y
yum install openssl-devel tcp_wrappers-devel expat expat-devel libxml2 libxml2-devel libxslt libxslt-devel -y
cpanm autodie Catmandu Catmandu::MARC

openSUSE

sudo zypper install --type pattern devel_basis
sudo zypper install libxml2-devel libxslt-devel
curl -L http://cpanmin.us | perl - App::cpanminus  ## unless you already have cpanm
cpanm Catmandu Catmandu::MARC

OpenBSD 53

cpan App::cpanminus
cpanm Catmandu Catmandu::MARC

OSX

Install XCode from the app store first and homebrew from https://brew.sh

brew install libxml++ libxml2 xml2 libxslt
# Install plenv from https://github.com/tokuhirom/plenv
git clone https://github.com/tokuhirom/plenv.git ~/.plenv
echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(plenv init -)"' >> ~/.bash_profile
exec $SHELL -l
git clone https://github.com/tokuhirom/Perl-Build.git ~/.plenv/plugins/perl-build/
# Install a modern Perl
plenv install 5.22.0
plenv rehash
plenv install-cpanm
plenv global 5.22.0

# Install catmandu
cpanm Catmandu Catmandu::MARC
plenv rehash

Windows, Mac OSX, Linux

A docker image of Catmandu is build with each release. After installation of docker get and use the Catmandu image like this:

# Upgrade to the latest version
docker pull librecat/catmandu

# Run the docker command
docker run -it librecat/catmandu

Or, in case you want a native install use Strawberry Perl. Catmandu installations have been tested up to version 5.24.1.1. After installation of the EXE, reboot your machine, start the cmd.exe command line and execute:

cpanm Catmandu Catmandu::MARC 

Raspbian GNU/Linux 7 on the Raspberry Pi (armhf)

Since Raspbian is based on Debian stable, you could follow the instructions there. Unfortunately, you will run into timeouts, so it is advisable to install some prerequisites via apt-get first:

sudo apt-get install libboolean-perl libdevel-repl-perl libnet-twitter-perl 
sudo apt-get install libxml-easy-perl libxslt1-dev libgdbm-dev