metaf2xml: manual for 2.2

NAME - install script for metaf2xml

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


This is the install script for metaf2xml.

Installation steps

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

Perl version 5.10.1 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

Perl modules DBI and DBD, programs curl and xsltproc

optionally required by

Perl module Geo::BUFR

optionally required by metaf2xml::src2raw

2. Get metaf2xml

The preferred method is to download the latest released files via the File Release System of SourceForge. 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. 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.2 for the latest release, or git checkout unstable for the development snapshot.

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

If you decided to install the RPM file, execute rpm -U metaf2xml-2.2-1.noarch.rpm (or use -i instead of -U 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.2 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 as a web interface, configure the web server to map the URL of the CGI script (e.g. /cgi-bin/ 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.2 below the directory chosen in step 4.

Then execute perl (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.

7. Test the installation

Now you can test the installation using the example commands in the manuals for the programs, and

8. Cleanup temporary files

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


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

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

Settings to change the destination directories for files to be installed

METAF2XML (default: /opt/metaf2xml-2.2)

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 (target parser) and, (target cgi)

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

destination directory for the manuals for, (target parser) and,, (target cgi)

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

destination directory for the Perl modules (target parser) and (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/, 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


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.

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. ./ ...)

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



print version of and exit


do not install anything, just print what would be done


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


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


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


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.2-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.2/cgi-bin/


Installs the targets parser, xsl, and cgi.


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.


Install all files in the default destination:

 perl all

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

 perl parser METAF2XML=/usr/local

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

 METAF2XML=/usr/local ./ parser


metaf2xml::src2raw(3pm), metaf2xml(1), metafsrc2raw(1), metaf(1),

copyright (c) 2011-2017 metaf2xml @ 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