<<

NAME

Makefile.PL - Koha packager and installer

SYNOPSIS

BASIC INSTALLATION

    perl Makefile.PL
    make
    make test
    sudo make install

UPGRADE INSTALLATION

    NOTE: This option is only available if koha-install-log exists.

    perl Makefile.PL --prev-install-log /path/to/koha-install-log

    make
    make test
    sudo make upgrade

PACKAGING RELEASE TARBALLS

    make manifest tardist
    make manifest zipdist

CLEANING UP

        make clean

CLI PARAMETERS

    --prev-install-log           Read configuration from previous installation
    --install_mode               Installation mode (dev, standard, single)
    --db_type                    Database (mysql, Pg)
    --db_host                    Database host (e.g. localhost)
    --db_port                    Database port (e.g. 3306)
    --db_name                    Database name (e.g. koha)
    --db_user                    Database user (e.g. kohaadmin)
    --db_pass                    Database password (e.g. katikoan)
    --zebra_marc_format          Zebra MARC format (marc21, unimarc)
    --zebra_language             Zebra language (e.g. en)
    --zebra_tokenizer            Zebra tokenizer (chr, icu)
    --zebra_user                 Zebra user (e.g. kohauser)
    --zebra_pass                 Zebra password (e.g. zebrastripes)
    --zebra_sru_host             Zebra SRU servername (e.g. localhost)
    --zebra_sru_biblios_port     Zebra SRU biblios port (e.g. 9998)
    --zebra_sru_authorities_port Zebra SRU biblios port (e.g. 9999)
    --koha_user                  Koha Unix user (e.g. koha)
    --koha_group                 Koha Unix group (e.g. koha)
    --install_sru                Install the SRU server (yes, no)
    --use_memcached              Use Memcached (yes, no)
    --font_dir                   Location of fonts (e.g. /usr/share/fonts/truetype/dejavu)
    --run_database_tests         Run database dependent tests (yes, no)
    --install_base               Base directory of installation (e.g. /usr/share/koha)
    --template-cache-dir         Specify a template cache directory (e.g. /var/cache/koha)
    --help                       Display this help message

DESCRIPTION

This is a packager and installer that uses ExtUtils::MakeMaker, which is fairly common on perl systems. As well as building tar or zip files and installing with the above commands, it allows us to check pre-requisites and generate configuration files.

VARIABLES

NAME, VERSION_FROM, ABSTRACT, AUTHOR

Basic metadata about this software.

NO_META

Suppress generation of META.yml file.

PREREQ_PM

Hash of perl modules and versions required.

PM

Hash of file mappings

PL_FILES

This is a hash of PL scripts to run after installation and the files to ask them to generate. Maybe use the values from CONFIGURE to generate initial configuration files in future.

target_map

This is a hash mapping directories and files in the source tree to installation target directories. The rules for this mapping are:

If a directory or file is specified, it and its contents will be copied to the installation target directory.
If a subdirectory of a mapped directory is specified, its target overrides the parent's target for that subdirectory.
The value of each map entry may either be a scalar containing one target or a reference to a hash containing 'target' and 'trimdir' keys.
Any files at the top level of the source tree that are not included in the map will not be installed.
Any directories at the top level of the source tree that are not included in the map will be installed in INTRANET_CGI_DIR. This is a sensible default given the current organization of the source tree, but (FIXME) it would be better to reorganize the source tree to better match the installation system, to allow adding new directories without having to adjust Makefile.PL each time. The idea is to make the $target_map hash as minimal as possible.

The permitted installation targets are:

INTRANET_CGI_DIR

CGI scripts for intranet (staff) interface.

INTRANET_TMPL_DIR

HTML templates for the intranet interface.

INTRANET_WWW_DIR

HTML files, images, etc. for DocumentRoot for the intranet interface.

OPAC_CGI_DIR

CGI scripts for OPAC (public) interface.

OPAC_TMPL_DIR

HTML templates for the OPAC interface.

OPAC_WWW_DIR

HTML files, images, etc. for DocumentRoot for the OPAC interface.

PERL_MODULE_DIR

Perl modules (at present just the C4 modules) that are intimately tied to Koha. Depending on the installation options, these may or may not be installed one of the standard directories in Perl's default @LIB.

KOHA_CONF_DIR

Directory for Koha configuration files.

ZEBRA_CONF_DIR

Directory for Zebra configuration files.

ZEBRA_LOCK_DIR

Directory for Zebra's lock files. This includes subdirs for authorities, biblios, and the zebra rebuild function. Any activity to reindex zebra from koha should interlock here with rebuild_zebra.pl.

ZEBRA_DATA_DIR

Directory for Zebra's data files.

ZEBRA_RUN_DIR

Directory for Zebra's UNIX-domain sockets.

ELASTICSEARCH_SERVERS

Server:port of the Elasticsearch server to use, as a comma separated list: eg. 192.168.0.100:9200, localhost:9200

ELASTICSEARCH_INDEX

Unique index in Elasticsearch, for this Koha-instance eg. koha-mykoha or just koha

MISC_DIR

Directory for for miscellaenous scripts, among other things the translation toolkit and RSS feed tools.

SCRIPT_DIR

Directory for command-line scripts and daemons to be set up all for installation modes.

SCRIPT_NONDEV_DIR

Directory for command-line scripts that should be installed in the same directory as the SCRIPT_DIR target except 'dev' installs.

MAN_DIR

Directory for man pages created from POD -- will mostly contain information of interest to Koha developers.

DOC_DIR

Directory for Koha documentation accessed from the command-line, e.g., READMEs.

LOCK_DIR

Directory for Koha scripts to put their locks.

LOG_DIR

Directory for Apache and Zebra logs produced by Koha.

BACKUP_DIR

Directory for backup files produced by Koha.

PLUGINS_DIR

Directory for external Koha plugins.

FONT_DIR

Directory where DejaVu fonts are installed.

NONE

This is a dummy target used to explicitly state that a given file or directory is not to be installed. This is used either for parts of the installer itself or for development tools that are not applicable to a production installation.

CONFIGURATION OPTIONS

The following configuration options are used by the installer.

INSTALL_MODE

Specifies whether installation will be FHS-compliant (default, assumes user has root), put everything under a single directory (for users installing on a web host that allows CGI scripts and a MySQL database but not root access), or development (for a developer who wants to run Koha from a git clone with no fuss).

INSTALL_BASE

Directory under which most components will go. Default value will vary depending on INSTALL_MODE.

DB_TYPE

Type of DBMS (e.g., mysql or Pg).

DB_HOST

Name of DBMS server.

DB_PORT

Port that DBMS server is listening on.

DB_NAME

Name of the DBMS database for Koha.

DB_USER

Name of DBMS user account for Koha's database.

DB_PASS

Pasword of DMBS user account for Koha's database.

ZEBRA_MARC_FORMAT

Specifies format of MARC records to be indexed by Zebra.

ZEBRA_LANGUAGE

Specifies primary language of records that will be indexed by Zebra.

ZEBRA_USER

Internal Zebra user account for the index.

ZEBRA_PASS

Internal Zebra user account's password.

KOHA_USER

System user account that will own Koha's files.

KOHA_GROUP

System group that will own Koha's files.

SMTP_HOST

SMTP server host name (default: localhost)

SMTP_PORT

SMTP server port (default: 25)

SMTP_TIMEOUT

Connection timeour in seconds (default: 120)

SMTP_SSL_MODE

SSL mode. Options are 'disabled' (default), 'ssl' and 'starttls'

SMTP_USER_NAME

SMTP authentication user name

SMTP_PASSWORD

SMTP authentication password

SMTP_DEBUG

Enable debug mode for SMTP (default: no)

FUNCTIONS

hashdir

This function recurses through the directory structure and builds a hash of hashes containing the structure with arrays holding filenames. This directory hashing routine was taken from BrowserUK @ http://www.perlmonks.org/?node_id=219919

get_file_map

This function combines the target_map and file hash to map each source file to its destination relative to the set of installation targets.

Output will be a hash mapping from each source file to its destination value, like this:

'mainpage.pl' => '$(INTRANET_CGI_DIR)/mainpage.pl'

get_cli_values

Reads values provided on cli for configuration values

get_install_log_values

Reads value from the Koha install log specified by --prev-install-log

get_configuration

This prompts the user for various configuration options.

get_target_directories

Creates a hash mapping from symbols for installation target directories to actual directory paths.

Also returns a hash indicating targets for which files need not be copied -- this is used for the 'dev' mode installation, where some files are installed in place.

get_test_dir

Map a directory target to the corresponding path for the test suite.

find_zebra

Attempt to find Zebra - check user's PATH and a few other directories for zebrasrv and zebraidx.

_update_zebra_conf_target

Add an installation target for updating Zebra's configuration files.

SEE ALSO

ExtUtils::MakeMaker(3)

AUTHORS

MJ Ray mjr at phonecoop.coop Galen Charlton galen.charlton at liblime.com

<<