05 Sep 2001 20:13:27 UTC
- Distribution: Module-MetaInfo
- Module version: 0.01
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (2)
- Testers (187 / 310 / 0)
- KwaliteeBus factor: 0
- 79.21% Coverage
- License: unknown
- Activity24 month
- Download (173.15KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionMIKEDLR Michael De La Rue
- DIRECTORY NAME
- DIRECTORY FORMAT
- SEARCH PATH
- RULES FOR CREATING META INFO FILES
DirTree - get metainfo from a directory in a the perl module
This is a (experimental) module designed to get meta information from a special directory which is kept inside the perl-module.
The main directory for meta data is PkgData. This name is chosen because within the CPAN collection distributed by RedHat none of the existing modules had any files matching
Within that directory all names starting with
opt_are reserved for subdirectories for use for meta information which overrides the default in special circumstances. E.g.
opt_rpmis for data which should be different specifically for rpm.
The directory contains files which contain the meta information. The files each have their own format.
This should contain a one line summary of what the module is for.
This contains the description of the module. This should be a few lines of text which explain what the module does. At present this should be in plain text format (ASCII - no internationalisation !??!).
A typical maximum length would be about 20-30 lines.
This will contain a list of documentation file names, one per line. The names can refer to individual files or whole directories. They are relative to the top level directory of the perl module.
This file contains a perl script for building the meta information. This script will be run with the current directory the main directory of the distribution
Avoid using this script
In order to provide your own descriptions of certain RPMs, you can put a file with the name of the module into a specified directory. This will then be used in the description field exactly as it is. This file will override all other possibilities since we assume that the package builder could delete the override file if wanted. Where there turns out to be an
pkg-data-XXX/descriptionas well as a description we give a warning.
build.sh install.sh clean.sh pre.sh post.sh preun.sh postun.sh verify.sh
These give direct access to the various RPM scripts of (almost)the same names. The text included is copied verbatim into the spec file.
The prep and build scripts are run after makerpm's normal options. The clean script is run before hand (whilst the build directory is still there) install script is run after deleting the previous build root, but before running the normal install options. This means that you have to create your own directories.
The default search path is only the
PkgDatadirectory in the base directory of the perl module. Calling the <add_option> function will mean that the directory
PkgData/opt_ARGdirectory will be checked where ARG is the argument to
add_option. Option directories are checked before the main package directory.
add_data_dirfunction will cause the
ARG/package_namedirectory to be searched.
Each directory on the path is checked in turn.
When creating a metainfo file, the general rule is to always create the file in the generic (top level) directory. The opt directories should only be used for special cases.
Given a filename this simply returns the contents.
this finds the correct configuration file for a given name by searching through the path of different directories where it could be then calling _read_file() to read the file and returns the contents of the file.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README.
Module Install Instructions
To install Module::MetaInfo, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Module::MetaInfo
For more information on module installation, please visit the detailed CPAN module installation guide.