install.pl - install metaf2xml from the sources
install.pl [OPTION]... {all|parser|xsl|ui} [<CONFIG>=<VALUE> ...]
This script installs metaf2xml from the sources.
Various installable packages are available from the File Release System at SourceForge.
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.
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:
CGI
required by metaf.pl
DBI
and DBD
, programs curl
and xsltproc
optionally required by metaf.pl
Geo::BUFR
optionally required by metaf2xml::src2raw
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.
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.
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.
Now the installation can be tested using the example commands in the manuals for the scripts metaf2xml.pl
, metafsrc2raw.pl
and metaf.pl
.
After the installation, the archive file and the extracted files can be deleted.
Perl 5.14.4+ is required.
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
top level directory used as default for several other directories below
destination directory for the Perl scripts metaf2xml.pl (target parser) and metaf.pl, metafsrc2raw.pl (target ui)
destination directory for the manuals for parser.pm, metaf2xml.pl (target parser) and src2raw.pm, metaf.pl, metafsrc2raw.pl (target ui)
destination directory for the Perl modules parser.pm (target parser) and src2raw.pm (target ui)
destination directory for documentation files COPYING, ChangeLog, README
destination directory for metaf.dtd (target parser), metaf*.xsl, metaf-lang*.xml, stations.xml (target xsl), and metaf2xml.css (target ui)
destination directory for the example configuration file for Apache
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.
directory for files with pre-processed METAR/TAF/SYNOP/BUOY/AMDAR messages
used to compose the value of CGI_LOG_FILE
used to compose the value of CGI_LOG_FILE
complete path for log file
curl
)full path for curl
-sSf
)options for curl
$CURL_PATH $CURL_OPTS
)path and options for curl
options for curl
if an HTTP proxy should be used
xsltproc
)full path for xsltproc
space delimited strings to describe possible data sources
The following settings rarely need to be touched.
full path for the Perl binary to be used if the Perl scripts are started via their name (e.g. ./metaf2xml.pl ...
)
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 install.pl and exit
do not install anything, just print what would be done
remove use lib ...
from scripts. Use only when modules are installed to a default Perl installation directory (site lib, vendor lib)
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.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.
Installs the targets parser, xsl, and ui.
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 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
metaf2xml::src2raw(3pm), metaf2xml(1), metafsrc2raw(1), metaf(1), https://metaf2xml.sourceforge.io/
copyright (c) 2011-2019 metaf2xml @
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/.