NAME

mkencap - Encap package creation tool  

SYNOPSIS

mkencap [options] -b [-DUPCBIT] \

        [-m m4_cmd] [-M m4_outfile] \

        [-d download_dir] [-F environment_file] \

        [-O build_tree] [-S src_tree] profile

mkencap [options] \

        [ -e [-n] [-a "encapinfo_directive ..."] ] \

        [ -c [-o outfile] ] pkgspec

 

VERSION

This man page documents version 2.3 of mkencap.  

DESCRIPTION

mkencap is a tool to help create Encap 2.1 packages. It can create package directories, generate encapinfo files, and create package archives.  

MODES

Any combination of these modes may be specified when mkencap is invoked. Directory initialization is done first, if selected. Then, if the encapinfo file is needed, it is created. Finally, a tar archive is created if desired.
-b
Build the package from a profile. If the -b option is specified, package should be the path to the file containing the package's profile. (See PACKAGE PROFILE OPTIONS below for other related options.)
-e
Create an encapinfo file in the package directory. (See ENCAPINFO OPTIONS below for other related options.)
-c
Create archive. mkencap will create a (optionally compressed) tar archive of package. (See ARCHIVE CREATION OPTIONS below for other related options.)

If none of these options are selected, mkencap will create an encapinfo file and a tar archive.  

GENERAL OPTIONS

These options may be used in combination with any other options:
-E encap_format
Specify the Encap package format version of the new package. The default is 2.1.
-p platform
Set the package's Encap platform name to platform. If this option is not specified, the platform name is set to that of the host that mkencap is running on.
-A platform_suffix
Appends platform_suffix to the package's Encap platform name.
-f
Force mkencap to overwrite an existing encapinfo file.
-q
Quiet mode. Only error messages are output to stdout.
-s source_dir
Tells mkencap to use source_dir as the Encap source directory. If the source is not specified but the target is, mkencap will assume the relative path from the target to the source is encap/. If neither is specified, mkencap will check the contents of the ENCAP_SOURCE environment variable. If that is not set, it will use the default set at compile-time (usually /usr/local/encap).
-t target_dir
Tells mkencap to use target_dir as the Encap target directory. If the target is not specified but the source is, mkencap will assume the relative path from the source to the target is ../. If neither is specified, mkencap will check the contents of the ENCAP_TARGET environment variable. If that is not set, it will use the default set at compile-time (usually /usr/local).
-v
Increase verbosity. This option can be specified multiple times.
-V
Print mkencap version and compile-time defaults.
 

PACKAGE PROFILE OPTIONS

These options are only meaningful when processing package profiles (see -b option above):
-D
Download source distribution if not already present. The downloaded file is placed in the common source tree.
-U
Unpack source distribution.
-P
Apply any necessary patches to source distribution.
-C
Configure source distribution.
-B
Build source distribution.
-I
Install source distribution to create an Encap package. (This usually needs to be done as root.)
-T
Tidy source distribution.

If none of the -DUPCBIT options are selected, the default is -DUPCB.

-m m4_cmd
Use the command m4_cmd to preprocess the package profile. If the -m option is not specified, mkencap will check the MKENCAP_M4_COMMAND environment variable. If that variable is unset, mkencap will use the string "m4", which means that it will use the first m4 binary available in the PATH.

Note: The preprocessing command must point to GNU m4. If the first m4 binary in your PATH is not GNU m4, you must use either the MKENCAP_M4_COMMAND environment variable or the -m option to specify the path to GNU m4.

This option can be used to simply override which m4 binary is used, as in:


  mkencap -m /usr/local/bin/m4 -b pkgspec.ep

However, it can also be used to add options to be passed to the m4 command, as in:


  mkencap -m "m4 -Dmacro=value" -b pkgspec.ep

-d download_dir
Tells mkencap where to put source files as they are downloaded. If the -d option is not specified, mkencap will check the MKENCAP_DOWNLOAD_DIR environment variable. If that variable is unset, mkencap will use the default set at compile-time (usually /usr/local/src).
-F environment_file
Tells mkencap to read environment variable settings from environment_file. If the -F option is not specified, mkencap will use the default set at compile-time (usually /usr/local/etc/mkencap_environment).
-S src_tree
Tells mkencap where the common source tree is located. For packages that can be built in a seperate directory from where the source code is located, the source code will be stored in the common source tree. If the -S option is not specified, mkencap will check the MKENCAP_SRC_TREE environment variable. If that variable is unset, mkencap will store the source code in the build tree.
-O build_tree
Tells mkencap where the build tree is located. The build tree is used for building packages from source code. If the -O option is not specified, mkencap will check the MKENCAP_BUILD_TREE environment variable. If that variable is unset, mkencap will use the default set at compile-time (usually /usr/local/src).

If the build tree path contains the string "%p", it will be replaced with the platform name.

-M m4_outfile
Tells mkencap to write the output of m4 to the file m4_outfile. If m4_outfile is "-", the output will be written to stdout.

This option is useful for debugging problems caused by m4 preprocessing.

 

ENCAPINFO OPTIONS

These options are only meaningful when creating an encapinfo file (see -e option above):
-n
Do not add default contact, date, and platform fields to the encapinfo file.

When adding the contact field, mkencap will first check the environment variable ENCAP_CONTACT. If unset, it will use the username of the invoking user and the hostname of the host it was run on.

-a encapinfo_directive ...
Adds the specified directive to the encapinfo file. Syntax checking is done to ensure that the line is parsable.

 

ARCHIVE CREATION OPTIONS

This option is only meaningful when creating an archive file (see -c option above):
-o outfile
Specify the output filename when creating an archive. If the filename ends in .tgz or .gz, it is compressed using gzip(1). If the filename ends in .Z, it is compressed using compress(1). If the filename ends in .bz2, it is compressed using bzip2(1).

For Encap 2.0 packages, the default is pkgspec.tar.gz.

For Encap 2.1 packages, the default is pkgspec-encap-platform.tar.gz. The platform string will be read from the encapinfo file.

 

EXAMPLES

To create an encapinfo file for the package "pkg-2.1" with the directives "linkname bin/foo quux" and "linkname man/man1/foo.1 quux.1":

mkencap -ea "linkname bin/foo quux" \

        -a "linkname man/man1/foo.1 quux.1" pkg-2.1

To create an encapinfo file for the package "pkg-3.0" containing the directives "exclude bin/burfle" and "linkdir lib/pkg", and create an archive of the package in your home directory:

mkencap -a "exclude bin/burfle" -a "linkname lib/pkg" \

        -o ~/pkg-3.0-encap-share.tgz pkg-3.0
 

ENVIRONMENT VARIABLES

ENCAP_SOURCE
ENCAP_TARGET
ENCAP_CONTACT
MKENCAP_DOWNLOAD_DIR
MKENCAP_SRC_TREE
MKENCAP_BUILD_TREE
MKENCAP_M4_COMMAND  

FILES

/usr/local/encap/pkgname/encapinfo
/usr/local/etc/mkencap_environment  

SEE ALSO

epkg(1), encap_profile(5)
The Encap Archive (http://www.encap.org/)  

AUTHOR

Mark D. Roth <roth@feep.net>