metaf2xml: manual for install.pl 2.9

NAME

install.pl - install metaf2xml from the sources

SYNOPSIS

 install.pl [OPTION]... {all|parser|xsl|ui} [<CONFIG>=<VALUE> ...]

DESCRIPTION

This script installs metaf2xml from the sources.

Note: Alternatives to manual installation
Use installable packages

Various installable packages are available from the File Release System at SourceForge.

Use without installation

metaf2xml can be used without any installation. Just extract one of the source archives or check out the files from the Git repository as described in step 2 below.

The Perl scripts of metaf2xml can be used from the command line without modification. The Perl modules can also be used by other Perl scripts; just use use lib ... in the scripts, or include the path to the module directory in the environment variable PERL5LIB. To use metaf.pl as a web interface without installation, configure the web server to map the URL of the CGI script (e.g. /cgi-bin/metaf.pl) and the XSL files (e.g. /metaf.xsl, /metaf-lang.xml etc.) to the location of the files.

Installation steps

1. Check that you have Perl and the required Perl modules

Perl version 5.14.4 or higher is required for the installation and at runtime. To check, execute perl -v. If this does not execute the Perl binary you want to use, please use the full path to the correct Perl binary (e.g. /usr/local/bin/perl) instead of just perl for this check and also use it as value for PERL (see Miscellaneous settings).

There are the following additional dependencies:

Perl module CGI

required by metaf.pl

Perl modules DBI and DBD, programs curl and xsltproc

optionally required by metaf.pl

Perl module Geo::BUFR

optionally required by metaf2xml::src2raw

2. Get metaf2xml sources

The preferred method is to download the latest source archive from the File Release System at SourceForge. Download either metaf2xml-2.9.zip or metaf2xml-2.9.tgz, depending on which programs for unpacking are available to you and which you are most comfortable with.

SourceForge also offers the creation of ZIP archives on the fly via the web interface to the Git repository, e.g. go to the latest release or development snapshot and then click on the "Download Snapshot" button. You could even download each file separately via these links.

Alternatively, you could clone the Git repository to your machine (Git must be installed, see the SourceForge Git Wiki), and check out the files, e.g. git checkout r2.9 for the latest release, or git checkout unstable for the development snapshot.

3. Extract the files

First choose a (temporary) directory to which to extract files. It must not be one of the intended installation directories or a parent or subdirectory. All files in the archive will be extracted to a subdirectory named metaf2xml-2.9 below the chosen directory.

Then use the command appropriate for the file type with the proper options for the archive file name and the directory to which to extract files.

4. Install the extracted files

First change to the directory with the extracted files, i.e. the subdirectory metaf2xml-2.9 below the directory chosen in step 3.

Then execute perl install.pl (using the Perl binary from step 1) with the appropriate argument for the desired installation target. If you want installation settings which differ from the default, specify them as described in the next section.

5. Test the installation

Now the installation can be tested using the example commands in the manuals for the scripts metaf2xml.pl, metafsrc2raw.pl and metaf.pl.

6. Clean up the temporary files

After the installation, the archive file and the extracted files can be deleted.

DEPENDENCIES

Perl 5.14.4+ is required.

Installation settings

The default settings will install files according to the FHS but below the top level directory /opt/metaf2xml-2.9.

Deviations from the default installation settings can be specified via environment variables or as arguments to the installation command (after the argument for the installation target) in the form CONFIG=VALUE. Arguments have priority over environment variables.

Note that all paths must be specified as absolute paths.

Also note: If cmd.exe is used in MS Windows, the leading and tailing double quotation mark (e.g. added by directory name completion) must be omitted when specifying paths, e.g. use:

 set METAF2XML=c:\Program Files\metaf2xml-2.9

Settings to change the destination directories for files to be installed

METAF2XML (default: /opt/metaf2xml-2.9)

top level directory used as default for several other directories below

METAF2XML_BIN (targets: parser, ui. default: $METAF2XML/bin)

destination directory for the Perl scripts metaf2xml.pl (target parser) and metaf.pl, metafsrc2raw.pl (target ui)

METAF2XML_MAN (targets: parser, ui. default: $METAF2XML/share/man)

destination directory for the manuals for parser.pm, metaf2xml.pl (target parser) and src2raw.pm, metaf.pl, metafsrc2raw.pl (target ui)

METAF2XML_LIB (targets: parser, ui. default: $METAF2XML/lib)

destination directory for the Perl modules parser.pm (target parser) and src2raw.pm (target ui)

METAF2XML_DOC (targets: parser. default: $METAF2XML/share/doc)

destination directory for documentation files COPYING, ChangeLog, README

METAF2XML_SHARE (default: $METAF2XML/share)

destination directory for metaf.dtd (target parser), metaf*.xsl, metaf-lang*.xml, stations.xml (target xsl), and metaf2xml.css (target ui)

CONF_DIR (targets: ui. default: $METAF2XML/etc)

destination directory for the example configuration file for Apache

Settings to change the runtime behaviour

The following settings determine the runtime behaviour of metaf(1). They can also be changed after the installation by changing the assignment of the identically named variables in the installed file.

CGI_DATA_DIR (default: /var/opt/metaf2xml)

directory for files with pre-processed METAR/TAF/SYNOP/BUOY/AMDAR messages

CGI_LOG_DIR (default: /var/opt/metaf2xml)

used to compose the value of CGI_LOG_FILE

CGI_LOG_NAME (default: metaf.log)

used to compose the value of CGI_LOG_FILE

CGI_LOG_FILE (default: $CGI_LOG_DIR/$CGI_LOG_NAME)

complete path for log file

CURL_PATH (default: curl)

full path for curl

CURL_OPTS (default: -sSf)

options for curl

CURL (default: $CURL_PATH $CURL_OPTS)

path and options for curl

CURL_PROXY_OPTS (default: empty)

options for curl if an HTTP proxy should be used

XSLTPROC_PATH (default: xsltproc)

full path for xsltproc

DB_DATA_SOURCES (default: empty)

space delimited strings to describe possible data sources

Miscellaneous settings for the installation

The following settings rarely need to be touched.

PERL (default: /usr/bin/perl)

full path for the Perl binary to be used if the Perl scripts are started via their name (e.g. ./metaf2xml.pl ...)

BUILD_ROOT (default: empty)

additional parent directory for all destination directories, to (temporarily) install all files there instead of the intended final destination directory, e.g. to build an RPM

OPTIONS

-v

print version of install.pl and exit

-n

do not install anything, just print what would be done

-P

remove use lib ... from scripts. Use only when modules are installed to a default Perl installation directory (site lib, vendor lib)

ARGUMENTS

The installation target must be specified. It can be one of the following:

parser

Installs the files required to parse messages and create the XML.

xsl

Installs the XSL example files required to transform the XML to HTML and text.

ui

Installs the files required to download and display weather data.

Requires the installation of the targets parser and xsl.

If the web interface is to be used, a web server like Apache is required. To use Apache for the web interface, include the file $CONF_DIR/metaf2xml-2.9-apache-2.X.conf in your Apache configuration (e.g. link or copy it to /etc/apache/conf.d/) and reload or restart Apache. Then use the URL http://localhost/metaf2xml-2.9/cgi-bin/metaf.pl.

all

Installs the targets parser, xsl, and ui.

EXIT STATUS

If an invalid option was provided or an error occurs during the installation, the script will exit with status 1, otherwise it will exit with status 0.

EXAMPLES

Install all files in the default destination:

 perl install.pl all

Install all files required to parse messages in the structure defined by the FHS but below the directory /usr/local:

 perl install.pl parser METAF2XML=/usr/local

or via prefixed assignment of environment variables in (any variant of) UNIX sh:

 METAF2XML=/usr/local ./install.pl parser

SEE ALSO

metaf2xml::src2raw(3pm), metaf2xml(1), metafsrc2raw(1), metaf(1), https://metaf2xml.sourceforge.io/

copyright (c) 2011-2019 metaf2xml @ SourceForge.net Logo

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.