MAKEPKG(8)

NAME
makepkg - make Zenwalk and Slackware packages.

SYNOPSIS
makepkg [--linkadd ans | -l ans] [--chown ans | -c ans] [--prepend|-p] [--inplace|-i] packagename

DESCRIPTION
makepkg creates a new Zenwalk or Slackware compatible package. The package is constructed using the contents of the current directory and all subdirectories. If symbolic links exist, they will be converted to script code to recreate them when the package is installed. This code will be appended to the primary installation script (install/doinst.sh) , or, if that script does not exist it will be created with those contents.The behaviour can be modified using --prepend , -p option ( see OPTIONS below ) .If the path to the symbolic link or the symbolic link itself contains one or more newlines, the symbolic link will not be converted to script code but will be added to package as such because such symbolic link code is not supported by installpkg(8),upgradepkg(8) and removepkg(8). The package will be written out to the file packagename which should be the full name, including the extension. This is usually .tgz, but .tbz, .tlz, and .txz are also accepted. The proper compression utility (gzip, bzip2, lzma, or xz) needs to be installed on the machine. makepkg doesnot change anything in the current directory and instead creates a working copy of the directory in a temporary directory where it may delete symlinks or change ownership as specified and outputs the package to packagename. This allows makepkg to output the package to the file in the current directory from where it is called.This behaviour differs from the Slackware pkgtools makepkg.Using --inplace, -i causes makepkg to work in the current directory making changes in the current directory like Sackware pkgtools makepkg.
 .

OPTIONS

-l, --linkadd y|n
    If y, add any symbolic links found to the install script (doinst.sh) and delete them. This is the recommended action. If this option is not used, makepkg will prompt if symbolic links are found.

-p, --prepend
    If this option is given, then any symbolic links added to doinst.sh will be prepended to the existing script. This is useful for packages that contain shared libraries that need to be linked first because programs will use them later in the doinst.sh script.

-c, --chown y|n
    If y, makepkg will reset all directory permissions to 755 and ownership to root:root. In general, you should have the permissions and ownerships worked out yourself, so relying on setting this option to y is somewhat sloppy. It is not the default. If an option is not provided, makepkg will prompt.

-i, --inplace
    Using this option, causes makepkg to work in current directory without creating a working copy in temporary directory.All changes such as deleting the symlinks is permanent.Makepkg cannot output the package file in the current directory or any of subdirectories if this option is used

INSTALLATION SCRIPTS
There are 3 types of installation scripts supported in the Slackware package system.

The first is the
    primary installation script. This is found in the subdirectory ./install and must have the name doinst.sh in order to be recognized. This ( and other install scripts ) should be written using the basic Bourne shell syntax recognized by the ash shell, since this is the shell that will be used to execute the script when installing from a Slackware install floppy. This is a common trap - beware of using bash syntax extensions, because the script will work fine when installed from the hard drive, but will bomb out when installed from floppy. If the package is for personal use, this isn't a problem. Be careful, though, if you plan to share your package with other users. The primary installation script is executed immediately after the package is installed with installpkg, pkgtool, or setup.

The second type of script is the
    configuration script. This is found in the subdirectory ./var/log/setup and must have a name that starts with setup. in order to be recongnized. An example is the timezone script: /var/log/setup/setup.timeconfig. These scripts are executed during the CONFIGURE phase of setup, and are re-executed each time the user runs the CONFIGURE option from setup from then on. Typically, the user will go through this phase of setup following the installation of all the packages. Anything that needs to be interactive should go in one of these scripts to avoid halting the package installation process during setup.

The third type of script is the
    onlyonce script. Like the name suggests, these are executed only once after the package is installed, in contrast to the standard configuration script. These scripts are also found in the ./var/log/setup directory and must have a name that starts with setup., but in addition the name must contain the string onlyonce. An example might be a script with the name /var/log/setup/setup.onlyonce.testscript

PACKAGE FORMAT
makepkg uses GNU tar plus GNU gzip or bzip2 or lzma or xz to create its packages. A simple way to extract the contents of a package (without executing the installation scripts, of course) is to use a command like this:

explodepkg package.tgz

Or, something like this:

compression -dc package | tar xvvf -

EXIT STATUS
makepkg processes only one package at a time.The exit status is zero unless their is an error which causes makepkg to exit immediately.The error is reported on standard error.The exit status is set corresponding to the last error occured while processing a package.The exit statuses are given below

    •   1 failed to source functions expects to find it

    •   2 you are not root

    •   3 invalid arguments specified

    •   4 tar not found in PATH

    •   7 failed to create temporary directory

    •   13 external compression utility missing

    •   30 invalid package extension

    •   31 directory doesnot exist or write permission denied

    •   32 cannot output package in same directory

    •   33 failed to change to temporary directory

    •   34 failed to copy working directory

    •   35 failed to add symbolic links to doinst.sh

    •   61 failed to create package

AUTHOR
Anshul Narula <sunny_delhi18@yahoo.com>

SEE ALSO
installpkg(8), explodepkg(8), removepkg(8), pkgtool(8), upgradepkg(8)