NAME
LCFG::Build::Tool::CheckMacros - LCFG software packaging tool
VERSION
This documentation refers to LCFG::Build::Tool::CheckMacros version 0.9.20
SYNOPSIS
my $tool = LCFG::Build::Tool::CheckMacros->new( dir => '.' );
$tool->execute;
my $tool2 = LCFG::Build::Tool::CheckMacros->new_with_options();
$tool2->execute;
DESCRIPTION
This module provides software release tools for the LCFG build suite.
The LCFG build tools have support for autoconf-style (e.g. @FOO@) macro substitution when building packages. There is a set of macros which are built-in and the list can be extended by the user. This is a tool for checking substitution variable usage to help spot potential problems. It prints out a list of warnings, ordered by importance, along with the file names and line numbers of where the macros are used.
More information on the LCFG build tools is available from the website http://www.lcfg.org/doc/buildtools/
ATTRIBUTES
The following attributes are modifiable via the command-line (i.e. via @ARGV) as well as the normal way when the Tool object is created. Unless stated the options take strings as arguments and can be used like --foo=bar
. Boolean options can be expressed as either --foo
or --no-foo
to signify true and false values.
- fix_deprecated
-
A boolean value which indicates whether any deprecated macros that are found in the files scanned should be automatically replaced with their modern equivalents.
- dryrun
-
A boolean value which indicates whether actions which permanently alter the contents of files should be carried out. The default value is false (0). When running in dry-run mode various you will typically get extra output to the screen showing what would have been done.
- quiet
-
A boolean value which indicates whether the actions should attempt to be quieter. The default value is false (0).
- dir
-
The path of the project directory which contains the software for which you want to create a release. If this is not specified then a default value of the current directory (.) will be used. This directory must already contain the LCFG build metadata file (lcfg.yml) for the software.
The following methods are not modifiable by the command-line, they are however directly modifiable via the Tool object if necessary. Typically you will only need to query these attributes, they are automatically created when you need them using values for some of the other command-line attributes.
- spec
-
This is a reference to the current project metadata object, see LCFG::Build::PkgSpec for full details.
- vcs
-
This is a reference to the current version-control object, see LCFG::Build::VCS for full details.
SUBROUTINES/METHODS
- execute
-
This method should be called to check macro usage within a project. It will check every file which matches the specifications in the
translate
list (specified in the metadata file). Also, if present, it will check the template for the project specfile. See the "EXPLANATION OF OUTPUT" section below for an outline of the messages which might be generated. - fail($message)
-
Immediately fails (i.e. dies) and displays the message.
- log($message)
-
Logs the message to the screen if the
quiet
attribute has not been specified. A message string is prefixed with 'LCFG: ' to help visually separate it from other output.
EXPLANATION OF OUTPUT
The possible warnings are listed in order of importance are:
- Use of unknown macro
- Use of deprecated macro
- Use of linux-only macro
- Use of macosx-only macro
- Use of compile-time-only macro
Note that none of the warnings can be truly considered an error. Even a message about an unknown macro is fine if you add the specification for that variable to a local CMakeLists.txt
file for that component. In general it has to be left up to the software author to interpret the true importance of a particular warning
The special case in which all of these warnings (except that for "deprecated macro") should be considered a fatal error is with the RPM specfile. By design, locally defined macros and those which are platform specific or compile-time only cannot be used in the specfile.
DEPENDENCIES
This module is Moose powered and uses MooseX::App::Cmd to handle command-line options.
The following modules from the LCFG build tools suite are also required: LCFG::Build::Tool, LCFG::Build::PkgSpec, LCFG::Build::VCS and VCS helper module for your preferred version-control system.
SEE ALSO
LCFG::Build::Tools, LCFG::Build::Skeleton, lcfg-reltool(1)
PLATFORMS
This is the list of platforms on which we have tested this software. We expect this software to work on any Unix-like platform which is supported by Perl.
Fedora12, Fedora13, ScientificLinux5, ScientificLinux6, MacOSX7
BUGS AND LIMITATIONS
There are no known bugs in this application. Please report any problems to bugs@lcfg.org, feedback and patches are also always very welcome.
AUTHOR
Stephen Quinney <squinney@inf.ed.ac.uk>
LICENSE AND COPYRIGHT
Copyright (C) 2008 University of Edinburgh. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the terms of the GPL, version 2 or later.