install.pl 2.1

NAME

install.pl - install script for metaf2xml

SYNOPSIS

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

DESCRIPTION

This is the install script for metaf2xml.

Installation steps

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

For the installation (and at runtime, too), Perl (version 5.10.1+) must be installed on your system. To check, execute perl -v.

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

The preferred method is to download the released files via the File Release System of SourceForge, e.g. for release 2.1: http://sf.net/projects/metaf2xml/files/2.1. Choose the file type which is most appropriate for you, i.e. get the .rpm if your system can handle RPMs and you just want to install to the default installation directory. Otherwise use the .zip or the .tgz depending on which programs for unpacking are available on your system 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. for release 2.1: http://sf.net/p/metaf2xml/code/ci/r2.1/tarball, or the current development snapshot: http://sf.net/p/metaf2xml/code/ci/unstable/tarball.

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. for release 2.1: "git checkout r2.1", or the current development snapshot: "git checkout unstable".

You could even download each file separately via the web interface to the Git repository, e.g. for release 2.1: http://sf.net/p/metaf2xml/code/ci/r2.1/tree, or the current development snapshot: http://sf.net/p/metaf2xml/code/ci/unstable/tree.

3. For RPM: Install the RPM file and continue with step 7

If you decided to install the RPM file, execute rpm -U (or rpm -i if you want to keep older versions). Most likely, you will need administrator (root) privileges to do that. Then continue with step 7.

4. 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.1 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.

5. Use without install: continue with step 7

The scripts of metaf2xml can be used from the command line without installing.

To use metaf.pl as a web interface, 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.

Then continue with step 7.

6. Install the extracted files

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

Then execute perl install.pl or ./install.pl 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.

7. Test the installation

Now you can test the installation using the example commands in the manuals for the programs metaf2xml.pl, metafsrc2raw.pl and metaf.pl.

8. Cleanup temporary files

Finally you can delete the archive file and the extracted files.

DEPENDENCIES

Perl 5.10.1+ is required.

Installation settings

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

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.1

Settings to change the destination directories for files to be installed

METAF2XML (default: /opt/metaf2xml-2.1)

top level directory used as default for several other directories below

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

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

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

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

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

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

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

destination directory for documentation files COPYING, ChangeLog, README

METAF2XML_XSL (targets: parser, xsl. default: $METAF2XML/share/xml)

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

CGI_BIN_DIR (targets: cgi. default: $METAF2XML/cgi-bin)

destination directory for the copy of/link to $METAF2XML_BIN/metaf.pl, to be used by the web server

HTDOCS_DIR (targets: cgi. default: $METAF2XML/htdocs)

destination directory for the copies of/links to the files in $METAF2XML_XSL (except metaf.dtd, metaf*-text.xsl), to be used by the web server

CONF_DIR (targets: cgi. 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 (default: curl -sSf --stderr -)

path and options for curl

CURL_PROXY_OPTS (default: empty)

options for curl if an HTTP proxy should be used

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.

USE_CP (target: cgi)

Set to 1 if files which are installed a second time in a different directory should be copied instead of linked symbolically. It is set to 1 automatically for systems which do not support symbolic links.

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

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.

cgi

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.1-apache.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.1/cgi-bin/metaf.pl.

all

Installs the targets parser, xsl, and cgi.

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), http://metaf2xml.sourceforge.net/

COPYRIGHT and LICENSE

copyright (c) 2011-2016 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 http://www.gnu.org/licenses/.

install.pl 2.1